Lurker News

Comments (1,272) 260 threads

Earlier comments
inimino32 replies#
I'm amazed to see how positive the overall response is to this idea. Almost as if programmers think that writing programs is the worst part of the job and ready to be automated away.

As someone more aligned with the Dijkstra perspective, this seems to me like one of the single worst ideas I've ever seen in this domain.
We already have IDEs and other tools leading to an increase in boilerplate and the acceptance of it because they make it easier to manage. I can only imagine what kinds of codebases a product like this could lead to. Someone will produce 5000 lines of code in a day for a new feature, but only read 2000 of those lines. Folks that still expect you to only check in code you understand and can explain will become a minority.
I wonder how long it will be until someone sets up the rest of the feedback loop and starts putting up github projects made of nothing but code from this tool, and it can start to feed on itself.
Cargo-cult programming has always been a problem, but now we're explicitly building tools for it.

JabavuAdams2 replies#
You can only solve relatively small problems this way. As I get older, I like the physical act of programming less and less, and just want to solve problems so I can get going on all of my ideas backlog. I've been programming almost every day for the last 38 years. What I really want to do is solve (my) problems.
dennisy1 reply#
I really agree with this even though my experience is much smaller than yours.

The biggest place I think it is frustrating to write code is for ML pipelines where you know what you need, but it takes a few hours to wrangle files and pandas until you can run your idea/experiment.

JabavuAdams#
Ermahgerd, yes! Doing this right now.
auggierose#
But programming is the greatest fun on earth. Wait no, being able to work on your ideas and communicating them to the computer is the greatest fun on earth. Now, if your only tools for communication are made by "productive developers", this is where the problem is. Not with programming itself.
asadlionpk1 reply#
If this results in more overall programmers or enabling existing programmers to make products quicker than before, it's a win!

Most codebases already majorly contain unread code; the libraries (node_modules, etc). I am sure we can figure out a pattern to separate human vs machine code in similar way.
If the code you are about to write is already written by someone else on the internet, that's probably not the most innovative part of your codebase anyway, so why waste time?

zootboy1 reply#
> If this results in more overall programmers or enabling existing programmers to make products quicker than before, it's a win!

I don't think I really agree with this sentiment. "More programmers" or "faster programmers" is meaningless (or even actively detrimental) if the quality of their output is lower. It's even worse if their output is plagued by subtle bugs, as AI systems are likely to produce.

asadlionpk#
The "quality programmers" (neckbeards) can continue their quality work. These new faster programmers can get other stuff done.

The one paying for these jobs can decide what level of quality they want, and hire/pay accordingly. How does that sound?

augustk#
Indeed, using tools to manage complexity tends to make the complexity acceptable and leads to more complexity.
s_dev#
Coding is inherently difficult -- any tools even as basic as color highlighting/spell checking massively help understanding code in front of you. There isn't a hope this can replace any programmers but instead aid their workflow. I great example is simply refactoring code with SOLID after building a feature or fixing a bug -- a lot of this can be easily automated. Having a machine suggest and a human accept is a worthy trade off. Another similar example is the Google bot that presents search suggestions for you.

I don't think your concerns are well grounded.

bluetwo#
All I can think of is how many times I've grabbed a code example from StackOverflow only to discover it had some obvious bug in it. The answer is many, many times.
staticassertion2 replies#
> Almost as if programmers think that writing programs is the worst part of the job and ready to be automated away.

writing the programs is definitely boring garbage work. Typing is so slow and annoying - hence autocomplete being a standard tool. This is, to me, just fancy autocomplete.
> to an increase in boilerplate and the acceptance of it because they make it easier to manage.
Boilerplate optimizes for the right things - code that's easier to read and analyze, but takes longer to write. IDEs and tools like this cut the cost of writing, giving us easier to read code and easier to analyze code for free.
IDEs have supported templates forever. I never write out a full unit test, I type `tmod` and `tfn` and then fill in the blanks. This is basically the same thing to me.
> Folks that still expect you to only check in code you understand and can explain will become a minority.
This isn't true at all. Having used TabNine I don't have it write code for me, it just autocompletes code that's already in my head, give or take some symbol names maybe being different.
All this is is a fancy autocomplete with a really cool demo.

UnFleshedOne1 reply#
Boilerplate is only easier to read and analyze if you can be sure it is consistent, so you can tune it out. Usually though, there is this one getter method that is not quite like the others and you literally will not see the difference until it bites you.

We'll need more IDE enhancements, to highlight interesting pieces and desaturate standard boilerplate...

staticassertion#
When I think of boilerplate I think of context that is made explicit. Things like type annotations, longer variable names, the lifetime or attributes of some class or data etc. These things are extremely helpful for a number of things - they convey context from writer to readers, they aid in proving the code correct, and they can make code faster.

The context almost always exists in the writers head. We all have a specification of our program based on our expectations, and we type out code to turn that model into an implementation. We only spend so much time conveying that model though - most of us don't write formal proofs, but many of us will write out type annotations or doc comments.
The cost is usually as simple as expressing and typing out the model in our head as code. Languages that are famous for boilerplate, like Java, enforce this - and it makes writing Java slower, but can also make Java code quite explicit (I'm sure someone will respond talking about confusing Java code, that's not the point).
Reducing the cost of conveying context from writer to reader means we can convey more of that context in more places. That's a huge win, in my opinion, because I've personally found that so much implicit context gets lost over time, but it can be hard to always take the time to convey it.
Think about how many programs you've read with single character variable names, or no type annotations, or no comments. The more of that we can fix, the better, imo.
Tools like this do that. TabNine autocompletes full method type signatures for me in rust, meaning that the cost of actually writing out the types is gone. That's one less cost to pay for having clearer, faster code.

reader_mode1 reply#
>Boilerplate optimizes for the right things - code that's easier to read and analyze, but takes longer to write.

This is wrong and the same retarded logic Java used to defend not introducing var and similar features for ages. Boilerplate is usually noise around the actual logic - it's a result of limited abstractions. When you're repeating same code over and over you raise that segment to a separate concept, that's how abstraction and high level programming works - it increases readability and maintainability. Being easier to type has nothing to do with it.

staticassertion1 reply#
Thanks for being the person who I knew would try to make this about Java. I don't care about Java, it was a trivial example.

The rest of your post doesn't really have to do with mine. Yeah, you can cut down on boilerplate with changes to languages... duh. But in terms of conveying context there's always a tradeoff of explicit vs implicit, and one of those costs is taking the time to actually turn your mental model into a written implementation - this eases that burden.
As I said, it's a fancy autocomplete.

Continue this thread — 1 reply

RationPhantoms#
Okay, and I'd argue that a good portion of programmatic wrangling is simply trying to do Y with Z. Something that's probably done 10,000 times over by others but in the silo'd confines of that single developer's workspace; an utter fucking mystery to them.

What's the carbon displacement for wasted time on those tasks? It might be brow raising.

davidthewatson#
Cargo cults concerned me too but I realized that cargo-cult programming flourishes when it's enabled by a culture that doesn't care how the sausage is made. If the culture seeks full stack truth, it's not likely to get fooled by bad generated code, no matter whether it's generated by copy/paste, metaprogramming, or AI.

I'd love to know what Donald Knuth thinks given the history of literate programming.

throwaway67530912 replies#
I mean you say this, but you and most likely the majority of programmers rely on dozens of repositories, packages and libraries with likely zero deep understanding of it (and at the very least haven't read the source code of ) so I don't really understand the difference here.

The advantage of something like this is that instead of having to go to stack overflow or any number of reference sites and copy pasta it can just happen automatically without me having to leave my IDE.
The enjoyable part of programming for me is not typing the Ajax post boilerplate bullcrap for the millionth time, it's the high-level design and abstract reasoning.

mdellavo2 replies#
if you are typing out boilerplate you should look to abstract it away
Yaina#
I think this goes beyond one project. In your lifetime you just have to write certain things again and again and then you have to write the abstractions again and again.

Maybe that warrants a library, but then you also have to hook that up with the ever so slightly different boilerplate code.
If this 90% of the easy stuff is done for you, that gives you more time to focus on the 10% that matter.

Spivak4 replies#
Oh god please don't do this indiscriminately. If you're typing out boilerplate, document it and add a generator for it. I've been bitten probably hundreds of times by bad abstractions created to save some keystrokes that turned 50 lines of boring easily readable code into an ungrokable dense mess.

Continue this thread — 4 replies

cunthorpe3 replies#
Importing an external, tested, reliable dependency is completely different from anonymous non-checked untested code in your repository committed by someone who did not even read it.

Check out the memoize example. That fails as soon as you pass anything non-primitive but there’s no one documenting that.

gnulinux6 replies#
> anonymous non-checked untested code

What? It's not anonymous, it's still committed by a dev. It can be non-checked and untested, that's true. But it's not any less untested than any other code. If you choose not to write tests for your code, this won't change anything.
The only issue I see with this is it being potentially unchecked. And the solution to that is reading all the code you commit, even though it's generated by AI.

Continue this thread — 6 replies

rowanG077#
anonymous non-checked untested code is problematic in all cases. This doesn't change that.

Continue this thread — 1 more reply

Continue this thread — 10 more replies

Continue this thread — 23 more replies

azinman22 replies#
I worry about auto-complete on a more philosophical level. I’ve noticed with gmail that it’ll often suggest it’s way of either replying to an email or completing a sentence even though I’d never actually use those words in that situation, simply because it’s easier.

It’s a pretty bad feedback loop that robs us of our independent thought by way of falling victim to laziness, a fundamental human weakness. You can imagine something where in this case the code autocomplete is so large that you really want to make that autocompletion work, even if you know it’s not elegant or possibly even correct code… or maybe it’s just repetitive and not abstracted well, but here it is autocompleted and done so why would you fight that?
If we continue abstracting more and more of this way, based upon datasets that are averaged across everyone, we lose the individual in favor of the masses, bringing us all down to a common denominator.
If we must lose our humanity to the machine, I’d at least like to see an autocomplete from Peter Norvig’s code, or writing from particularly effective communicators or famous authors.

aerospace_guy#
> feedback loop that robs us of our independent thought by way of falling victim to laziness

This was my first thought when I saw this. I intentionally don't use predictive text whenever I can to preserve whatever originality I have left.

noway4211 reply#
Email is a just such a communication medium. It requires both prose at length, and also quick response. Even though the type of information passed around is usually binary: OK/NOT OK, or a status update.

Gmail offers a way to reduce the "prose at length" to a few buttons. And it adds the pleasantries for you.
You can think of it as a workflow automation tool. Your email chains are tickets and you're moving them through different statuses.
Notwithstanding, personal/intimate email is different and spending time writing a beautiful letter is a thing of its own.

dannyw1 reply#
Absolutely. While there's benefits and drawbacks to every technology, auto-complete in Gmail saves me so much time.

If I'm sending to a relative or family member for example, or even a professional contact, then I'm not going to be lazy and auto-complete. But when someone says "Does that sound good to you?" it's great to push a button that replies "Sounds great, thank you!"
Maybe I would have naturally written "That sounds great, thank you [name]", but what's the difference?

azinman2#
> Maybe I would have naturally written "That sounds great, thank you [name]", but what's the difference?

Social graces?

iwintermute13 replies#
So if it was trained using "source code from publicly available sources, including code in public repositories on GitHub." was it also GPLv2?

So everything generated also GPLv2?

andrewstuart22 replies#
You bring up a really good point. I'm super curious what the legality and ethics around training machines on licensed or even proprietary code would be. IIRC there are implications around code you can build if you've seen proprietary code (I remember an article from HN about how bash had to be written by someone who hadn't seen the unix shell code or something like that).

How would we classify that legally when it comes to training and generating code? Would you argue the machine is just picking up best practices and patterns, or would you say it has gained specifically-licensed or proprietary knowledge?

Iv1 reply#
I would argue that a trained model falls under the legal category of "compilation of facts".

More generally, keep in mind that the legal world, despite an apparent focus on definition is very bad at dealing with novelty, and most of it will end up justifying a posteriori existing practices.

einpoklum1 reply#
You might argue that, but you would likely be wrong.

Even a search engine is not merely a "compilation of facts". A trained model is the result of analysis and reasoning, albeit automated.

Continue this thread — 1 reply

cyberfart#
> (I remember an article from HN about how bash had to be written by someone who hadn't seen the unix shell code or something like that).

I believe you're referring to Clean Room Design[1].
[1] https://en.wikipedia.org/wiki/Clean_room_design

flohofwoe1 reply#
I seem to remember a similar discussion on Intellicode (similar thing, but more like Intellisense, and as Visual Studio plugin), which is trained on "github projects with more than 100 stars". IFIR they check the LICENSE.txt file in the project and ignore projects with an "incompatible" license. I don't have any links handy which would confirm this though.
dekhn6 replies#
No, a model trained on text covered by a license is not itself covered by the license, unless it explicitly copies the text (you cannot copyright a "style").
f38zf5vdt#
There will almost certainly be cases where it copies exact lines. When working with GPT2 I got whole chunks of news articles.

Continue this thread — 5 more replies

Continue this thread — 10 more replies

minimaxir1 reply#
So this is what happens when you're owned by Microsoft who has an exclusive contract with OpenAI.

A couple weeks ago I ran a few experiments with AI-based code generation (https://news.ycombinator.com/item?id=27621114 ) from a GPT model more suitable for code generation: it sounds like this new "Codex" model is something similar.
If anyone from GitHub is reading this, please give me access to the Alpha so I can see what happens when I give it a should_terminate() function. :P

Continue this thread — 1 reply

Load more comments