Re:PostgreSQL reconsiders its process-based model
by SoylentOrange on Monday June 19, 2023 @02:23PM
(#36394744)
Because it takes a lot of time and because the comments can get outdated. I also want this for all my code bases. But do I always do this myself? No, especially on green field projects. I will sometimes go back and annotate them later.
[ Parent
| on HN ]
Re:PostgreSQL reconsiders its process-based model
by mhh__ on Monday June 19, 2023 @02:46PM
(#36395036)
They can get outdated but they usually don't. It's a good litmus test for if a file is too big / small if it's purpose is hard to nail down.
Re:PostgreSQL reconsiders its process-based model
by akira2501 on Monday June 19, 2023 @03:16PM
(#36395386)
Trying to understand what I previously wrote and why I wrote it takes more time than I ever care to spend. I'd much rather have the comments, plus at this point, by making them a "first class" part of my code, I find them much easier to write and I find the narrative style I use incredibly useful in laying out a new structure but also in refactoring old ones.
Re:PostgreSQL reconsiders its process-based model
by withinboredom on Monday June 19, 2023 @03:37PM
(#36395608)
Even outdated comments can tell you the original purpose of the code, which helps if you're looking for a bug. Especially if you're looking for a bug.
If someone didn't take the time to update the comments and the reviewers didn't point it out, then you've probably found the bug because someone was cowboying some shitty code.
Re:PostgreSQL reconsiders its process-based model
by alex_reg on Monday June 19, 2023 @04:36PM
(#36396158)
I have the opposite experience.
Outdated comments are often way worse than no comments, because they can give you wrong ideas that aren't true anymore, and send you off in the wrong direction before you finally figure out the comment was wrong.
Re:PostgreSQL reconsiders its process-based model
by elteto on Monday June 19, 2023 @04:45PM
(#36396236)
Indeed. I recently found this piece of code:
if (X) assert(false); // we never do X, ever, anywhere.
Then I look over to the other pane, where I have a different, but related file open: if (exact same X) { do_useful_stuff(); }
It got a chuckle out of me.
Re:PostgreSQL reconsiders its process-based model
by jgilias on Tuesday June 20, 2023 @12:30AM
(#36399732)
Did you update the comment? :-)
Re:PostgreSQL reconsiders its process-based model
by withinboredom on Tuesday June 20, 2023 @02:09AM
(#36400333)
// there are two kinds of mutually exclusive commentors
enum kinds { writers; readers; updaters; }