4 ms·
Honestly, if you're smart, it's just really fun to make things dense and logically concise. Think of it like a minor form of code golf. My first CL at my first
by wutbrodo 7y ago
Honestly, if you're smart, it's just really fun to make things dense and logically concise. Think of it like a minor form of code golf.
My first CL at my first job out of college was writing a state machine at Google. I remember collapsing it into this dense, elegant representation by hinging on a couple of bits of state. It took me an extra half day, but I was really proud of the end result, and I remember being mildly put off by the request that I unroll it and make it explicit. Upon thinking about it for a bit, I decided it was entirely reasonable, and after a few more years at Google, I transformed into the kind of engineer insisting that every bit of code prioritize readability over everything else, in the absence of constraints like performance. Across the tech orgs and teams that I've run since, this has paid huge dividends. I'm writing a lot of tensorflow and C++ at a very fast-moving company working on a complex problem, and I don't know how anyone on my team would be productive at all without strictly prioritizing readability.
Being good at coding and having good engineering habits aren't the same skill, and the latter is about discipline and patience (and occasionally thinking like a dumber person), which are inherently less fun than unfettered technical challenges.
- hinkley 7y agoMy best friend in college was a writer, pursuing a BA in Literature. I’ve been thinking again lately about little bits I picked up via osmosis and my own early creative writing experiences. In fact I was just noting a couple weeks ago how refactoring resembles an exploratory writing exercise. I think we need to embrace the creative writing similarities. Would we ever celebrate an author who published efficient, dense and cryptic text? Rarely. One of the things we do want is someone who paints a clear picture in a few well chosen words. Another is to be inspired. Tricked or bored are not on that list.
- therealdrag0 7y agoLove the analogy. I'm a SE with a English degree. Maybe that is why I care so much (more than those around me) about editing code and finding the readability sweet spot.
- egypturnash 7y agoHemmingway.
- jodrellblank 7y agoReadability isn't just the inverse of code golf, but that's how it's often talked about. We want a clear picture in a few well chosen words, but writing padded with low effort filler is not clear, it's a drag. Whatever the answer is, it's not "shortest code possible" but it's also not "longest code possible". Given that, it seems quite plausible that the answer is "whatever you have learned to read is readable, and what you haven't, isn't". We have ideas of a "grade 6 reading level", do we have such a scale for code? If not, why not?