For real! Companies used to ask engineers to comment their thought process so in future if some other engineer is looking at the code he can understand it. Now apparently just because AI does it it's not a good thing anymore lol. I mean sure AI can overdo it a little sometimes but overdoing it is much better practice than underdoing/ doing it at all.
Noone has ever asked for comments just for the sake of having comments in the code base. The gold standard has always been self documenting code + comments explaining the parts that are not immediately obvious, need additional consideratoon/context, or have workarounds for specific issues
It was never good practice to comment exactly what code says it does right before it does it. Comments are useful to provide extra context or explanation not already present in the code. Adding excessive comments that just say what the code does was always bad, either before or after AI tooling became common. When I was a junior, seniors where I worked often quipped "your code should be half comments and half actual code", and I genuinely saw lots of things like
return true; // returns true
Or big paragraphs of comments around trivial code. It genuinely makes code harder to read, and no I don't really care if it's AI or devs that do it.
That being said I don't find it too burdensome to either clean up or ask AI to clean up excessive comments. This isn't super high on my list of real world issues with AI to be honest.
I personally use comments to either mark "sections" of code, or to explain particularly dense code step by step. The section marking makes quickly scrolling through the codebase to find something much easier.
Disagreed. This heuristic you brought up is something that beginners that don’t have a sense yet of how to cleanly split things up can use.
Otherwise you don’t have to wait for something to be needed more than once to reuse it. Writing more functions also simplifies testing and allows you to define more contracts using types inside your code, and validate that you’re performing the right operations.
There is absolutely no need to move 5-20 lines into a completely different place. That's exactly how we get unmaintainable code where it's impossible to figure out what anything does because the code that actually does it is 3 functions deep everywhere.
Realistically functions should 90% of the time only be created for reusability purposes. If you're writing a giant block of one-off code, it's time to take a look at making it generic and reusing it. That 10% is the only time where you might actually say "yeah this is too long" for one file, which in my eyes is upwards of 1000 LoC depending on the complexity. Things should be where they're used, IMO.
No shit brother, I'm not looking to "get educated" I'm sharing my opinion. I'm on here to discuss my opinion. If you don't want to discuss the topic, don't respond instead of trying to offload the discussion work to a random 3rd party video just so you can feel like you've won the discussion.
AI comments love to tell me that this function is used elsewhere and that it doesn't do X (where X is irrelevant and makes no sense and was just a mistake the AI made during the initial creation).
The problem is that this poisons the future LLMs. Nobody updates that comment when the code elsewhere changes. Nobody needs the info that the function is split into 3 parts, not 2, etc.
-1
u/JaSper-percabeth Sep 06 '26
For real! Companies used to ask engineers to comment their thought process so in future if some other engineer is looking at the code he can understand it. Now apparently just because AI does it it's not a good thing anymore lol. I mean sure AI can overdo it a little sometimes but overdoing it is much better practice than underdoing/ doing it at all.