Earlier quoted context omitted.
By linking to those examples you confirmed the point you were trying to refute. From my personal perspective this is mediocre code at best. It’s written in an unsafe language. Littered with macros, which in C are not hygienic and are land mines in waiting. Constants defined with lowercase and not actually marked as const. Double underscores everywhere, which are the bad alternative to namespaces seen in weak language…
I think I just fell in love with you. Finally a sane person Honestly, I never understood why so many developers abbreviate function names or variables. Is it so much pain to type abc for auto completion? Why not simply name fd file_descriptor? Short names are a mental barrier and a level of abstraction that can easily be avoided.
Good code is like a love letter to the next developer who will maintain it
121–130 of 274 posts
Re: Good code is like a love letter to the next developer who will maintain it
#122I don’t think I’d do much differently in retrospect, except be far more cautious about where and who I spend time around.
Even this very thread has some pretty bad vibes: “who can say what good code is?” “good code can’t exist with deadlines.”
I feel really bad for junior/intermediate devs that read this stuff and internalize it.
Re: Good code is like a love letter to the next developer who will maintain it
#123Re: Good code is like a love letter to the next developer who will maintain it
#124Earlier quoted context omitted.
> there is no such thing as good code definitely not true. this is good code: https://github.com/torvalds/linux/blob/master/fs/file.c this is good code: https://github.com/golang/go/blob/master/src/strconv/atoc.go its formatted, commented, direct. the fact that you struggle with writing time tested code does not mean that everyone does.
> the fact that you struggle with writing time tested code does not mean that everyone does Do you have a source on what I have managed to write or is this just guessing and calling it "fact?"
Re: Good code is like a love letter to the next developer who will maintain it
#125Just reading isn't as good as interacting with it
Re: Good code is like a love letter to the next developer who will maintain it
#126After almost 20 years of writing the best code I can muster as much as I can, I’ve come to understand that most people won’t ever really appreciate it for the effort you put in. Many won’t even notice; they’re too preoccupied with their own lives to open their eyes to what is there. Nor do they give a damn about mastery. But, that doesn’t mean it’s a waste. I don’t think I’d do much differently in retrospect, except…
Re: Good code is like a love letter to the next developer who will maintain it
#127Sometimes the code is beautifully factored and tested. Maybe even documented. It then proceeds to fight against the new change. Maybe the type invariants fail everywhere for reasons that price spurious. Maybe code far away makes dubious assumptions and breaks in response. In the worst case, it's beautiful nonsense held up by undefined behaviour and the language has come to collect the tax.
I like code that can be changed to do new stuff without everything around it exploding. That's probably what I'd call good code. It's in the context of tolerating future requirements well as the future is now.
I do not see such code often.
Re: Good code is like a love letter to the next developer who will maintain it
#128After almost 20 years of writing the best code I can muster as much as I can, I’ve come to understand that most people won’t ever really appreciate it for the effort you put in. Many won’t even notice; they’re too preoccupied with their own lives to open their eyes to what is there. Nor do they give a damn about mastery. But, that doesn’t mean it’s a waste. I don’t think I’d do much differently in retrospect, except…
Usually the situation is someone has meticulously crafted some perfect system which can be extended and reused in many coherent ways. And then that person leaves the company and no one else truly understands how it works or was meant to be used so it gets a series of hacks and patches applied to it which violate the original design which is known by no one at the company. For most projects this is not that big of a d…
Re: Good code is like a love letter to the next developer who will maintain it
#129Earlier quoted context omitted.
> there is no such thing as good code definitely not true. this is good code: https://github.com/torvalds/linux/blob/master/fs/file.c this is good code: https://github.com/golang/go/blob/master/src/strconv/atoc.go its formatted, commented, direct. the fact that you struggle with writing time tested code does not mean that everyone does.
By linking to those examples you confirmed the point you were trying to refute. From my personal perspective this is mediocre code at best. It’s written in an unsafe language. Littered with macros, which in C are not hygienic and are land mines in waiting. Constants defined with lowercase and not actually marked as const. Double underscores everywhere, which are the bad alternative to namespaces seen in weak language…
it seems you didn't bother to read the entire comment, otherwise you would've seen I linked to TWO different programming languages.
Re: Good code is like a love letter to the next developer who will maintain it
#130Earlier quoted context omitted.
> there is no such thing as good code definitely not true. this is good code: https://github.com/torvalds/linux/blob/master/fs/file.c this is good code: https://github.com/golang/go/blob/master/src/strconv/atoc.go its formatted, commented, direct. the fact that you struggle with writing time tested code does not mean that everyone does.
By linking to those examples you confirmed the point you were trying to refute. From my personal perspective this is mediocre code at best. It’s written in an unsafe language. Littered with macros, which in C are not hygienic and are land mines in waiting. Constants defined with lowercase and not actually marked as const. Double underscores everywhere, which are the bad alternative to namespaces seen in weak language…
Many people will say that an induction stove is better in safety, convenience and many more. But a gas stove still has its own place.
Just because the kernel code doesn't use the latest "best practices" doesn't mean it's bad. It could be due to many reasons from performance, compatibility, etc. Software is so easy to update anyway compared to other things that I'd bet there's more "good" software than "good" anything else.