Lurker News
And what made it so good?

Was there someone enforcing good practices top down? Just being in a group of great engineers? Or something else?

Comments (454) 104 threads

Earlier comments
CSMastermind#
I've seen enough code bases that I feel like I have a good spectrum from truly exceptional to horrific.

The best code bases had these things in common:
1. Consistency: they had clear patterns that were followed. It doesn't matter what the pattern was; some were strictly object-oriented, some were purely functional, some used RESTful API, and others leveraged gRPC or GraphQL. The important thing was that it was all consistent across the codebase so even if you were looking at a part you'd never seen before you could still orient yourself and reason about it quickly.
2. Ownership: there was always a single individual person who was ultimately responsible for each section of code. That doesn't mean they wrote all the code themselves; they were the final arbiter on the rare occasion a truly contentious conflict arose. They also had the unilateral power to make changes within their section of the code if they felt it was needed. This was always a rarely exercised power but they could, if they had to, push a change through. There could be many such people spread out across the codebase but for each discrete part the number was always one.
3. Clear Boundaries: it was clear what each part of the codebase's purpose was, and the boundaries were rigidly enforced. Things were never tightly coupled across these boundaries. Business logic was always isolated from things like serialization/deserialization, each system was forced to maintain its own models of the world that it cared about.
The worst code bases had these things in common:
1. Lack of Eng Representation: Product controlling development schedules and insisting everything is high priority and needs done right now! Project managers who always wonder, "yes but what if 9 women could make a baby in a month. Why don't we try adding more resources? Can we just try?" Business types who see software as a cost center not a profit driver. This can also happen if your engineer leadership didn't come up through software engineering but rather QA or IT or started out in academia or is just plain and MBA type with no eng background.
2. "Time saving" Tech: We don't need a database schema, we can just go NoSQL and have JSON blobs, it will save so much time! We can share models between the front end and back end, it will save so much time! Don't write SQL, use this ORM, it will save so much time! Don't think about DevOps, just use this all in one hosting solution, it will save so much time! What about this low code/no code solution? It will save so much time!
3. Misaligned Incentives: This could be because they were contractors with no stake in the company or this could be because it was a large company and there was no realistic way they'd ever be fired. Either way there were no consequences for writing bad code.

codezero#
I'm not a software engineer, but the best codebase I worked on was at Quora. I attribute this to them having several years of time to build a base that was solid. That said, I found plenty of bugs, but it was just so nice to work with. Almost everything was Python. DOM, CSS, JS embedding, etc... keeping in mind this was way before Angular/React, but the system worked very similar, doing DOM diffing via a C++ service on the backend and pushing updates out over a long polling JS endpoint.

On top of that the data which was read heavy went through several layers of cache that were very easy to understand (process, system, global - called L1, L2, L3 like a system as a CPU). The front-end had a "Konami code" that let you see the rendering hierarchy from the backend while viewing it from the frontend that let you also understand the caching state of each level of hierarchy that was rendered as well as all the CSS/JS handlers affecting the element, not unlike current "inspect" view of most browsers.
What made this all so good? A very strong foundation that was opinionated, but which was consistent. This was ~ 2012-2014 - they had Flask as an underlying framework, and much was built out on top of Python decorators.
Besides the day-to-day code - they had a bespoke packaging system, auto-scaler, and a number of other services that "just worked" - it was very different from any other startup I've worked for.

agentultra#
I never got to submitting my own patches but the Linux kernel is nice.

Where I work now I get to work in Haskell. And that’s been a pleasure. Recently rewrote over 1k lines. Deployed to production with one reviewer. No issues.
Just good test coverage and a great type system with no-nonsense code. Refactoring in Haskell is a heady drug.
If this was C++ or even Python there would have been much more intense reviews and probably some fail-forward patches to fix things we may have missed.
But I dunno. Maybe not. Maybe I’m just that good. /s

joeshachaf#
I worked with a very experienced engineer who created his own WAF (software-based) using Java. From a purely architectural perspective, it might not be the best (I might have used an ISAPI filter back then), but the code itself was very efficient, well-written and documented. I used it several times as a teaching example.

Load more comments