Programming Style Influences
tratt.net
tratt.net
I always contend that we should strive for understanding of the whole over making each statement as clear as possible. Local variable names should be short. Variable names that span larger contexts should be as long as necessary to disambiguate it and provide context. I find less senior devs focus on the zoomed in context rather than the larger one. I say that whitespace, especially vertical space usage needs to justify itself. Allow as much context to fit on the screen as long as density doesn't go too far into being unreadable. The standard line length limit convention is a good rule of thumb.
> I now believe the reason is fairly simple: in essence, OpenBSD's style squeezes more code onto the screen.
It depends on how complex the functions/algorithms are, and what mental references can be assumed.
Local variable names help explain how/what the function does. Function names and context might only be enough to explain the intended output.
I wish I could remember in which thread I found a similar comment here within the last week or so.
Painfully-heavily paraphrased, they said that a narrative/shorter function style of programming makes it easier to understand the intent of the logic/individual functions but harder to follow the overall flow, because you tend to have to jump frequently between functions in different parts of the file.
if (condition)
{
...
}
if (condition)
...
Perhaps they're paid by lines of code.A lot of that sort of pointer pre/post-increment/decrement comes down to "idiomatic ways to write things", which are easier to read when you've seen them a hundred times before. Personally for this specific case I'd have split the increment to its own line -- because conceptually the job that is doing is "skip over the program name in argv[0]", whereas everything else in the if() is the entirely separate "see if the next argument, if any, is '-n'".
"The BSD echo checks the first argument for the string -n which causes it to suppress the newline that would otherwise follow the final argument in the output."
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/e...
Is this some sort of BSD specific behaviour?
I don't really think about code that much, any more than most people think of paper plates. I would know a bad one if it's flimsy or dirty, otherwise I don't think of them at all unless they are really exceptional.
There are programmers I respect, and take inspiration from, but mote for their architecture, functionality, or documentation, then their code.
Come to think of it, I have actually only read a few files of code at most from most of my favorite programmers.
RealThunder is one of my favorite programmers in the world. I don't know what he did or how he did it, but he fixed the topological naming issue in FreeCAD, and made it about 5x more practical, and mostly solved one of the key missing things in the whole FOSS ecosystem. He didn't just make a proof of concept or a script you can maybe get to work in an hour, he literally has an AppImage on his GitHub, taking some really algorithms and making true software with them, not just code.
He has his issues, but I respect Poettering for how solid, consistent, and comprehensive his recent software is, and how he wasn't afraid to go beyond "init system" and make a real system management daemon.
I respect Torvalds because... Linux works. It's an OS. It's good at being an OS. And because he is open to new technologies like Rust. I'm not sure I could name anything specific about the kernel that makes it special, besides the fact that it's not buggy and has all the features you need, but that's a good thing. It just needs to be an OS, with lots of community support and drivers.
I respect Van Rossum for the way he curated the feature set of Python, never allowed it to be left behind by changing tech, and really, really, valued practicality.
I respect Wim Taymans for making media sane again. There are essentially no major issues with PipeWire aside from compatibility issues due to it being new.
GStreamer is admittedly at times a nightmare to work with, but that's just because media is hard. For a huge class of problems I wouldn't really think of using anything else.
Fabrice Bellard is wonderful because he does world class things, any one of which would be noteworthy, in multiple domains, usually involving some pretty amazing low-level algorithmic work.
And then there's the stuff that's hard to attribute to any one person as far as I know, but still greatly influences me.
Freedesktop provides an absolutely amazing amount of convenience to the user with very little programmer effort to interact with it.
NetworkManager brings all your network needs together in one place, along with Firewalld that brings all your firewalling together the same way.
Debian is, along with red hat, near synonymous with Linux for me, and they rarely stray from or fail at the mission of providing a rock solid OS where packages don't break.
I wish SyncThing would expand just slightly and offer plugin support, but nonetheless they are the shining example of how self-hosting anything should be.
Linux Mint is unrivalled, as far as I can tell, at being what Windows always should have been.