March 31st, 2015
(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at: firstname.lastname@example.org
They make this sound negative, but every branch of engineering is built up on folklore, some of which stretches back for thousands of years. On a practical level, few us ever need to go back to first principles. It is faster and more efficient to work from rough rules of thumb that work most of the time.
In practice, very few people study the primary sources (or even authoritative secondary sources) when they’re programming and then work forward from first principles; instead they find convenient references, copy and adapt code that they find lying around in various places (including the Internet), and repeat things that they’ve done before with whatever variations are necessary this time around. If it works, ship it. If it doesn’t work, fiddle things until it does. What this creates is a body of superstition and imitation. You don’t necessarily write things because they’re what’s necessary and minimal, or because you fully understand them; instead you write things because they’re what people before you have done (including your past self) and the result works when you try it.
(Even if you learned your programming language from primary or high quality secondary sources, this deep knowledge fades over time in most people. It’s easy for bits of it to get overwritten by things that are basically folk wisdom, especially because there can be little nuggets of important truth in programming folk wisdom.)
All of this is of course magnified when you’re working on secondary artifacts for your program like Makefiles, install scripts, and yes, init scripts. These aren’t the important focus of your work (that’s the program code itself), they’re just a necessary overhead to get everything to go, something you usually bang out more or less at the end of the project and probably without spending the time to do deep research on how to do them exactly right. You grab a starting point from somewhere, cut out the bits that you know don’t apply to you, modify the bits you need, test it to see if it works, and then you ship it.