
AI assisted code completion for C++ - rptr_87
https://blogs.msdn.microsoft.com/vcblog/2018/12/05/cppintellicode/
======
Const-me
That's very nice and I'll probably be using it a lot, after VS2019 will
stabilize (it's just a preview now).

However, the fact that this thing works so well, says a lot about the design
of C++ standard library. They should have encapsulated the pair of iterators
into a single structure, and implement implicit casts from vectors/arrays to
that object. Requiring to type begin/end every single time is
counterproductive.

~~~
htfy96
Ranges has already been merged into C++20. Now you can use std::sort(v);

------
saagarjha
> IntelliCode uses machine learning to train over thousands of real-world
> projects including open-source projects on GitHub.

Is it legal to use a bunch of open-source projects in what looks like a
proprietary plugin?

~~~
Hydraulix989
Depends on the licenses of said projects. It's pretty easy to whitelist
MIT/Apache licensed code.

Even still, it's unclear whether an abstract machine learning model that "saw"
copyrighted IP during the training process is infringing on said IP. A self-
driving car sees many billboards during test rides.

~~~
fulafel
Those licenses still require you to display acknowledgements, copies of the
original license, disclaimers etc.

~~~
WalterGR
They require you to do that when?

When you include the source code in a project? Or distribute binaries created
in whole or in part from the source code?

The licenses say exactly what the requirements are, and when you are obligated
to follow those requirements. What do they say about training AI models on the
code?

~~~
groceryheist
> Distribute binaries created in whole or in part from the source code.

How exactly is that different from what's happening here?

~~~
haneefmubarak
Think of this more along the lines of when you read a code description of how
something works and then describe it to someone else. In the same way that you
don't have to provide copies of the license(s) of whatever you read, you
shouldn't have to do that here, because the model is simplying learning and
then inferring.

~~~
IshKebab
It's not as simple as that though. What if I train an AI to output a book
given its title. With a sufficiently expressive and overfit network it could
actually memorise the training data exactly.

That means my network now includes an exact copy of those books (encoded in a
weird way but that is irrelevant). Should I be able to distribute my weights
and ignore the copyright on the original books? Of course not!

In this case it is very unlikely that the network weights store much data from
each individual github project, but it's definitely a sliding scale.

------
thosakwe
So is this basically like a Markov chain attached to a C++ analyzer? If so,
then I think the title is a bit gratuitous with the whole "AI" thing, but I
can't say it's not a convenient feature to have in an IDE.

------
deft
This might use AI but it's nothing but marketing here. Isn't any sufficiently
'trained' program AI under this definition? If I put enough possible paths in
my matching system, I get this. Intellicode is just a minor improvement on
intellisense that could have been made years ago without any kind of AI
branding.

~~~
IshKebab
All AI is more or less sophisticated pattern matching though. Why complain
about this one?

------
cheez
Am I missing, where is the AI in this? Or are we being more broad here?

~~~
IshKebab
It predicts the next word based on the previous ones. A classic AI task.

------
ArthurBrussee
That's great but I hate how they mark suggestions with a star and add an extra
comment. It should just work, not add UI clutter and noise

------
kurosawa
Anyone know about similar but open-source projects that do code completion (or
assist in some way) upon training on stackexchange data?

~~~
typon
Tabnine does it on your project

------
godelmachine
Bad for interview practice.

~~~
pts_
You cannot pass antiquated interviews anyway by working on the technology. You
have to rote learn the APIs.

------
mlthoughts2018
I despise code autocomplete features. I could not stand using Jedi in Emacs.
It just slows me down way too much to have to interact with an autocompleter.
I’ll never understand why anyone would want this.

I’ve found code autocompletion to be particularly troublesome and hindering on
large legacy code bases, where the suggestions not only prevent you from
quickly typing out the method, class, etc. that you were trying to type, but
also add a hindering layer of misdirection to trying to learn the architecture
and code layout and form a mental model of the code organization.

Code autocompleters have only ever been pure waste to me, across a wide range
of projects of various ages, states of code complexity, states of maintenance.

~~~
orbifold
I've never found any of the autocompletion packages emacs had useful, mainly
because their implementation continuously broke and they never felt solid. The
story is completely different in visual studio code or visual studio for that
matter.

~~~
mlthoughts2018
Most autocomplete tools I’ve worked with were very solid and well implemented.

I did not find them useful because autocompletion while writing code is itself
just not a useful tool conceptually, regardless of the quality of the tool.

Autocompletion for coding just doesn’t have any mainstream use cases or
situations in which it can possibly be helpful. As a result, even very well
made autocompletion tools cause trouble and hinder productivity.

On the other hand there can be niche, non-mainstream uses, like accessibility
use cases for disabled people who have to use key entry mechanisms that make
non-autocompletion key entry overly burdensome or slow.

