If Facebook were my first job out of college, I'd stare agape at the code, awestruck by it's disorganization and inconsistencies. As it is, since I've SEEN many code-bases at many companies, I recognize that Facebook's code is actually pretty clever and good.
When I was in college I imagined companies containing gleaming, well-documented, well-architected code. The kind my Professor would give an A. I thought people actually USED those verbose comment-blocks we were forced to incorporate in our class projects.
In the real world shit has to get done. Not everything can be polished and repolished. Nonetheless I still think programming in a production environment is a form of "engineering" that lends itself to great sloppiness.
1) Code is hidden. Sure your peers can review it, but it's still far more hidden than the engineering done on say a suspension bridge. Outwardly, your code could work just as well as good code, but inwardly it could still be a disorganized, unmaintainable mess.
2) Code is cross dependent. With a lot of engineering in other disciplines, the physical parts allow for more isolation for each engineer. The aeronautical engineer working on the wing is definitely not going to be using the same moving parts as those working on the engine. Well refactored code on the other hand may include a lot more interdependence.
3) It's all the same "stuff". This goes with 2. All 100+ Facebook engineers are working on the same material: code. Engineers on other large projects are often across lots of extremely different disciplines. This differentiation in engineering results in isolation of tasks so that one can't depend upon another.
4) Everyone touches virtually everything. Again with 2 and 3, communication is so important with code because of how intermingled our tasks are. In other disciplines an engineer would be horrified to know that other engineers were coming around willy-nilly and tweaking small portions of his original work. This is why commenting is so necessary.
5) It's iterative. Large websites, like facebook, don't just build something once and call it done. It's not a matter of blueprinting, designing, architecting, and implementing. It's more like trying to build a working automobile by attaching 4 wheels to a mattress and pushing it downhill and then sitting on the mattress and working on it while you careen onward.
6) It's massive. 100's if not 1000's of engineers can work on the exact same single functioning product. That's a pretty large scale.
7) It's normally not life-threatening. Most software, like facebook, isn't going to kill someone if it breaks. This just lends to faster and shoddier practices as companies race to engineer more features and nobody has to be extra careful about the liability of someone dying. This would be in contrast to say planes, bridges, or NASA shuttles...
8) Pieces are easily swappable. Code is so cheaply malleable. If you are building something that weighs thousands of lbs of steel, then the physical cost of its construction requires that you get it right the FIRST time. Code is much more of a touch-and-go process. Thus things are left in shoddier states because you can always tweak it further later.
If we were to imagine code as a skyscraper. Then it's like the architect's build the scaffolding, but then, for each floor, they let an entirely different group fill in the contents. Each group makes different decisions, and some of the groups decide to pull out the original scaffolding altogether and replace it with their own. Then some of those groups get together and connect their custom scaffolding with extra ladders down the side of the building. Before it's over they've dug tunnels underneath and built walkways to other buildings.
Comments