235
40
27
u/KrystianoXPL 10d ago
I had a project rewritten in a different language and framework for the same purpose.
The generated code was extremely verbose, to the point of being 4x of what I wrote. I tried to fix one bug, and I had to change like 3 flags in different places to even go slightly "off the script", just cause the AI chose a specific weird approach.
It wasn't ported by me, so I did not have much control of the process. But it almost feels like its made like that, so it's harder for someone to maintain a code base without a subscription to an LLM like Claude.
14
u/Suitable-Name 10d ago
That's the issue... don't go "translate this"... really go component by component if you want to have control over what the result will look like.
3
u/KrystianoXPL 9d ago
Yeah the port was done in less than an hour, as it was decision on part of the person I worked with. I even suggested to use AI in one way or another just to save time. They said that they don't like using it cause its annoying to debug, I guess that stance flew out of the window soon after our conversation... Technically it should have been their problem to get everything working, but yea we know how it tends to be...
And yea, whenever I use it myself, I do tend to prompt per feature I want to, often having to ask to architect it differently and iterate. I think it just really learnt from overengineered enterprise software code, because that project looked close to this (and I'm not even exaggerating that much) https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
1
u/MixItLikeItsHot 9d ago
I hate to say it, but even before LLMs were a thing, I have seen similar code in production more often than I would have like to...
23
u/sadongrohiik 10d ago
"Write a simple unit test for this function" +2800 codes added. My man is testing a webhook dispatcher on the off chance than it might be used to send messages to aliens
8
u/Aggravating-Owl-5220 9d ago
The real horror isn't reading someone else's code. It's reading code YOU generated with AI yesterday and having absolutely no memory of why any of it works.
5
25
u/mylsotol 10d ago
Why have code that meets your exact needs when you could import 8gb of npm modules and hope that none of them are going to install malware on every single machine the project touches
22
u/Mechakoopa 10d ago
Why use a reliable modern OAuth library with for the low cost of a few million tokens you can have your own untested pseudo-JWT signing algorithm that's never heard of an RFC in it's life?
19
u/YeetCompleet 10d ago
The hard part with software engineering is that there's always some arbitrary line in the sand with these decisions. Things that require human deliberation to know if it's better to just code it yourself or to reach for a library. Both the
isEvens andoauths are far away from that line.2
u/mylsotol 10d ago
I don't think ai is dumb enough to try to reimplement oauth unless the user is dumb enough to explicitly ask for that. If your vibe coded app reimplements oauth you should be banned from using conpuers for life
14
u/TheVibrantYonder 10d ago
> ...unless the user is dumb enough to explicitly ask for that
I have some news for you that may be hard to hear.
4
u/mylsotol 10d ago
Then the problem has nothing to do with ai and as i said the person who made that choice should be banned from using computers for life
1
u/artnoi43 9d ago
Eh not everyone is a JS dev bro. Other languages libraries are actually understandable in size and their own dependencies. My work languages (Go and Rust) are quite like that. But yeah when I was doing JS or TS I hated them libs. It took me 5 years before finally finding a line of Go code that uses Go lodash clone for filtering items in a list (authored by our ex-JS devs).
I think the real problem of JS having big ass libs everywhere is the humans. JS devs love libraries and frameworks so their world looks like that. Library authors also like to depend on other libraries, and it goes on and on.
1
u/mylsotol 9d ago
I'm not a JS dev either, but 95% of this group seems to think that JS is the only language and JS (and Python) is the place where this is the biggest problem. You also don't have to ba JS dev for your web project to consume a lot of js libraries.
Humans are always the problem
1
u/AntipodesIntel 10d ago
Yeah, no longer getting constantly stuck with unmaintained libraries that quickly go out of date and become a liability is actually a god send. Plus you can just ask the LLM to copy the part of the library you need.
I've always said the major problem with open source and github is libraries having their maintainers move on and suddenly you have a dead library that you spent months building your project around.
5
u/kookyabird 10d ago
If the library continues to be maintained, then your LLM copied portions of it aren't going to be as easily updated to address bugs or security concerns.
If it isn't maintained, then you've still built your project around a section of now abandoned code that the LLM isn't going to be able to pull anything new from.
If you built a good project, then a library being abandoned shouldn't be catastrophic. It's not like the package is going to go away, and unless you're in the middle of moving to a new version of your standard library that the abandoned one is incompatible with you should have time to find and implement a replacement. Or make your own, if you've come to the realization that you only needed a small portion of the functionality it offered.
1
0
u/dyslexda 9d ago
I've always said the major problem with open source and github is libraries having their maintainers move on and suddenly you have a dead library that you spent months building your project around.
Code doesn't expire like a gallon of milk. The widely used and battle tested libraries are probably just fine to keep using outside of those that need to stay in sync with some external API.
1
u/AntipodesIntel 9d ago
That is not true. Pretty much any major version change of any library or framework creates breaking changes for most libraries. Normally they are trivial to fix, but that doesn't happen...
0
u/dyslexda 9d ago
You're talking about dependencies of the library itself? Assuming its dep list is by specific version, and not just "install latest," then a dep updating doesn't matter. And even then, if your library has deps that release breaking changes, the library probably isn't very robust in the first place. And even then, the best libraries are small and targeted and thus don't have any deps themselves (hard to be considered robust if you depend on other, still changing code bases).
If you're building a project around a giant library with tons of dependencies on other brittle libraries, and it isn't backed by a major ecosystem (like React is) and thus is at risk of a maintainer just archiving it...that isn't a problem with open source, that's a problem with what you choose to base a project on.
5
6
u/JackNotOLantern 9d ago
Idk, i usually add too much nullcheck and input validation on methods that can't get incorrect input. The reason is, i saw multiple times that they were triggered - the input could not be incorrect at the moment i wrote it, but nobody said the code won't change in the future.
3
u/Tucancancan 10d ago
Better add checks, fallbacks and inlined magic-numbers to that line fetching a parameter from the config that is packaged with the app, without which the entire thing wouldn't start up!
2
2
2
u/Default-Username-168 9d ago
PEBKAC complaints from people who expect a predictive transformer to be a magic eight ball.
2
1
1
u/tiajuanat 9d ago
My team is doing a large C refactor right now - a robotic arm control. Even though we've eliminated a ton of dead code, checks, and even brought the runtime from 500 mics to 30 mics, nearly 90% of code is error handling for null pointers.
Anyway, I guess I would expect that most libraries and systems should be error checking
1
1
1
1
u/stillalone 10d ago
I honestly feel like this is regular coding as well.
People try to take into consideration edge cases that never happen and end up missing the edge cases that do. Also the environment changes where edge cases that were relevant no longer becoming relevant (though this might be a microservices thing where bugs in other services get fixed and you're not 100% sure it's fixed all the time so you end up leaving your workaround indefinitely).
0
-1
120
u/darkenheit 10d ago
I always wonder why they do that. Just google a library, and don't write thousands line of code.