Couple things about this, because there are levels. First, understand to be a successful engineer you need to be a bit pedantic, so start by forgiving yourself and take a deep breath.
Once you become competent enough to identify clean code, understand that your perception of clean code is colored by your own experience and current mental context. As you learn, you will undoubtedly be aghast at your own code that you wrote at any time before 6 months ago. After you've been at it for a couple decades you will come to the horrifying conclusion that your mental model is always incomplete, the human brain is weak, and it's hard enough to not get caught in the wrong local maxima without facing up to the immense challenge of choosing between global maxima in the incomprehensible problem space where software meets human needs in the hybrid meat/mental/cyberspace ecosystem where they exist and evolve over time.
The other implication is that no two engineers will ever see things the same way. It's not purely about technical strength—a weaker engineer might come up with a better solution given more time to think about it, or due to some other blind spot or skillset gap from the more senior engineer. Also, there are many issues of style and perspective where the important thing is consistency more so than some specific choice. In those cases there's a high risk of bike-shedding, and it leads to a fundamental truth of large scale software development which is that in practice you will never get everyone on the same page. Of course there are controls for this, but unless you have the budget and operational scope constraints of NASA (or perhaps medical device manufacturers) you can't actually enforce this without losing so much development velocity that your company is utterly uncompetitive in the market.
As you move up the seniority and scale ladder to larger projects and architectures, you will realize that you still only have 24 hours in a day, and it doesn't matter how smart or how right you are, the only tool in your built to increase your impact is a simple cliche: "pick your battles". There is absolutely no upside in nitpicking every line of code that could have a conceivable improvement. If you want respect from your colleagues, you need to get good at filtering what is important and what isn't, and only pointing out the most important issues, and doing it as early in the process as possible.
I appreciate the reminder and the helpful tone of your comment in general!
> As you learn, you will undoubtedly be aghast at your own code that you wrote at any time before 6 months ago.
Just checked, and my code from 6 months ago looks identical to what I write at work. My programming style went through a few different phases but its variability has mostly leveled off since I've started writing in a mostly-functional style.
> It's not purely about technical strength
It's simple stuff like putting together a base Modal display component for re-use instead of copy/pasting that div with the inline-styled zIndex of 99,999 for the umpteenth time.
> As you move up the seniority and scale ladder to larger projects and architectures
I hope to side-step a lot of those pitfalls by exiting the ladder altogether and starting my own company where I take a fine-toothed comb to the process of onboarding new hires. Time will tell if the demands of scaling a company end up sidelining my desire for good hires, but software is still a somewhat nascent field, so the sky's the limit if you ask me!
> the human brain is weak, and it's hard enough to not get caught in the wrong local maxima without facing up to the immense challenge of choosing between global maxima in the incomprehensible problem space where software meets human needs in the hybrid meat/mental/cyberspace ecosystem where they exist and evolve over time.
This is a good way of putting it and it's why it's the problem I've chosen to work on for my first product as a startup founder. I call it Pidgin, and my vision for it is a GUI tool for refactoring and even writing code in a more deterministic and reliable way. I spend my mornings before my day job working on it. I think the fact that I think about code quality intensely at all hours of the day probably contributed to the emotional tone of my initial comment. :)
> It's simple stuff like putting together a base Modal display component for re-use instead of copy/pasting that div with the inline-styled zIndex of 99,999 for the umpteenth time.
Is this on the critical path to solving more ambitious goals or just the Sisyphean task you've appointed yourself? It's fine to take pleasure in the small details, and if you want to set up a company to feed that obsession more power to you. However I will go out on a limb and predict two things: 1) unless you are independently wealthy, you are going to stop worrying about this level of detail pretty quickly once you are focused on how to make enough money to afford to hire talented engineers and 2) if you micro-manage style and details to this degree, you may find it hard to retain the level of talent you aspire to.
I took a look at your github profile and looked through your csv_builder repo project in particular. It's good, clean code. Well done! Given that you apparently understand what clean code looks like, I can't help but feel I may be misrepresenting the nature of the 'bad code' I provided an example for. Let me expand on my modal example and perhaps you'll better understand things.
Here's a snippet from the code I had in mind when I wrote my comment:
This was copy/pasted from some other modal in the application. Have you ever heard of the DRY principle? Don't Repeat Yourself. Now, I could wax poetic about just how far one ought to go to embody this principle when considering the time pressures and business demands in a startup environment, but I don't think it should be controversial to say that repeating those 11 lines throughout the codebase for every modal is a Bad Idea, especially considering they could have used the much simpler one-liner, <Modal>.
I won't go deeper into that because that seems like a pretty air tight assumption, but feel free to let me know if it's an invalid assumption on your part nonetheless.
Now, one might say, maybe he didn't know about the other component? And, in fact, I think this was probably the case. And so I can, to some extent, forgive him for copy and pasting due to ignorance of the other component. It's a big codebase and it's impossible to stay up to date on all changes all the time. Nevertheless, this isn't an isolated case, this kind of sloppiness is the rule in the codebase rather than the exception.
> 2) if you micro-manage style and details to this degree, you may find it hard to retain the level of talent you aspire to.
Good engineers make these kinds of mistakes occasionally, it isn't their default mode of programming. I wouldn't have to worry about micro-management because the need for it, at least of the variety concerning this particular example, would never arise. Surely you understand that bad programming can and does exist?
> 1) unless you are independently wealthy, you are going to stop worrying about this level of detail pretty quickly once you are focused on how to make enough money to afford to hire talented engineers
As long as I am responsible for the construction of any kind of software, I will never stop worrying about these kinds of errors because over time they are immensely costly. Team velocity slows drastically due to the unreadable, verbose and repetitive nature of this kind of code. That is unless, of course, the product I'm building manages to embody the vision I have in mind for it and appropriately and sufficiently addresses these kinds of issues such that they are impossible to make anymore. If and when that happens, I will stop worrying because I will rest easy that an automatic process catches these errors and I will be ready to dedicate my brain power to other more interesting problems.
I have no way of knowing exactly how much, but my suspicion is that, in aggregate, sloppy coding such as this likely costs many, many companies building software around the globe millions or even billions of dollars worth of development time every year. I want to alleviate that waste with Pidgin.
And, yeah, devtools aren't exactly the cash cows of software, but they do exist and are occasionally successful. I've got a whole list of SaaS companies in the space, but for brevity I'll simply drop a reference to one I found on HN just this evening. It's called Replay (https://www.replay.io/), and it's a standalone time traveling debugger for web code. They're backed by Andreesen Horowitz, so I think it's likely they have managed to strike on something true.
My aim is for Pidgin to target the process of construction rather than debugging or design as I've seen some other tools do, while still retaining the power of plain text that is invariably lost when using other so-called "low-code" tools.
If you think you might be interested, I would be happy to note your contact details down for when the alpha version is released!
Once you become competent enough to identify clean code, understand that your perception of clean code is colored by your own experience and current mental context. As you learn, you will undoubtedly be aghast at your own code that you wrote at any time before 6 months ago. After you've been at it for a couple decades you will come to the horrifying conclusion that your mental model is always incomplete, the human brain is weak, and it's hard enough to not get caught in the wrong local maxima without facing up to the immense challenge of choosing between global maxima in the incomprehensible problem space where software meets human needs in the hybrid meat/mental/cyberspace ecosystem where they exist and evolve over time.
The other implication is that no two engineers will ever see things the same way. It's not purely about technical strength—a weaker engineer might come up with a better solution given more time to think about it, or due to some other blind spot or skillset gap from the more senior engineer. Also, there are many issues of style and perspective where the important thing is consistency more so than some specific choice. In those cases there's a high risk of bike-shedding, and it leads to a fundamental truth of large scale software development which is that in practice you will never get everyone on the same page. Of course there are controls for this, but unless you have the budget and operational scope constraints of NASA (or perhaps medical device manufacturers) you can't actually enforce this without losing so much development velocity that your company is utterly uncompetitive in the market.
As you move up the seniority and scale ladder to larger projects and architectures, you will realize that you still only have 24 hours in a day, and it doesn't matter how smart or how right you are, the only tool in your built to increase your impact is a simple cliche: "pick your battles". There is absolutely no upside in nitpicking every line of code that could have a conceivable improvement. If you want respect from your colleagues, you need to get good at filtering what is important and what isn't, and only pointing out the most important issues, and doing it as early in the process as possible.