Navel gazing on coding style?
-
I wonder how many of us do it? I do. I frequently mentally compare code I see with what I would have written myself, and I do so not to critique other people's code (though it happens) so much as to understand myself and the way I write. Introspection after all, isn't automatic, be it with code or otherwise. I've noticed some pretty interesting things in the process. I don't know how much the activity has actually influenced my coding style. The biggest change to the way I code that has ever happened to me happened in 2018. I don't solve problems by breaking them into their component pieces anymore. I attack problems more ... holistically? now. It generally makes for efficient, but less intelligible code. The way I think changed. Some ways for the better, other ways not, but it impacted how I write software, among other things. Cons: Compared to much of the code I see in the wild, my functions are long, my solutions aren't as readable, some things are so instinctual to me I forget to comment. Pros: My code generally works, and does so well when it does. In some ways, cutting down on the abstractions leads to simpler code, or at least the surface area/API of said code is simpler, if I'm making a library for example. I see the above as a net win, but only marginally so, and maybe most of that small net advantage can be chalked up to natural, incremental evolution rather than my 2018 watershed event. I enjoy thinking about this stuff, but I'm not sure if it's beneficial, or me just passing time. Your thoughts?
To err is human. Fortune favors the monsters.