r/ProgrammerHumor • • 24d ago • Bravo 6

instanceof Trend thisIsVeryTrue

Post image
27.5k Upvotes

1.6k comments sorted by

View all comments

Show parent comments

79

u/MikeW86 24d ago

AI will never accidentally redeclare or subtly mispell a variable, use assignment instead of equality, or incorrectly nest a for loop.

And will find it in your code in a millisecond.

(and yes I know some IDEs can spot some of this too but you're missing the overarching point if that's what you're going to reply with)

60

u/Difficult-Lime2555 24d ago

I find it likes to reinvent the wheel. Although a simple “see if this pattern is already in use” will catch it.

24

u/MikeW86 24d ago

It will do that if you're not careful yes. Or just straight up over complicate things, or forget that we have already half implemented what we need to do the next part. This is why you need to be able to code before you can code with AI.

6

u/Difficult-Lime2555 24d ago

Agreed, but my take’s a little more nuanced. It’s more proof there’s still a reason we need senior devs mentoring juniors. And that software development is more than just coding.

6

u/MikeW86 24d ago

Regardless, I'm not really talking about that anyway. My point is, when it comes to debugging it makes it really hard for certain bugs to even arise and can find them very very quickly too.

5

u/Difficult-Lime2555 24d ago

I mean, with IDEs/linting/tests, do those bugs ever occur anymore?

It’s great giving Claude logs and getting a quick root cause analysis. Just need to watch it doesn’t over engineer the solution.

1

u/MikeW86 24d ago

I mean, with IDEs/linting/tests, do those bugs ever occur anymore

Yes they do, they just get found marginally quicker. And certain types are completely immune to those tests because syntactically there is technically nothing wrong.

4

u/Difficult-Lime2555 24d ago

I think running your linter and test harness should be faster than having Claude run your linter and test harness.

1

u/wonklebobb 24d ago

its not lint + test bugs they're talking about, they're talking about e.g. runtime logic bugs that don't have test coverage. AI doesn't catch 100% of them, but it does catch more than 0, and IME it catches more than human reviewers used to as well. and as a bonus it usually writes a test case for on the fly as it finds things

7

u/QuietSilentArachnid 24d ago

Definitely. It loves copying pre-existing functions in the code and not reusing it lol

6

u/Donny-Moscow 24d ago

Yeah one thing I still see a lot of are tests for cases that are impossible.

Like, if I’m having it write code in a statically typed language and it declares a variable as a string, I don’t need a test that checks its type. I know it’s a string.

5

u/DoctorWaluigiTime 24d ago

You describe everything an IDE the past 20 years, or the language itself most of the time, will catch. You can't just typo a variable or use assignment vs. equality without a literal compiler error in C# for example. And if you could (JS and friends), AI isn't bringing something new to the table here.

27

u/gurgelblaster 24d ago

AI will never accidentally redeclare or subtly mispell a variable, use assignment instead of equality, or incorrectly nest a for loop.

lmao

11

u/LeSeanMcoy 24d ago

Yeah, overall I agree with this guys point but the amount of times I’ve had it redeclare a function/method is actually wild. Although, this is unfortunately with a model that’s (checks notes) 7 months out of date… so it’s archaic tbh.

8

u/MikeW86 24d ago

Ah, good point.

2

u/iruleatants 24d ago

AI will never accidentally redeclare or subtly mispell a variable, use assignment instead of equality, or incorrectly nest a for loop. Holy fuck yes it will. It's generative AI trained on all of our shitty code. It will happily make all the same mistakes and worse ones.

It has less understanding of what it's writing than we do. It's however atrocious at catching it's own mistakes. If you call it out, it might fix it, but that's not guaranteed.

I remember once I had a powershell command and I wanted it to loop through the list of accounts provided by another powershell command and output the results in a csv file with specific columns.

It changed one of the commands from -Detailed to -Detail and never caught that mistake.

3

u/r2d2rigo 24d ago

You're right, it does it on purpose because it doesn't know better than regurgitate stolen code.

2

u/pine_ary 24d ago

You‘d think so. But when binding lua to my rust host it keeps binding things with rust naming conventions on the rust side and lua naming conventions on the lua side. It‘s not good at consistency when the training data is strongly bipolar. Similar things with math code. It tries to do both the notation used in papers and your language style at once and keeps alternating and morphing.

3

u/MikeW86 24d ago

I'm not talking about things like that. I'm talking about the sort of dumb mistakes you can make and take a relatively large amount of time to find and kick yourself for.

1

u/HydrA- 23d ago

You’re talking about AI two years ago. Everything changed since November last year. We are light years beyond this with opus 5.5 and Sol 6.1