4 ms·
At least for me, I never expected production code to be this bad until I spent a few years working professionally. One company I worked at had poor code qualit
by thdc 5y ago
At least for me, I never expected production code to be this bad until I spent a few years working professionally.
One company I worked at had poor code quality, but I chalked it up to poor engineering culture - a lot of outsourced crap code and no time dedicated to go back to clean it up.
Another company also had a code base with terrible quality but I figured it was because it was a startup and they were rushing to get features out.
None of the companies I've worked for are big ones, and I've always wondered if these levels of quality were the norm, and leaks like this really give me insight to what would otherwise be private code.
Of course, Twitch was also a startup so maybe this was a hack that made it into production as the author notes, although I don't imagine a better solution would've taken much more effort to implement.
Well you could also argue that I'm the common denominator here and the code isn't poor per se, it's just that my expectations were too high when coming into the professional scene - which is what I'm leaning towards currently - I don't really know what to think.
- everlastingbits 5y agoI'm also super interested about how code looks like in elite organization! In my previous work place I felt exactly the same as you.. Lucky for me there are many seniors with years of experience under their belts where I'm currently working.
- mftb 5y agoI think finding mentors is a great idea, but I think one thing you, and the parent comment are missing is, an "elite organization" in what arena? Of what sort? For a truly different software development process, with totally different requirements, checkout stuff like this - https://www.fastcompany.com/28121/they-write-right-stuff https://www.fastcompany.com/28121/they-write-right-stuff. There are other similar write-ups from different kinds of organizations out there as well.
- TedDoesntTalk 5y ago> https://www.fastcompany.com/28121/they-write-right-stuff https://www.fastcompany.com/28121/they-write-right-stuff This is an amazing read on the software controlling the space shuttle from 1996. Thanks for sharing!
- mftb 5y agoYour welcome. I read it back when, and it's been helpful to me over the years.
- thdc 5y agoNice article. Thorough documentation (history of code database mentioned in article) is definitely one of those things I'd like as I often find myself wondering why code is the way it is, trying to look back through to the original change that introduced it, and finding nothing - also everyone involved with that change is long gone from the company. Also thorough specifications are pretty unheard of so that's also great. And devs that actually test their code thoroughly. For me elite just might be a company that meets my standards, which I realize is a useless description for anyone that's not me now. In fact, it's a lot of personal opinion - mainly code that's easy to modify and reason about I guess. I realized I said "this bad" in my original post but, to be clear, I don't have any serious issues with the Twitch snippet - I meant "this" as software in general. The only nit I have is using `like any array(['%p1%', '%p2%'...])` seems like a more elegant and straightforward(?) way to write the logic.
- pkrumins 5y agoThis is exactly how code looks everywhere. It does the job. It's the greatest code ever written because it's in production. The perfect code you never wrote is in your dreams. Services don't run on dream code. They run on code in production.
- jandrewrogers 5y agoBeautifully crafted production code exists but the necessary conditions are almost never consistently available -- it requires a lot of time and energy to fight code entropy. Even most people that write software don't care that much; like the business, anything that meets the acceptance criteria is usually considered "good enough". And most professional, production code is the accumulated cruft of that reality. In the rare cases where you do see elegant, clean, high-quality production code, it is usually because 1) only a very small number of people are writing that code, 2) there is a strong cultural norm of rigorous code hygiene among those people, 3) they do not have prohibitive time pressure to ship, and 4) the requirement to maintain backward compatibility across versions of the code is weak. In practice, these conditions are very rare. I've mostly seen it in what is essentially hobby code, where the craft was a large part of the objective (and hobby code that becomes production code tends to quickly take on the characteristics of other production code). There simply aren't enough people that care about code quality for its own sake, and the economics of maintaining very high-quality code rarely makes sense in practice.