When I started working on my first embedded project at Atomic, I was given just two pieces of advice regarding C programming:
The second one struck me as an odd proposition at the time, as I had never before cracked open a language spec.
My impression of language specifications and formal documents in general was that they were for a chosen few, and not generally useful day-to-day. This turns out to be almost completely untrue. Since the standards documents lay out the rules which the people implementing the standard must follow, they often provide one of the very best references for how things behave in the real world. They also must be clear enough to follow, and detail the corner cases that introductory blog posts always seem to leave out.
Surely enough, I quickly found myself skimming through the C99 specs for everything from finding out what the ‘register’ keyword actually does (hint: nothing to do with register allocation) to the exact behavior of designated initializers for structs. The spec isn’t always the clearest, and takes some time to read, but importantly it’s almost always right.
This habit carried forward to other projects. Now I find myself turning to the specifications that define the languages and protocols I work with as a matter of course, rather than as a line of last defense. My understanding of both HTML and CSS has improved greatly from reading sections of the specification. The CSS Box Model in particular provides quite a well-structured introduction to the conceptual sizing model of CSS which I never truly understood before.
I’ve also found myself referencing the specs for subjects as wide-ranging as HTTP, FTP, C#, Go, JSON, even things like the reference docs for Java Keystore implementations. Each has provided new insight into the nature of the language or protocol, and has provided answers to some very difficult questions.
As a result, I’ve made a resolution. Rather than asking someone if they’ve googled something, I’ll first ask if they’ve checked the standard.
Have you found any technical standards particularly useful?