Ask HN: What does a disciplined programmer look like?
I have a polar star &#x2F; meta kind of rule and chunk down from there:<p><pre><code>  me[i+1] &gt; me[i]
</code></pre>
`i` can be time but is not specified so it can work with any granularity you like: year, month, day, hour, minute. It also works for space: the me in a place needs to be better than the me in another place.<p>Discipline not being discouraged. One of my favorite sayings since I was a child is &quot;Ad augusta per angusta&quot;. At one point I was reading about two to three books or equivalent per day. Now I can&#x27;t do that and it&#x27;s discouraging. Discipline to push through that and read during commute what amounts to a book or two per week. Pales in comparison, but it takes discipline not to be discouraged by the disparity.<p>Discipline also to think more about what I read: from compulsive consumption to pondering and trying to learn from what I read to serve my day to day life, instead of merely getting high on &quot;knowledge acquisition&quot;. Wisdom vs knowledge, if you will. A great slogan is Wharton&#x27;s &quot;Knowledge for action&quot;. I like that.<p>Discipline in outsmarting myself. I&#x27;m writing code and I know that I&#x27;m not as smart as I am, so I leave a trail of thoughts in the comments to take my future self by the hand on why something was written the way it was, and where to go from there. Plenty of TODO detailing the reasons (so they may be changed if the reasons became invalid). My future self loves my past self for being so thoughtful and prescient and patient with him.<p>Discipline to avoid shortcuts. &quot;Move fast and break things&quot; is bullshitese to me. It&#x27;s bullshit and I think people who live by that aren&#x27;t the one fixing the broken pieces. Shitty code is seldom clever and those who shit it seldom refactor it. Discipline to acknowledge the fact that if I think I&#x27;m moving faster by skimping on variable names, I&#x27;m being a moron and others may pay the price.<p>Discipline in trying to think hard about my code and constantly refactor it, unbeknownst to my employer who tells me the code is good as it is and not to break it by refactoring it, to which I retort it&#x27;s as good as it is (or not as bad as it was) <i>because</i> I constantly refactor it. It means writing documentation for imaginary code beforehand and how I would use it, it means once written getting <i>non-programmers</i> to try to follow the docs for an API so if a <i>non-programmer</i> who&#x27;s never written a line of code can get it to work easily, future maintainers won&#x27;t have too much trouble. It means to learn new tools to make better docs. Discipline in taking care to write good exception messages that when raised communicate I&#x27;m on top so at least the user doesn&#x27;t panic and knows if there is a detailed message for it, it&#x27;s okay. A message that explains why it happened and what to do about it (even giving a list of Linux commands to run to narrow down the scope or fix it).<p>Discipline in consistently trying to learn more about how the mind works (Hebb, Ebbinghaus, LTP, and how these beautiful tentacular beasts we have in our skulls work). It is about triggering a break-point when I have a good idea and dumping the context to know why and how I had it, trying to go as far back as I can. It also works on bad ideas. Discipline in having a pen with me. It&#x27;s having a pen and a notepad on my bedside so I can note my thoughts right when I&#x27;m about to sleep: ever had a great idea right before you gave in to Morpheus and were glad because you&#x27;ll implement it &quot;tomorrow&quot; only to wake up having forgotten about it? It&#x27;s happened to me but I know better than to count on myself remembering it.<p>Discipline in being intellectually honest and not bullshit someone who knows less than me on a tiny specific point. This includes myself (I have a check: do I know what I&#x27;m telling myself or am I just bullshitting myself? Can I prove to myself I know what I&#x27;m talking about and what are my arguments? Do I at least have a starting point to get the factually correct information? If yes, what am I waiting for to get it?).<p>Discipline in observation. I&#x27;m fortunate to have a wide range of interests (but even that is a fruit of discipline: maintaining the interest I had as a child and not letting it die). Observe other fields and get inspired, borrow things, mindsets, tools, practices, etc.<p>Discipline in catching myself when I think something is &quot;obvious&quot;. Is it really? During sophomore year in college we had a course in Strength of Materials. A very counter-intuitive and beautiful thing is why a pull-up bar is hollow (a tube) and not full. Discipline to have a magnifying glass on &quot;intuition&quot; and guard myself against thinking something is &quot;trivial&quot; because things rarely are.<p>Discipline to ask why someone wrote a line of code the way they did. It&#x27;s easy to think we&#x27;re smarter than the next guy, it&#x27;s easy to change a weird line of code, but it takes discipline to figure out <i>why</i> it was written the way it was. Chesterton&#x27;s fence and what not.<p>Discipline in asking people questions, asking them to explain to me what they do and why they do it. Whether a banker, a shepherd, a soldier, a surgeon, a dentist, a mechanic, an author, an illegal taxi driver.. I care about process, motivations and incentives: what do people do, and why they do it.<p>Discipline in seeking universal truths. I have a feeling I&#x27;m about to have a great insight about something, I don&#x27;t know which. It&#x27;s akin to feeling a presence in the dark, you don&#x27;t know what it is and <i>if</i> there&#x27;s anything there in the first place..<p>PS: If you have that universal truth about mind mastery, economics, and happiness.. Please share your secret here. I accept panaceas and silver bullets.