• (nodebb)

    Yet. Another. Repurposed. TLA.

    ML, apparently, doesn't mean "Machine Language" any more...

  • my name is missing (unregistered)

    Garbage In, Garbage Out. Exactly what I want in my codebase.

  • Edd (unregistered)

    What if we reused good code by taking their libraries and not copy pasting?

  • (author)

    Also, I should add in the comments: I simply cannot wait for the next AI winter.

  • Raul (unregistered) in reply to Steve_The_Cynic

    But ML is two letters, not thr-... oh. Oh this is a good one

  • RLB (unregistered)

    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.

  • Pabz (unregistered)

    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.

  • Patrick Tingen (github)

    Just curious: in what unit did you expect the return value of "calculateDaysBetweenDates"?

  • RussellWakely (google) in reply to Patrick Tingen

    I too wondered this. I guess that Remy's real objections to the method might be any of

    • "oneDay" could be named "numMillisInOneDay"
    • method uses round instead of floor ( so for time differences of less than a day, it returns a value of 1.. not really a problem IMO if the method documents it)
    • conversion from "milliseconds" to "number of days" should be done ideally in a separate method ?

    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

  • (nodebb)

    Copliot: The vaunted imperative copy-pasta style is hard to read and understand, but now it's even easier to write!

  • (author) in reply to Patrick Tingen

    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.

  • (nodebb) in reply to RussellWakely

    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 and date2 are expressed in some canonical representation e.g. seconds since 1970-01-01T00:00Z, but who knows if they are in this case?

  • (nodebb) in reply to Remy Porter

    "calculating the difference between two timestamps" and "converting that difference to days" are two different things

    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 and 24 Hours are simply not substitutable concepts.

  • gnasher729 (unregistered) in reply to Remy Porter

    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).

  • (nodebb) in reply to Remy Porter

    Yes, it's long over due.

  • Guest Tester (unregistered)

    Hence....the reason for software testers!

    Practice doesn't make perfect. Perfect practice makes perfect.

  • Cherry Picking (unregistered)

    "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.

  • Carl Witthoft (google) in reply to Steve_The_Cynic

    "ML" meant "maximum likelihood" long before "machine learning" was coined.
    Or megaliter. Or Merrill-Lynch.

  • Twither (unregistered)

    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.

  • Sole Purpose Of Visit (unregistered)

    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.

  • Sole Purpose Of Visit (unregistered)

    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.

  • (nodebb) in reply to Pabz

    I have the horrible feeling that this will make the PHBs think that they can write the code themselves and fire us professionals.

    That was what COBOL was supposed to allow; it didn't happen. Spreadsheets achieved it to a small degree.

  • (nodebb) in reply to Sole Purpose Of Visit

    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.

  • Grzes (unregistered)

    Please attach screenshots of Twitter entries, as they may disappear (one in fact seem to be unavailable).

  • Worf (unregistered)

    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.

  • Erwin (unregistered) in reply to Steve_The_Cynic

    Apparently, AI can also mean "Artificial Incompetence"

  • jo (unregistered)

    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.

  • Victor (unregistered)

    We've all written bad code at some point, and we're all going to write bad code again. We tell ourselves we'll refactor, but we never do. We make choices which make sense now, but in six months a new feature breaks our design and we've gotta hack things together so we can ship

    Who are you, that know me so well? You just forgot the part about 0% guilt.

  • (nodebb) in reply to Carl Witthoft

    "ML" meant "maximum likelihood" long before "machine learning" was coined. Or megaliter. Or Merrill-Lynch.

    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.

  • ooOOooGa (unregistered)

    "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.

  • Best Of 2021 (unregistered)

    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.

  • Randal L. Schwartz (google)

    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.

  • (author)

    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.

Leave a comment on “A Brillant Copilot”

Log In or post as a guest

Replying to comment #529408:

« Return to Article