upvote
I absolutely agree that those things should take priority, but I think those things can only go so far and there's a threshold of complexity beyond which there will always be some benefit to comments. You can absolutely reduce the need for 'signposts' if you avoid creating a maze.

As others have said, you didn't always build the maze. Or you built a lovely intuitive path and then were hit with an unexpected new requirement that forced you to add twisty little passages. Or, like me, you're not a perfect being and had to compromise based on some complication you didn't expect.

reply
> Smart developers don’t write mazes.

You don’t choose what your forebears have written, though.

reply
Patching that up by using comments as a 'map' isn't the right way to deal with that. Refactors and rearchitecture are. Putting in comments just helps procrastinate what's necessary.
reply
It's difficult to refactor and rearchitect without first understanding what's there and why.
reply
And yourself putting in comments is the solution to that?
reply
Rewrites require a lot of effort, significantly more than just adding comments. It’s a pragmatic tool until you actually have the time to do the rewrite.
reply
I never said rewrites.

And the more you put in procrastination-encouraging half-solutions, the worse your code base gets.

reply
Though the onus is on us to improve what our forebears wrote, for the sake of our own and others' future.
reply
Everyone disagrees about Good Architecture and it changes with new technologies btw

Years ago I worked on a project that had a n tier architecture and facade pattern for the frontend

It was good architecture for the lead developer who set it up but bad for the new team who need to update the tech

So comments and docs are both valuable

Nowadays with AI the calculus has changed once more

reply
I'm afraid this all gets thrown out the window nowadays.

Unless I tell them not to, LLMs lean on slapping verbose comments of the worst kind - describing the code instead of the reasons for putting it there.

I ask them to write comments in ASD-STE100 Simplified Technical English, but all I really get from that is tersness.

Also the other day I stumbled upon a huge pile of documentation and I'm still trying to figure out if it's human or machine written. I stopped reading it half way through as I figured that perhaps it wasn't written for humans to read.

reply
The most WTF comments are the ones that describe how the code looked during a rewrite session with no commits. It writes bad code, I ask it to rewrite it, and it leaves a comment saying why the previous implementation was bad, with no history in git of the previous implementation.

Edit: changed the LLMs pronoun to it.

reply
Who is this "he" you're talking about? Or were you referring to an LLM? If so, the correct pronoun would be "it".

Your english is really good, except for that little mistake.

reply
I am 100% guitly of anthropomorphizing LLMs, sorry.
reply
Unless I tell them not to, LLMs lean on slapping verbose comments of the worst kind - describing the code instead of the reasons for putting it there.

I wonder if that's actually useful for an LLM though. It's additional context that should steer the LLM not to change the code to do something else.

reply
> Unless I tell them not to, LLMs lean on slapping verbose comments of the worst kind - describing the code instead of the reasons for putting it there.

Well, my LLMs are "smarter" than yours. They'll describe why the code is there. They'll even try to keep these comments in sync with code as it makes changes.

This includes describing the "why" behind the change even on code affected only accidentally, e.g. by reformat or reindent. And, if it wrote some code and then later learned half of it is wrong, it'll remove the offending parts and leave comments telling what used to be there, and why it isn't anymore.

Same for commit/PR messages.

May or may not be related to a recent tendency in Opus/Fable models I noticed, to eagerly turn user feedback into rules, self-correct by adding more rules, and then when some rule fails, correct it by adding a counter-steering rule - accumulating rules until eventually getting lost in them.

reply