Live data from Hacker News

Using AI Generated Code Will Make You a Bad Programmer

slopwatch.com

41–50 of 57 posts

Re: Using AI Generated Code Will Make You a Bad Programmer

#42

1972: Using Anything Other Than Assembly Will Make You a Bad Programmer 1995: Using a Language with a Garbage Collector Will Make You a Bad Programmer 2024: Using AI Generated Code Will Make You a Bad Programmer

To me the issue with AI generated code, and what is different than prior innovations in software development, is that it is the the wrong abstraction (or one could argue not even an abstraction anymore). Most of SWE (and much of engineering in general) is built on abstractions -- I use a Numpy to do math for me, React to build a UI, or Moment to do date operations. All of these libraries offer abstractions that give…

It isn't an abstraction. Not everything is an abstraction. There is a long history of tools which are not abstractions. Linters. Static code analysis. Debuggers. Profiling tools. Autocomplete. IDEs.

Re: Using AI Generated Code Will Make You a Bad Programmer

#43
post #28

While I agree with the spirit of this post, it seems a bit misguided on several points. 1) I do not believe AI will ever replace programming as a practice, because people will still need to read/review the code (and no, I don't personally believe LLM's are going to be able to do that themselves in the vast majority of cases) 2) while the "script kiddie" characterization is a bit of an unfair generalization, there is…

For the record, some of us have tools which comprehensively solve all of your concerns (even #1). Generating 100% reliable self-analyzing deterministic code is already possible and will become mainstream within the next two months. When you see how it’s done, you’re going to smack yourself in the forehead. Programmers in particular seem extremely vulnerable to dismissing technology that they are not intimately famili…

What kind of code? what domains?

Re: Using AI Generated Code Will Make You a Bad Programmer

#44

My ChatGPT use falls into two categories: 1. Having it perform mechanical refactorings where there's no creativity involved. I'm hacking on a program that was written in the early 2000s. It predates language support for formatted IO. I had ChatGPT replace many manual string concatenations with the equivalent of sprintf. It's easy enough to test the replacements at the REPL. 2. Questions that would be unreasonable or…

You might want to try Claude 3.5 Sonnet instead of Chat GPT. Claude 3.5 Sonnet seems to be a generational advance over earlier AIs like Chat GPT. I find that I can reliably uses it in cases where Chat GPT produces pure hallucinatory nonsense. I've only seen Claude hallucinate once, and that after I had incorrectly told it that its answer was wrong. It's not the only AI that does code well, but at this particular snapshot in time (Oct 2024), general concensus seems to be that it is currently the best.

It has fundamentally changed the way I write code. And I'm still exploring the boundaries of what kinds of tasks I can feed it. (45 year veteran senior programmer).

Sorry for the TLDR post, but I find it difficult to briefly make the case for why Claude 3.5 Sonnet (and other similarly modern and capable AIs) are fundamentally different from smaller and older AIs when it comes to use as a coding assistant.

I do use it for simple tedious things like "Convert an ISO date string in GMT to a std::chrono::systemclock::timepoint" (requires use of 3 generations of C/C++/Posix library functions that would take about 15 minutes of wading through bad documentation and several false starts to get right).

But have also had success with larger fragments ranging up to 100 or 200 lines of code. It still has distinct limitations (bizarre choices of functional composition, and an unpleasant predilection for hard-coded integer constants, which can be overcome with supplementary prompts. Seems to be brilliant tactically, and shows a terrifyingly broad knowledge of APIs and libraries across the the three platforms I use (android/javascript, typescript/React/MUI, C++/linux). But doesn't yet have a good sense of strategic coding (functional and class decomposition &c).And usually requires three or four supplementary prompts to get code into a state that's ready to copy and paste (and refactor some more). e.g. "Wrap that up in a class; use CamelCase for classnames, and camelCase for member names. ... &c &c.

And have also used it help me find solutions to problems that I've spent months on ("android, java: unable to connect to an IoT wi-fi hotspot without internet access when the data connection is active"; Claude:" blah blah ... use connectivityManager.bindProcessToNetwork()"!!!).

Or "C++/linux/asound library: why does this {3000 lines of code} fail to reliably recover from audio underruns".

And had some success with "find the wild memory write in this 900 line code fragment". Doesn't always work, but I've had success with it often enough that I'm going to use it lot more often.

And used it to write some substantial bash scripts that I just don't have the skills or literacy to deal with myself (long time Windows programmer, relative newcomer to linux).

Re: Using AI Generated Code Will Make You a Bad Programmer

#45

1972: Using Anything Other Than Assembly Will Make You a Bad Programmer 1995: Using a Language with a Garbage Collector Will Make You a Bad Programmer 2024: Using AI Generated Code Will Make You a Bad Programmer

You forgot:

- using a debugger will make you a bad programmer

- using an IDE will make you a bad programmer

- using Google will make you a bad programmer

- using StackOverflow will make you a bad programmer

Hint: It's not the tools, it's how you use them.

Re: Using AI Generated Code Will Make You a Bad Programmer

#46

My ChatGPT use falls into two categories: 1. Having it perform mechanical refactorings where there's no creativity involved. I'm hacking on a program that was written in the early 2000s. It predates language support for formatted IO. I had ChatGPT replace many manual string concatenations with the equivalent of sprintf. It's easy enough to test the replacements at the REPL. 2. Questions that would be unreasonable or…

You might want to try Claude 3.5 Sonnet instead of Chat GPT. Claude 3.5 Sonnet seems to be a generational advance over earlier AIs like Chat GPT. I find that I can reliably uses it in cases where Chat GPT produces pure hallucinatory nonsense. I've only seen Claude hallucinate once, and that after I had incorrectly told it that its answer was wrong. It's not the only AI that does code well, but at this particular snap…

What is a good way to integrate Claude 3.5 Sonnet into Visual Studio Code based workflow?

That is how to get the tight integration that Copilot offers but with Claude?

I've been using Github Copilot since the technical preview in mid 2021 and it too changed fundamentally how I write code. Perhaps I've gotten too used to it.

I find that regular LLM chat interfaces break the flow for me.

My usual use is to use Copilot as a rubber ducky or an eager junior assistant of sorts That is I would write

  //Converting an ISO date string in GMT to a  std::chrono::systemclock::timepoint 
and then it is Tab time.

If the result is not so good it means my requirements were not detailed enough. Rarely will it be completely unusable.

As a side effect I am forced to document more of my work, which is a good thing.

Re: Using AI Generated Code Will Make You a Bad Programmer

#47

1972: Using Anything Other Than Assembly Will Make You a Bad Programmer 1995: Using a Language with a Garbage Collector Will Make You a Bad Programmer 2024: Using AI Generated Code Will Make You a Bad Programmer

2044: "What's a programmer?" the child asks his father innocently. "Well you see son, humans used to be needed to instruct the machines on what to do..."

"Yup, really! It used to be the other way around."

Re: Using AI Generated Code Will Make You a Bad Programmer

#48

1972: Using Anything Other Than Assembly Will Make You a Bad Programmer 1995: Using a Language with a Garbage Collector Will Make You a Bad Programmer 2024: Using AI Generated Code Will Make You a Bad Programmer

> Using a Language with a Garbage Collector Will Make You a Bad Programmer

If garbage collectors only did the correct thing 90% of the time, and non-deterministically did something stupid the other 10%, then, er, yeah, it very much would!

There's a reason that conservative GCs for C didn't _really_ catch on... (It would be unfair to describe them as as broken as an LLM, but they certainly have their... downsides.)

Re: Using AI Generated Code Will Make You a Bad Programmer

#49

1972: Using Anything Other Than Assembly Will Make You a Bad Programmer 1995: Using a Language with a Garbage Collector Will Make You a Bad Programmer 2024: Using AI Generated Code Will Make You a Bad Programmer

I can trust that a higher level language will produce the correct assembly code.

I can trust that a garbage collector will allocate and cleanup memory correctly.

I cannot trust that an AI will generate quality code. I have to review its output. As someone who has been stuck doing nothing but review other people's code for the last few months, I can confidently say it would take me less time to code the solution myself than to read, digest, provide feedback for, and review changes for someone else's code. If I cannot write the code myself, I cannot accurately review its output. If I can write the code myself, it would be faster (and more fulfilling) to do that than review output from an AI.

Re: Using AI Generated Code Will Make You a Bad Programmer

#50

Earlier quoted context omitted.

To me the issue with AI generated code, and what is different than prior innovations in software development, is that it is the the wrong abstraction (or one could argue not even an abstraction anymore). Most of SWE (and much of engineering in general) is built on abstractions -- I use a Numpy to do math for me, React to build a UI, or Moment to do date operations. All of these libraries offer abstractions that give…

It isn't an abstraction. Not everything is an abstraction. There is a long history of tools which are not abstractions. Linters. Static code analysis. Debuggers. Profiling tools. Autocomplete. IDEs.

I can’t tell if this is an argument against the parent or just a semantic correction. Assuming the former, I’ll point out that every tool classification you’ve mentioned has expected correct and incorrect behavior, and LLM tools…don’t. When LLMs produce incorrect or unexpected results, the refrain is, inevitably, “LLMs just be that way sometimes.” Which doesn’t invalidate them as a tool, but they are in a class of their own in that regard.
Post reply on HN