back to article Pair programming? That's so 2017. Try out this deep-learning AI bot that autocompletes lines of source code for you

Talk about working smarter, not harder. A computer-science student has got the right idea, by building an intriguing code-completion tool that uses deep-learning software to finish lines of source. And while, yes, there are already a ton of source-code autocomplete tools available, this one, dubbed Deep TabNine, is said to be …

Page:

  1. Doctor Syntax Silver badge

    Is it just me or does anyone else see "trained neural network" and read "garbage in, garbage out"?

    1. Rich 11

      There are certainly some programmers I wouldn't want to see training this thing.

      1. Anonymous Coward
        Anonymous Coward

        It reminds me of a recent graduate who was let loose on Netbeans, which provides all kinds of helpful hints as to how to improve your code. Unfortunately the hints sometimes make code almost unreadable, and of course they don't take int account why something might have been done that way.

        So he took a major piece of code and implemented every single suggestion. The result was interesting, but unless he went and did it to the entire codebase and then tested the entire lot, it would have been a documentation nightmare.

      2. stiine Silver badge
        Devil

        oh boy

        Some of the more talented bastards at 4chan could probably make this use of AI a resounding success*.

        * - hell, for that matter, so could Randall Munroe.

    2. JetSetJim
      Pint

      I can well imagine it being used on I/O sanitation, the AI 'thinking':

      "nobody else cares to check if this string entry contains special characters, or overflows the length of a buffer, so why should I?", and then gets given Bobby Tables input strings.

      All the same, an interesting project that is deserving of a pint/doctorate. I do hope someone does sensible unit testing on all the code it writes (although if it's just auto completing individual lines of code one would hope that there's a certain amount of user checking going on anyway - assuming a competent user, of course!).

      1. Rich 11

        assuming a competent user, of course!

        There'd certainly be a risk of following its suggestions without thinking too clearly about the implication of any particular suggestion. No doubt that response would be something a human could learn to cope with, and minimise, but that's still one more load to deal with in an already loaded brain. When I think of the times that I've been writing a document or email and only belatedly spotted that autocomplete/autocorrect has mangled a sentence for me, I can't help but think there's a downside it's going to take some time to get used to and learn to manage.

      2. Nolveys
        Terminator

        I do hope someone does sensible unit testing on all the code it writes.

        It can do that itself based on its "understanding" of what it's trying to accomplish.

        if( !is_garbage( output ) ) test_fail();

        1. Cederic Silver badge

          Your test framework is shite.

          test(is_garbage(output));

          Come on, JUnit had this sorted last century.

          1. jake Silver badge

            You do realize that the word "shite" was coined in the 1950s to refer to (supposedly) recreational drugs, usually heroin or morphine, but sometimes pot.

            I believe the word you were actually looking for was "shit". If it was good enough for Chaucer, it should be good enough for you.

            1. Cederic Silver badge

              I fear you are misinformed (and want a cookie for resisting 'are talking shite').

              "Shite, now a jocular or slightly euphemistic and chiefly British variant of the noun, formerly a dialectal variant, reflects the vowel in the Old English verb (compare German scheissen)"

              -- https://www.etymonline.com/word/shit

    3. SVV

      This is certainly the problem with the "training" approach. If he trained it looking at Stack Overflow then the tool will be useless. It would need absolutely top quality code to train it for it to be beneficial, otherwise the algorithms will inevitably skew towards the lowest common denominator of code quality. It also claims to support a suspiciosly huge and wildly different list of programming languages, so that's another reason to be very sceptical.

      Whilst he's undoubtedly a very bright chap, does he understand the true nature of "good" coding at his age? For me, thinking time and good design are far more important than typing time when it comes to producing good code.

      1. Adam 1

        mine is far less CPU intensive

        1. Search for current line on stackoverflow.

        2. Locate any answer with 5 or more upvotes and suggest it in auto complete.

    4. John Robson Silver badge

      I think XKCD...

  2. JDX Gold badge

    An interesting proposition

    I imagine it will get a lot of flak here but this seems a reasonable use of machine learning. It might for instance learn your coding style. Or it might be awful. An interesting project either way.

    1. Craig 2
      Joke

      Re: An interesting proposition

      "It might for instance learn your coding style."

      I tried it out and got this:

      I recommend you give up coding immediately and go back to being a barista...

      1. Phil O'Sophical Silver badge
        Joke

        Re: An interesting proposition

        I had no idea that AI had got so good!

    2. Flocke Kroes Silver badge

      Re: An interesting proposition

      I agree it is an interesting project but I will stick with my CBCOD unless there is evidence that this is more useful.

      1. jake Silver badge

        Re: An interesting proposition

        I have discovered that explaining it in detail to my Velcro Whippet generally works wonders for my own understanding.

        Grandpa once told me that he didn't mind teaching me things because whenever he did he learned something new for himself. That stuck with me. Smart man, Grandpa.

  3. John Jennings

    Self generating code. Someone has to say it

    'I for one.... Yada Yada Yada....'

    1. Hans Neeson-Bumpsadese Silver badge
      Coat

      'I for one.... Yada Yada Yada....'

      For one I....Yoda Yoda Yoda

    2. Doctor Syntax Silver badge

      'I for one'

      Is that the Last One?

      1. Anonymous Coward
        Anonymous Coward

        'I for one'

        A for horses, B for mutton, etc.

  4. johnrobyclayton

    Can I get one trained on homework assignments?

    There is a lot of training data available online apparently.

    Would this be plagiarism?

    1. Phil O'Sophical Silver badge
      Black Helicopters

      Re: Can I get one trained on homework assignments?

      Would this be plagiarism?

      I can see our legal team having a field day:

      "Does this product contain any 3rd-party code?"

      "Umm, well, maybe."

      1. katrinab Silver badge

        Re: Can I get one trained on homework assignments?

        and a lot of it will be GPL licenced code, which means your entire magnum opus is GPL.

      2. Richocet

        Re: Can I get one trained on homework assignments?

        I doubt that having one line of code* identical to another program would be considered plagiarism.

        * does not apply to minified javascript, which transforms all of the code into a single line.

    2. Flocke Kroes Silver badge

      Re: Can I get one trained on homework assignments?

      Very close to my question: What is the license for the training data?

      The SCO Group spent millions of investor's dollars suing world+penguin for using code that they did not own (and wasn't in the Linux kernel anyway) and infringing patents that did not exist. Some counties have a fair use concept that might allow ripping off a small percentage of someone else's source code but that would be a fragile fig leaf to hide behind even without the certainty that something like SCO version 2 would appear.

  5. karlkarl Silver badge

    Oh my god not more. Many IDEs barely support a "disable auto indent" feature these days, creating a horribly formatted mess in every project regardless of style conventions.

    And now it is going to auto complete entire lines! Ugh!

    1. Anonymous Coward
      Anonymous Coward

      "I see you have used a regex. Would you like me to replace it with a trained neural network?"

      1. Loyal Commenter Silver badge

        It's slightly more testable...

      2. Psmo

        "I see you have used a regex. Which two problems would like to add to your code?"

    2. David Given
      Unhappy

      Do you know how to make Visual Studio Code stop autocompleting block comments?

      Because I don't and it's driving me nuts.

  6. Solly
    Joke

    Relevant etc

    It's been done before...

    https://m.xkcd.com/2173/

  7. Buzzword

    This only helps with the easy stuff

    Writing new code is easy. Reading, understanding, and making non-breaking changes to code, is hard.

  8. UKHobo

    if this thing can predict the whimsical requirements of our business unit and guess the required code correctly..genius

  9. Tom 7

    Would it be like those DD list for class properties and member functions

    that make you always pick the wrong one?

  10. Anonymous Coward
    Anonymous Coward

    Non sequitur

    "Pair programming? That's so 2017. Try out this deep-learning AI bot that autocompletes lines of source code for you".

    But pair programming is not mainly intended to avoid syntax errors. It's meant to help prevent (or quickly fix) errors of logic, consistency and abstraction - which still require a human mind to engage with.

    1. Androgynous Cupboard Silver badge

      Re: Non sequitur

      I thought it was meant to double your staff cost while giving the programmers themselves a sore neck?

      1. JLV
        Trollface

        Re: Non sequitur

        I thought it was an excuse to chat with the tasty new intern.

        1. Psmo
          Coat

          Re: Non sequitur

          "I ate up his liver with some NetBeans and a nice Apache deployment" ?

          The one with the straps, ta. No trolley, I can walk.

          1. JLV

            Re: Non sequitur

            As long as it was java fava beans, we’re all good.

    2. Mike 137 Silver badge

      Re: Non sequitur

      "kinda like a pair-programming partner."

      From a specification of Pair programming: 'The best pair programmers know when to say "let's try your idea first."'

      which explains a lot about the parlous quality of code. Once you're at the keying in stage, you should be long past decision on the "idea" - that's properly part of the design process.

      Ever since "agile" took off we've left out the design stage entirely, instead going straight from concept to implementation, resulting in completely uncontrolled development based on the idiosyncrasies of individual coders - witness the results.

    3. Anonymous Coward
      Anonymous Coward

      Re: Non sequitur

      Back in 2019 an actual human mind was required, but here in 2020 an agent that understands code the same way a human does, is an even better solution than a (fallible) human mind.

      https://www.americaninno.com/colorado/colorado-startups/golden-startups-ai-aims-to-make-developers-more-efficient/

  11. Crisp

    I don't recommend this tool

    It keeps putting the line "Import SkyNet" at the top off all my code...

  12. Pen-y-gors

    No, just....no!

    Autocomplete really slows you down - instead of just letting the code flow smoothly from your brain via the keyboard to the file, you have to constantly keep checking to see what suggestions are made and pause to decide which one you want - given that the list may not include what you had in mind). Constant mental stop-start, instead of a natural flow. Of course you could just keep typing and ignore the suggestions, but that rather defeats the purpose. The way Komodo autocompletes brackets and braces is a big enough pain!

    1. jake Silver badge

      Re: No, just....no!

      Indeed. There is a reason I never liked MTV videos ...

    2. Psmo

      Re: No, just....no!

      Yup, it's got to the stage where cancelling autocomplete is in muscle-memory.

      From time to time, I have to redo the line for the 20% of the time it comes out with something useful.

    3. ovation1357

      Re: No, just....no!

      Yes! This 100%!

      It's not just in code editors either, it's things like 'intelligent' highlighting which insists on expanding my specific selection of some text to include the nearest word boundaries or the next quote mark, or by the likes of MS Word taking a command or code excerpt and 'helpfully' changing the quote marks to pretty (but no longer valid) ones; or auto correcting capitals or a word that happens to match its list of common mistakes. Now Gmail is trying to auto predict the next words an email... No thanks! I'm fully capable of selecting/typing what I meant thanks.

      I truly wish that all these 'features' were off by default - I generally find myself having to figure out how to turn off a load of assistive nuisances.

      Specific to coding I do like being able to call upon some kind of hinter that will present contextual snippets of API docs and/or the usual cscope type features, but only on demand. Anything trying to second guess what I might type next is likely to be often wrong and very distracting.

      It's probably why I still use vim with a few choice plugins for almost everything.

    4. baud

      Re: No, just....no!

      I like autocomplete on Eclipse to avoid having to type all the letters for AbstractSomethingObjectFactoryFactory. But the suggestions only appear when I ask, not all the time.

  13. Loyal Commenter Silver badge
    Stop

    What could possibly go wrong?

    If you type the line of code yourself, you should be thinking about every character. Let an AI auto-complete, and that's a recipe for defects that won't get immediately noticed right there...

Page:

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like