7 ms·
The more I browse through this, the more I agree. I feel like one could delete almost all comments from that project without losing any information – which mean
by milicat 1y ago
The more I browse through this, the more I agree. I feel like one could delete almost all comments from that project without losing any information – which means, at least the variable naming is (probably?) sensible. Then again, I don't know the application domain.
Also…
def _save_current_date_time(current_date_time_file: str, current_date_time: str) -> None:
with Path(current_date_time_file).open("w") as f:
f.write(current_date_time)
there is a lot of obviously useful abstraction being missed, wasting lines of code that will all need to be maintained.
The scary thing is: I have seen professional human developers write worse code.
- ramesh31 1y ago>The scary thing is: I have seen professional human developers write worse code. This is kind of the rub of it all. If the code works, passes all relevant tests, is reasonably maintainable, and can be fitted into the system correctly with a well defined interface, does it really matter? I mean at that point its kind of like looking at the output of a bytecode compiler and being like "wow what a mess". And it's not like they can't write code up to your stylistic standards, it's just literally a matter of prompting for that.
- mjr00 1y ago> If the code works, passes all relevant tests, is reasonably maintainable, and can be fitted into the system correctly with a well defined interface, does it really matter? You're not wrong here, but there's a big difference in programming one-off tooling or prototype MVPs and programming things that need to be maintained for years and years. We did this song and dance pretty recently with dynamic typing. Developers thought it was so much more productive to use dynamically typed languages, because it is in the initial phases. Then years went by, those small, quick-to-make dynamic codebases ended up becoming unmaintainable monstrosities, and those developers who hyped up dynamic typing invented Python/PHP type hinting and Flow for JavaScript, later moving to TypeScript entirely. Nowadays nobody seriously recommends building long-lived systems in untyped languages, but they are still very useful for one-off scripting and more interactive/exploratory work where correctness is less important, i.e. Jupyter notebooks. I wouldn't be surprised to see the same pattern happen with low-supervision AI code; it's great for popping out the first MVP, but because it generates poor code, the gung-ho junior devs who think they're getting 10x productivity gains will wisen up and realize the value of spending an hour thinking about proper levels of abstraction instead of YOLO'ing the first thing the AI spits out when they want to build a system that's going to be worked on by multiple developers for multiple years.
- nottorp 1y ago> those small, quick-to-make dynamic codebases ended up becoming unmaintainable monstrosities In my experience, type checking / type hinting already starts to pay off when more than one person is working on an even small-ish code base. Just because it helps you keep in mind what comes/goes to the other guy's code.
- lolinder 1y agoAnd in my experience "me 3 months later" counts as a whole second developer that needs accommodating. The only time I appreciate not having to think about types is on code that I know I will never, ever come back to—stuff like a one off bash script.
- wesselbindt 1y ago> "me 3 months later" counts as a whole second developer A fairly incompetent one, in my experience. And don't even get me started on "me 3 months ago", that guy's even worse.
- guskel 1y agoYep, I've seen type hinting even be helpful without a type checker in python. Just as a way for devs to tell each other what they intend on passing. Even when a small percent of the hints are incorrect, having those hints there can still pay off.
- dilyevsky 1y agowhat are you going to do when something suddenly doesn't work and cursor endlessly spins without progress no matter how many "please don't make mistakes" you add? delete the whole thing and try to one-shot it again?
- nsonha 1y agoWhy do you HAVE TO one-shot? No one says you have to code like those influencers. You are a software engineer, use AI like one, iteratively.
- ramesh31 1y ago>No one says you have to code like those influencers. You are a software engineer, use AI like one, iteratively. This is my issue with all the AI naysayers at this point. It seems to all boil down to "haha, stupid noob can't code so he uses AI" in their minds. It's like they are incapable of understanding that there could simultaneously be a bunch of junior devs pushing greenfield YouTube demos of vibe coding, while at the same time expert software engineers are legitimately seeing their productivity increase 10x on serious codebases through judicious use. Go ahead and keep swinging that hammer, John Henry.
- shove 1y ago“Maybe you didn’t hear me, I said ‘good morning steam driver, how are you?’”
- necovek 1y ago> expert software engineers are legitimately seeing their productivity increase 10x It's funny you would say this, because we are really commenting on an article where a self-proclaimed "expert" has done that and the "10x" output is terrible.
- ManuelKiessling 1y agoI have just checked my article — the word "expert" isn't in it, so not quite sure where you got this from. I'm working in the field professionally since June 1998, and among other things, I was the tech lead on MyHammer.de, Germany's largest craftsman platform, and have built several other mid-scale online platforms over the decades. How well I have done this, now that's for others to decide. Quite objectively though, I do have some amount of experience — even a bad developer probably cannot help but pick up some learnings over so many years in relevant real-world projects. However, and I think I stated this quite clearly, I am expressively not an expert in Python. And yet, I could realize an actually working solution that solves an actual problem I had in a very real sense (and is nicely humming away for several weeks now). And this is precisely where yes, I did experience a 10x productivity increase; it would have certainly taken me at least a week or two to realize the same solution myself.
- stemlord 1y agoRight, and the reason why professional developers are writing worse code out there is most likely because they simply don't have the time/aren't paid to care more about it. The LLM is then mildly improving the output in this brand of common real world scenario
- necovek 1y agoI think this code is at least twice the size than it needs to be compared to nicer, manually produced Python code: a lot of it is really superfluous. People have different definitions of "reasonably maintainable", but if code has extra stuff that provides no value, it always perplexes the reader (what is the point of this? what am I missing?), and increases cognitive load significantly. But if AI coding tools were advertised as "get 10x the output of your least capable teammate", would they really go anywhere? I love doing code reviews as an opportunity to teach people. Doing this one would suck.
- ManuelKiessling 1y agoGood insight, and indeed quite exactly my state of mind while creating this particular solution. Iin this case, I did put in the guard rails to ensure that I reach my goal in hopefully a straight line and a quickly as possible, but to be honest, I did not give much thought to long-term maintainability or ease of extending it with more and more features, because I needed a very specific solution for a use case that doesn't change much. I'm definitely working differently in my brown-field projects where I'm intimately familiar with the tech stack and architecture — I do very thorough code reviews afterwards.
- fzeroracer 1y agoAt the very least, if a professional human developer writes garbage code you can confidently blame them and either try to get them to improve or reduce the impact they have on the project. With AI they can simply blame whatever model they used and continually shovel trash out there instantly.
- Hojojo 1y agoI don't see the difference there. Whether I've written all the code myself or an AI wrote all of it, my name will be on the commit. I'll be the person people turn to when they question why code is the way it is. In a pull request for my commit, I'll be the one discussing it with my colleagues. I can't say "oh, the AI wrote it". I'm responsible for the code. Full stop. If you're in a team where somebody can continuously commit trash without any repercussions, this isn't a problem caused by AI.
- Aurornis 1y ago> I feel like one could delete almost all comments from that project without losing any information I far from a heavy LLM coder but I’ve noticed a massive excess of unnecessary comments in most output. I’m always deleting the obvious ones. But then I started noticing that the comments seem to help the LLM navigate additional code changes. It’s like a big trail of breadcrumbs for the LLM to parse. I wouldn’t be surprised if vibe coders get trained to leave the excess comments in place.
- lolinder 1y agoIt doesn't hurt that the model vendors get paid by the token, so there's zero incentive to correct this pattern at the model layer.
- thesnide 1y agoor the model get trained from teaching code which naturally contains lots of comments. the dev is just lazy to not include them anymore, wheres the model doesn't really need to be lazy, as paid by the token
- nostromo 1y agoLLMs are also good at commenting on existing code. It’s trivial to ask Claude via Cursor to add comments to illustrate how some code works. I’ve found this helpful with uncommented code I’m trying to follow. I haven’t seen it hallucinate an incorrect comment yet, but sometimes it will comment a TODO that a section should be made more more clear. (Rude… haha)
- pastage 1y agoI have seldomly seen insightful comments from LLMs. It is usually better than "comment what the line does" usefull for getting a hint about undocumented code, but not by much. My experience is limited, but what I have I do agree with. As long as you keep on the beaten path it is ok. Comments are not such a thing.
- cztomsik 1y ago
- FeepingCreature 1y ago> there is a lot of obviously useful abstraction being missed, wasting lines of code that will all need to be maintained. This is a human sentiment because we can fairly easily pick up abstractions during reading. AIs have a much harder time with this - they can do it, but it takes up very limited cognitive resources. In contrast, rewriting the entire software for a change is cheap and easy. So to a point, flat and redundant code is actually beneficial for a LLM. Remember, the code is written primarily for AIs to read and only incidentally for humans to execute :)
- jstummbillig 1y ago> The scary thing is: I have seen professional human developers write worse code. That's not the scary part. It's the honest part. Yes, we all have (vague) ideas of what good code looks like, and we might know it when we see it but we know what reality looks like. I find the standard to which we hold AI in that regard slightly puzzling. If I can get the same meh-ish code for way less money and way less time, that's a stark improvement. If the premise is now "no, it also has to be something that I recognize as really good / excellent" then at least let us recognize that we have past the question if it can produce useful code.
- necovek 1y agoI do believe it's amazing what we can build with AI tools today. But whenever someone advertises how an expert will benefit from it yet they end up with crap, it's a different discussion. As an expert, I want AI to help me produce code of similar quality faster. Anyone can find a cheaper engineer (maybe five of them?) that can produce 5-10x the code I need at much worse quality. I will sometimes produce crappy code when I lack the time to produce higher quality code: can AI step in and make me always produce high quality code? That's a marked improvement I would sign up for, and some seem to tout, yet I have never seen it play out. In a sense, the world is already full of crappy code used to build crappy products: I never felt we were lacking in that department. And I can't really rejoice if we end up with even more of it :)
- merrywhether 1y agoI think there’s a difference in that this is about as good as LLM code is going to get in terms of code quality (as opposed to capability a la agentic functionality). LLM output can only be as good as its training data, and the proliferation of public LLM-generated code will only serve as a further anchor in future training. Humans on the other hand ideally will learn and improve with each code review and if they don’t want to you can replace them (to put it harshly).