why I am saving code style guides like an orange at Christmas

Celeste Neuenswander
5 min readJun 13, 2018

--

As an undergraduate at Brigham Young University, I found out about Robert Bringhurst’s The Elements of Typographic Style. It’s widely accepted as the bible of best type practices.

It’s sort of a strange book, long and narrow. The type is beautiful, but also a bit obsessive. And if you look at it for too long, you’re in this guy’s head. All day, day after day, moving conceptual whitespace over and back over in on itself, like scooting sand with a needle.

I spent some time with it, but never made it to the end. The rules were starting to collect and jam up in my head. I couldn’t sit down the computer without looking over to the manual for approval. That being said, I loved the book — haven’t really left it — and think of Robert Bringhurst as something of a soul brother (a thing?)

Bob said: “Consistency is one of the forms of beauty. ” pg. 115

Consistency is beautiful to me because it communicates resolution. Someone who is consistently on time is likely to be prepared and relaxed. Everything is in its proper order. It is an ideal, but reachable. I believe it is the mark of a happy life.

After the struggle of creating an identity, designers joyfully compile brand style guides to make sure their deliverables are honored and used properly. There is something really satisfying about leafing through them. It means that the work is done, and there’s an amount of pride and satisfaction in cementing and protecting that.

I love looking through (or the thought of, this is not a regular practice for me) brand style guides. NASA brand style guide from the 70s is a triumph. Everything is so resolved, honed, consistent.

consistent
consistent
consistent
consistent

The idea of code style guides is so attractive to me because in order to have excellent code style, it means your code must first work, and well. To get to that point is a lot of hard work, endurance, and focus. I’d like to think beautiful code is a way to honor and protect great work. Beautiful code is a pleasure to read, especially if its handed-off to you. It’s hard to go wrong when you start right.

The reformatting is the very last part of your code process, and the way I see it, a comfortable and rewarding place to work in. From what I have learned so far, comfortable code is dangerous code. I think it means you’re not really thinking when you’re in that space.

From what I read, many people find themselves ‘bikeshedding’ about code style, which is spending useless time on keystrokes that just aren’t as meaningful as core functionality. For someone who finds these minute adjustments really satisfying, I am likely to want to invest in code style. (I once spent three hours on a second worth of animating an apostrophe appearing on screen, by hand, frame-by-frame, something like 24 fps, which my friend/animator said was so unnecessarily high it was laughable, but to this day, is one of my most enjoyable work sessions.)

So, knowing that a. code style comes at the end b. can be really satisfying, time-disappearing, less-mindful work, I reservedly took a look at one of the most visible, respected javascript style guides out there as dessert:

Air BnB

consistent

Variables. With ES6, `var` is now the weakest signal available when you define a variable in JavaScript.’ — Eric Elliot. I think part of the reason that these guidelines are fuzzy and could conflict style guide to style guide is the nature of code is that is changes and deprecates. ES6 was released June 2015, before then it was all var. The global namespace was polluted as a rule.

‘Capitan Planet warned us of’ it

This stuff, I don’t know what it is, It’s just delicious to me. The order, the clarity. One of my favorite things said about consistency was by Felix Mendelssohn: The essence of the beautiful is unity in variety. Code style guides are a way of familiarizing manifold processes through predictability. I loved looking through this style guide because I know not to think about it until after the code works, and it works well. If I have excellent code style, that means I have excellent code.

I look forward to completely immersing myself in these guides in the future to maintain and protect the result of the intellectually taxing part of the code, the messy, revised, the logged and debugged. That’s code, the center of it. The style? I’m saving that part like an orange at Christmas.There is nothing more dangerous than comfortable code. Even worse, there is nothing more dangerous than coding code that already works. First, make it work. Then, make it work well. The style will point to first and then.

--

--