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 …

  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 Silver badge

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

      1. Benson's Cycle

        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 Bronze 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 Silver badge
      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 Silver badge

        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 Silver badge
        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 Bronze 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 Bronze 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 Silver badge

      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 Silver badge

        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 Bronze 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. Benson's Cycle

      "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 Bronze badge

        "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 Silver badge

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

    that make you always pick the wrong one?

  10. Archtech Silver badge

    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 Silver badge
        Trollface

        Re: Non sequitur

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

        1. Psmo Bronze badge
          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 Silver badge

            Re: Non sequitur

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

    2. Mike 137 Bronze 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.

  11. Crisp Silver badge

    I don't recommend this tool

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

  12. Pen-y-gors Silver badge

    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 Bronze badge

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

    1. Doctor Syntax Silver badge

      Re: What could possibly go wrong?

      "If you type the line of code yourself, you should be thinking about every character."

      Somehow the fingers and thoughts don't always coincide.

      1. jake Silver badge

        Re: What could possibly go wrong?

        I used to have a problem with typeos. Then I discovered Model M keybr0ads.

  14. Def Silver badge

    Deep TabNine?

    And not a single Star Trek reference in either the story or the comments (until now). Standards are slipping around here, that's for sure.

    I can imagine the inventor was giggling like a school girl when he came up with that name.

  15. amanfromMars 1 Silver badge

    Quite Perfect for a Rapid Response Unit*and Pretty Soon, One of Boris's New Toys to Tool Policy with

    Your laptop may not be powerful enough to run the neural network effectively, therefore, and you can apply to use DeepTab Nine via a beta-grade cloud service, which does all the predictions in a backend and beams the suggestions to your code editor over the internet.

    What's not to like? .... Something So Sublimely Appealing and Almighty EMPowering ‽ . Where now to Utilise Much Deeper and Darker DeepTab Nine Beta AI Services is one of many Journeys Journaled and made freely available to All Wishing to See what Can Easily Be Laying Itself with New Ways Immediately Available Ahead. ...... with DeepTab Nine Beta AI Services to Server and Maintain and Upgrade with Virtual Components which be Stellar Accompaniments.

    And StrangeDoctorLOVE Type Terrain it can certainly be too ....... and that has Secret Special Sources and Forces Successfully Primed and Employed in Future Greater IntelAIgent Games Use too and they can leave the Mad Fields of Mud and Battle Behind in the Hands, Hearts and Minds of A.N.Others and Step Right On Into the Perfumed Garden. ? Your Heaven from Home or Your Home from Heaven ?

    Have you ever had any surreal encounters with spooks? That's surely one of their favourite roots/routes :-)

    * Rapid Response Unit

    1. Cliff Thorburn

      Re: Quite Perfect and Pretty Soon, One of Boris's New Toys to Tool Policy with

      Lets hope BOJ sorts this subliminal safari in reliable rectification for all involved, whilst undoubtedly scoring much needed feathers in the cap and much needed political kudos.

      Would be certainly great game play at the end of the day would it not? :-)

  16. katrinab Silver badge
    Flame

    It looks like you are writing a computer program ...

    would you like help with that?

    Some things never change.

    Autocompletion can be useful on occasion, for example if I type "for", it would be useful for it to prepopulate the correct syntax for a for loop in the language I am using, or if I type in a function name, it could show me the arguments for the function.

    And of course, code libraries are a thing, and useful for standard things that lots of programs need to do.

    Otherwise, how is it going to know what I want? Very probably the whole reason I'm writing it is because it hasn't been done before.

  17. jake Silver badge

    Now THERE'S a tautology a mother could love!

    "a beta-grade cloud service"

  18. Sleep deprived
    Unhappy

    AI-assisted Copy+Paste

    I often half-jokingly suggested programmers' editors shouldn't have a Copy+Paste feature as this is the biggest single source of programming errors. Now, let AI help you further.

  19. Anonymous Coward
    Anonymous Coward

    Faster train wrecks

    Most people shouldn't train this AI by themselves unless they want to spew 100x more crap than they currently are. That could open up an interesting market for pre-trained AIs that help improve your coding. It won't fix architecture at this point but it might help those who struggle with basic coding tasks. As with any market, scams will follow. Imagine selling pre-trained AI to introduce subtle vulnerabilities into applications.

    1. Psmo Bronze badge
      Mushroom

      Re: Faster train wrecks

      Nah, train wrecks is so two years ago.

      We're into plane wrecks now.

    2. amanfromMars 1 Silver badge

      Re: Faster train wrecks

      As with any market, scams will follow. Imagine selling pre-trained AI to introduce subtle vulnerabilities into applications. .... Anonymous Coward

      I sincerely trust, AC, you aint trying to smear and peddle that as a scam whenever a vital future facility and practical utility.

      That would be akin to Toxic Misinformation for Errant Misdirectiion.

      1. jake Silver badge

        Re: Faster train wrecks

        Well, why ever not amfM? The whole AI thing is a scam to begin with. Shirley you, of all entities, have noticed this reality?

      2. Cliff Thorburn

        Re: Faster train wrecks

        Perhaps when B’OJ receives his briefing from the Intelligence Chiefs later today, he will resolve the present great game conundrums and state sponsored torture, and pass immediate resolution and rectification:-)

    3. I.Geller Bronze badge

      Re: Faster train wrecks

      ...shouldn't train this AI by themselves ...

      Simply train it by dictionary, that's it!

      1. I.Geller Bronze badge

        Re: Faster train wrecks

        ...shouldn't train this AI by themselves ...

        Computer, having the right patterns (extracted / obtained from the dictionary definitions) understands texts, can speak and becomes AI, stops to be just a calculator.

        1. jake Silver badge

          Re: Faster train wrecks

          "Understands" ... You keep using that word, I do not think it means what you think it means.

  20. Anonymous Coward
    Anonymous Coward

    if (x == {tab}

    [ if (x == y) ]

    [ if (x == 3) ]

    [ if (x == GOAT GOAT GOAT ]

  21. Anonymous Coward
    Anonymous Coward

    Please NO!!!

    Please don't give this tool to Boeing. I am really scared of the implications.

  22. adnim Silver badge
    Pint

    my code is often a mess

    I never get a full spec, it has to be done yesterday.

    It's a maze of twisty little passages that all look the same, yet produce different and occasionally the right results.

    It works and seldom fails even if it is an unstructured mess that is hard to maintain (for anyone other than me)

    I welcome a machine coding for me, I was thinking of sub-letting my job any ways.

    Beer because it helps me care less about the shite I produce

  23. Anonymous Coward
    Anonymous Coward

    Well Duh?

    Dev team develops AI to help people code. Dev team does a good job. Dev team finds itself laid off, as AI gets a good enough job done for mere electrons. Skynet goes live 1 week later.

    Thanks guys.

  24. damocles

    Wrong solution

    Surely, instead of trying to replace programmers with deep learning systems, we should be focusing on replacing lawyers and politicians...

    1. amanfromMars 1 Silver badge

      Re: Wrong solution

      Surely, instead of trying to replace programmers with deep learning systems, we should be focusing on replacing lawyers and politicians... .... damocles

      Would it be surprising and/or understandable knowing that deep learning systems programmers are already well focussed on that particular and peculiar work in progress, damocles.

      It is what is so effectively spooking current established and assumed/presumed default executive administrative operations/Remote SCADA Systems.

  25. sum_of_squares
    Trollface

    And i was like:

    public static void main(String[] args) {

    And then Deep TabNine was like:

    } // :^)

  26. Justthefacts

    Google code search

    This guy needs to think about why Google Code Search died. After all, he’s basically automating it for the desktop. What did that fail to do for the developer? And how did it compare to using $FAVOURITE_FRAMEWORK?

    We cannot see past the choices we do not understand.

  27. James Loughner
    Linux

    Does it???

    Does it fall Mom's rule???

    Mom's Rule -- Put thing back the way your found them when you are done.

  28. Anonymous Coward
    Anonymous Coward

    Deep learning, huh?

    So how many other people have built a markov irc bot...?

    This idea seems fundamentally broken.

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

Biting the hand that feeds IT © 1998–2019