News for hackers. Stuff that matters.
Re:Visual Studio IntelliCode by cromwellian on Tuesday June 04, 2019 @06:02AM (#20093526)
I've never seen any IDE as good as IntelliJ IDEA when it comes to Auto suggest, and it has no real AI, just deterministic understanding of the project's source tree and dependencies, an indexed AST, how the type system works, and what's in scope at the cursor. In other words, two classes both called 'List' should not show up when I start typing 'List', if only one of them can possibly be relevant in context. A lot of IDEs, especially in refactoring, for Java often appeared to use string comparison. So you'd do a system wide refactor of say interface 'Foobar', and it would match completely different interfaces called 'Foobar' that had no relation to what's under the cursor.

It's this almost 100% exact matching that develops into a rapid muscle memory where you learn to trust the IDE, and non-deterministic algorithms which have say, a 1% failure rate, tend to be annoying.

Re:Visual Studio IntelliCode by jasode on Tuesday June 04, 2019 @08:17AM (#20094220)
>, and it has no real AI, just deterministic understanding of the project's source tree and dependencies, an indexed AST

Right, but because VS Intellicode does not purely work on just the AST tree, that becomes its differentiated advantage. It's not a better way of autocomplete, but a different way that works for some scenarios. Because Intellicode is not deterministic, it is not meant to build muscle-memory like vim, emacs, etc.

I also see some comments in this thread wondering how it compares to Resharper so here's how I'd differentiate them:

Most of the previous autocomplete, "intellisense" type of algorithms work on parsing the AST of the project's source code. The lookup database is therefore scoped to the internal world of that project. Intellicode parses others' source code (e.g. top Github repos) which is out there in the external world.

What Intellicode does is use crowd-sourced data to create a different set of autocomplete suggestions. With that strategy, when one types the dot character "." to trigger a context menu for autocompletion, it's sort of a miniature "pagerank" of the most likely methods or properties instead of a "dumb" alphabetical order.

A concrete example in C# might be the autocomplete of a DateTime type. There are 2 similar properties: ".Now" and ".UtcNow".

What people probably want in many situations to avoid DST bugs is ".UtcNow" instead of ".Now". But in a regular IDE, a dumb alphabetical order means "N" shows up before "U".[0]. Therefore, newbies inadvertently end up with "DateTime.Now" in their code instead of "DateTime.UtcNow".

Something like Intellicode would use machine learning that analyzes the top Github repos and therefore reorder things so ".UtcNow" is higher than ".Now". Of course, this re-ordering could have been manually curated by C# experts into a "best practices database" but Intellicode's idea was to approximate that by using AI applied to others' source code.

[0] VS2017 screenshot example: https://imgur.com/a/05d9Ij9

Re:Visual Studio IntelliCode by Dayshine on Tuesday June 04, 2019 @08:54AM (#20094469)
> What Intellicode does is use crowd-sourced data to create a different set of autocomplete suggestions. With that strategy, when one types the dot character "." to trigger a context menu for autocompletion, it's sort of a miniature "pagerank" of the most likely methods or properties instead of a "dumb" alphabetical order.

Eh, isn't the whole point that intellicode is trained on your own project? Mine is, it suggests things based on our usage.

Re:Visual Studio IntelliCode by jasode on Tuesday June 04, 2019 @08:57AM (#20094497)
>, isn't the whole point that intellicode is trained on your own project?

Intellicode may also be trained on your own project but that's definitely not its whole point.

Here's an excerpt from https://visualstudio.microsoft.com/services/intellicode/:

>"IntelliCode recommendations are based on thousands of open source projects on GitHub each with over 100 stars."

Perhaps you were thinking of "IntelliSense" instead of "IntelliCode"? Yes, the older IntelliSENSE could parse your custom classes and types and provide autocomplete for them. IntelliCODE is a different algorithm. (I think Microsoft's naming for them is not self-descriptive and confusing.)

Re:Visual Studio IntelliCode by Dayshine on Tuesday June 04, 2019 @08:58AM (#20094503)
Huh, weird.

I've only ever noticed the "starred" recommendations on our own methods, and it's incredible.

Re:Visual Studio IntelliCode by WorldMaker on Tuesday June 04, 2019 @11:28AM (#20095911)
The biggest place I see a lot of great IntelliCode recommendations so far is React development in Typescript in VS Code.

    class ComponentName extends React.|
The top completions in order at that point are Component and PureComponent. It feels more magical than I would have expected, and it is particularly great having that constant reminder of PureComponent, which is very similar to the Now/UtcNow example above.
Re:Visual Studio IntelliCode by seanmcdirmid on Tuesday June 04, 2019 @08:36AM (#20094341)
Most modern autocomplete engines respect camelcase, so N will bring up both Now and UtcNow.
Re:Visual Studio IntelliCode by seanmcdirmid on Tuesday June 04, 2019 @08:39AM (#20094352)
That isn’t how code competition is used. It is t about “saving on typing”, rather, it enables exploration and allows a developer to browse on what they can do next. In that case, your error rate is completely meaningless.
Re:Visual Studio IntelliCode by thomascgalvin on Tuesday June 04, 2019 @10:07AM (#20095156)
Really it's both, and IntelliJ is the best in the world at supporting both modes. What you're "probably" going to type is at the top of its autocomplete list, but you can still browse through an alphabetical list of what you "could" type below that.
Re:Visual Studio IntelliCode by carlmr on Tuesday June 04, 2019 @09:16AM (#20094659)
Especially it's a really good memory assistant if you switch between languages often.
Re:Visual Studio IntelliCode by vanderZwan on Tuesday June 04, 2019 @07:16AM (#20093850)
That sounds kind of comparable to one of the reasons why gesture interfaces (the waving-your-hands-in-the-air type) have such a hard time catching on: no haptic feedback and not a reliable enough success rate compared to real buttons, or even touchscreens. It doesn't matter if it's 99.9% accurate, it's the 0.1% failure rate that will prevent adoption.

Reliability and predictability matters a lot in interface design

Re:Visual Studio IntelliCode by nickjj on Tuesday June 04, 2019 @08:04AM (#20094135)
> It doesn't matter if it's 99.9% accurate, it's the 0.1% failure rate that will prevent adoption.

Perfectly said. I've always thought the same way. Basically, I'd rather not use a "pretty good" auto complete, because "pretty good" usually means it does more harm than good (where harm is providing wrong results or doing anything that slows me down overall).

Re:Visual Studio IntelliCode by zaphar on Tuesday June 04, 2019 @08:34AM (#20094331)
See: Every phones autocorrect and how much annoyance they cause.
Re:Visual Studio IntelliCode by anoncake on Tuesday June 04, 2019 @01:02PM (#20096951)
Especially when a common word is missing in the dictionary for some ducking reason.