4 ms·
When I see code like this, I'm always amazed that I can actually read it and (kinda) understand what it's doing. I always expect code like Facebook's to be so f
by javis 13y ago
When I see code like this, I'm always amazed that I can actually read it and (kinda) understand what it's doing. I always expect code like Facebook's to be so finely tuned and advanced that it'd be completely uninteligable to those outside the company and not an expert in the language.
- Kiro 13y agoIn my experience code become unitelligable not because it's fine tuned and advanced but because it's messy and rushed.
- nwh 13y agoDoesn't quite hold true once you get done to hand written and optimised binaries though. There's no way of making assembly easily readable to everyone, no matter how relaxed the developer.
- moconnor 13y agoHand-written assembly can be just as readable as any other language. See https://github.com/jmechner/Prince-of-Persia-Apple-II/blob/master/01%20POP%20Source/Source/FRAMEADV.S https://github.com/jmechner/Prince-of-Persia-Apple-II/blob/m... for a good example!
- moconnor 13y agoOr over-generalized with the logic split up and hidden in the interactions between a dozen (sub)classes.
- oneeyedpigeon 13y agoOr under-generalised with the logic duplicated in a dozen places, ever-so-slightly differently
- Joeri 13y agoActually, a large codebase can be reasonably expected to live 20 years. Over that time with a lowish 10% turnover you'll replace the entire programming staff twice, so the understanding people have of the code is not just hearsay, but hearsay of hearsay. The sheer size of the codebase (facebook has tens of millions of lines of code) means that practically speaking you can't program your way out of a corner once you get there. That is (partly) what killed facebook's competitors. The solution to all of this is to be ruthless about simplifying code. The goal of new code should first and foremost be to be maintainable. Clever code is the enemy of scaling a programming team. Not that you don't need clever code, but you isolate it and protect it and make sure the average team member doesn't have to look at it.
- UK-AL 13y agoThe best code, is often the easiest code to understand.
- jeff_facebook 13y agoWow, that's naive in the extreme. You'd be surprised at how awful the code quality is in most large organizations. It's often the programming equivalent of a skyscraper made from lego and band-aids.
- wmil 13y agoYou shouldn't be. Ultra minimalist code using every language feature tends to be difficult to understand and maintain. It's usually written by young coders eager to show how clever they are.
- Nitramp 13y agoIt's the exact opposite. The better code gets quality wise, the easier it gets to read and understand. There are situations that require using somewhat surprising language features occasionally, but quality code will limit them to small areas, and document the hell out of what's going on there.