- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Yet. Another. Repurposed. TLA.
ML, apparently, doesn't mean "Machine Language" any more...
Admin
Garbage In, Garbage Out. Exactly what I want in my codebase.
Admin
What if we reused good code by taking their libraries and not copy pasting?
Admin
Also, I should add in the comments: I simply cannot wait for the next AI winter.
Admin
But ML is two letters, not thr-... oh. Oh this is a good one
Admin
I think you're being too nice in this one, Remy. You should've said that humans are bad at programming, and when we make computers program for us, they compound our errors in their code with our errors in their data sets, and are therefore even worse at it.
Admin
I have the horrible feeling that this will make the PHBs think that they can write the code themselves and fire us professionals. Or the PHBs might think that professionals will be able to write code in a quarter of the time by throwing together poor examples of code from this system.
Admin
Just curious: in what unit did you expect the return value of "calculateDaysBetweenDates"?
Admin
I too wondered this. I guess that Remy's real objections to the method might be any of
But other than the last point, i don't see what the violation of single responsibility principle is here.. even if you extract the conversion for reuse, the behaviour / name / signature of the method doesn't change
Admin
Copliot: The vaunted imperative copy-pasta style is hard to read and understand, but now it's even easier to write!
Admin
Oh, I expect the method to return a number of days- but "calculating the difference between two timestamps" and "converting that difference to days" are two different things, hence my opinion about violating SRP. Or, to get to the key point: this isn't code you should be writing in the first place, this is 100% grab a date handling library territory.
Admin
There's also the problem that in many time zones, some days only have 23 hours in them and some have 25 hours in them. This won't be a problem if
date1
anddate2
are expressed in some canonical representation e.g. seconds since 1970-01-01T00:00Z, but who knows if they are in this case?Admin
The core problem with converting millis into days is that days are not a constant length. Leaving aside such craziness as leap seconds, you've got the basic problem that days change their length around the time of the year when DST rules are modified in your locale. This sort of thing is why
1 Day
and24 Hours
are simply not substitutable concepts.Admin
Well, the function has one responsibility; Return the difference between two dates in days. It does that. How it does it, who cares. (Within reason obviously).
Admin
Yes, it's long over due.
Admin
Hence....the reason for software testers!
Practice doesn't make perfect. Perfect practice makes perfect.
Admin
"A human being looked at these examples and decided that it's a good way to demonstrate the power of their new tool. Presumably a group"
Yeah... aaaand if that's the best, you really don't want to see what else the model churned out that they turned down. There are quite a few areas where ML is inappropriate - namely in areas where there are optimal or "solid" solutions. Don't get me wrong - I absolutely love ML in cases where it's appropriate. It's very powerful and I can't wait to see more quantum computing + ML solutions. It makes the untractable doable, in exchange for being untractable itself.
Admin
"ML" meant "maximum likelihood" long before "machine learning" was coined.
Or megaliter. Or Merrill-Lynch.
Admin
I have a feeling that the purpose of Copilot isn't to write code, but to get the programmers mind unstuck by giving a suggestion, even if it's a bad suggestion. When presented with an empty function body, sometimes the brain just turns off and refuses to produce code. When presented with a proposal, at least we can start thinking about what it does, and how we would do it better.
Admin
What's wrong with, you know, just using "auto complete?"
Works in Web Browsers (or at least in Bing, the one I worked on). Works in VS. Presumably works in Eclipse, or Java IDE of choice. Works practically everywhere.
In what sense does ML, which inherently relies on massive data sets rather than on actual syntax and AST, plus which has a built in P/R "judgement", improve on what is already there?
Wait, wait. Obviously the wrong question.
Admin
And also I missed Remy's best point.
Ask yourself. Is it remotely possible that an ML solution (even for a trivial method) is at all likely to find a suitable library method?
Just take dates for an example. It might take you or me a minute to look a date function up on Stack Overflow. Maybe more. But ML doesn't work that way, so it will just chug along and produce the best possible copy-pasta it can imagine (perhaps, as Remy says, incorporating and without warning FOSS solutions, if those are part of the training set).
I mean, there's just so much stupidity here that I've hardly started. It makes Z Notation sound halfway sane.
Admin
That was what COBOL was supposed to allow; it didn't happen. Spreadsheets achieved it to a small degree.
Admin
Most IDEs can already do autocomplete of identifiers and short strings. Copilot is supposed to extend this to larger code blocks, like loops. It uses AI to figure out what higher level problem you're trying to solve, and plugs in a complete block of code that does it.
Admin
Please attach screenshots of Twitter entries, as they may disappear (one in fact seem to be unavailable).
Admin
I think we need to have a new category on TheDailyWTF - GitHub CoPilot produced code.
I didn't think we were ever in danger of running out of content, and I guess with GitHub's new feature, we have such a ready source of it that maybe we need to separate it out - I mean, no human would write that code... would it?
And then, maybe we need to go meta and see what ML produces after reading TheDailyWTF.
Admin
Apparently, AI can also mean "Artificial Incompetence"
Admin
I can't fathom how anyone ever thought this was going to be a good idea. I've been coding all my life and I don't think I've ever written the same thing twice. Whenever I wanted to, I wrote reusable library code instead. It's a creative process and AI can't do that at all. Even if they trained it on the cleanest pieces of code ever written, it would never work. This is a disgrace, and it makes me angry that they're fooling the less knowledgeable programmers using it.
Admin
Who are you, that know me so well? You just forgot the part about 0% guilt.
Admin
So that just makes it a rerererepurposed TLA, which is probably worse.
And I was also thinking of e.g. SDLC, which apparently doesn't mean "Synchronous Data-Link Control" these days.
Admin
"It's ironic that the biggest obstacle to automating programmers out of a job is that we are terrible at our jobs."
Yes, but not really. Rice's Theorem is the biggest obstacle to automating programming. That is why we humans are bad at programming, and why algorithms are worse.
Admin
The mindset to think that a tool like this is a good idea and will create anything more meaningful than faceplanting onto a Google search of StackOverflow is quite concerning. It's basically a WTF generator.
Admin
I'll have to say that in the couple of days I've been using it, I've been impressed (not sarcasm!). I was updating a copyWith: constructor, and after I did a few of the fields in the constructor order, it started spookily autocompleting the full line with the next parameter! But for every win like that, there's also a lose, and it takes a smart person in chair to quickly recognize the rest. For example, it gave me a Java snippet for some Dart code. Yeah, they're similar except in the details.
Admin
Copilot looks like a useful tool for a limited purpose. It's not a fully self-driving car, but then, neither are self-driving cars.