learning to love limitation

Historically, my current workplace hasn’t enforced coding or style standards.

In case you wondered how useful my (cough) 25 year-old undergraduate literature degree is: once upon a time, after receiving a bluebook from doctor connolly, I would receive a sheet of paper with a passage or a poem written by an author studied that term. It was generally quite obscure — perhaps something unpublished, from a diary or letter, etc. We had to identify the author and the approximate timeframe in which it was written.

Welp, I can glance at sections of our codebase and do the same thing, without resorting to checking the file history.

It’s educational, actually — many techniques, organizations, etc with valid rationales for them. I try to ape the primary style, etc of existing code when I’m enhancing or bug chasins something quite old. Trust me, it’s much easier than mimicking The Lady and the Dog without actually plagiarizing the original story. (This is also a wonderful exercise in developing other sorts of writing skill. I recommend it.)

We opted for React as the front end framework for a partial site rewrite. And we opted to adopt some prewritten rulesets for it from both a coding content and a code formatting perspective.

After years of deciding whether I wanted a line break somewhere based on which machine I was in front of, or twitching at someone’s (uh, sometimes mine) free mixture of single and double quotes in javascript, rules are annoying.

WebPack is blowing up all over the place on me!

My darling boss, after disabling the extension that automatically formatted JSX according to our rules.

And rules are a complete relief.

When I open a file, my eyes know how to skim — we’ve enforced code formatting and indention. I don’t have to look up one of the 6-10 ways to construct something — we’ve enforced code style.

When I’ve lost track of my semi-colons and braces, the linter catches it before I have to pick through it in my browser debugging.

Limitations leave room for other kinds of creativity. In a world of free verse, working inside the confines of a villanelle (not that Villanelle) creates as many possibilities as it eliminates.

And, as you may have guessed from the quote above — we don’t allow a successful WebPack build without compliance.

(We use the very popular AirBNB ruleset with Prettier extensions to fix formatting. It’s nice.)


Comments

One response to “learning to love limitation”

Leave a Reply

Your email address will not be published. Required fields are marked *