{"id":4611,"date":"2014-10-10T10:30:01","date_gmt":"2014-10-10T14:30:01","guid":{"rendered":"http:\/\/www.starkeith.net\/coredump\/?p=4611"},"modified":"2022-12-02T16:34:55","modified_gmt":"2022-12-02T21:34:55","slug":"things-wish-id-known-started-programming","status":"publish","type":"post","link":"https:\/\/www.starkeith.net\/coredump\/2014\/10\/10\/things-wish-id-known-started-programming\/","title":{"rendered":"Things I Wish I&#8217;d Known When I Started Programming"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4629\" data-permalink=\"https:\/\/www.starkeith.net\/coredump\/2014\/10\/10\/things-wish-id-known-started-programming\/code\/\" data-orig-file=\"https:\/\/www.starkeith.net\/coredump\/wp-content\/uploads\/\/2014\/09\/code.png\" data-orig-size=\"171,178\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"code\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.starkeith.net\/coredump\/wp-content\/uploads\/\/2014\/09\/code.png\" class=\"alignright size-full wp-image-4629\" src=\"http:\/\/www.starkeith.net\/coredump\/wp-content\/uploads\/\/2014\/09\/code.png\" alt=\"code\" width=\"171\" height=\"178\" \/>I&#8217;ve been programming for more than a few years now, but sometimes I like to look back at things I wrote when I was much younger, and reflect on how much I&#8217;ve learned since then. Of course, no one expects you to start out knowing everything, but there are a few things I wish I&#8217;d known when I started, or that I&#8217;d learned a bit sooner than I did. So, just for fun I thought I&#8217;d come up with a list of a few of the things I wish I&#8217;d known when I started programming.<\/p>\n<h3>Use Source Code\/Revision Control<\/h3>\n<p>Like a lot of young developers, when I first started writing code I didn&#8217;t use any sort of source code\/revision control system (just zipping up the project files every so often doesn&#8217;t count). But once I did, I realized how wrong I&#8217;d been &#8211; having a complete history of all changes is just <em><strong>sooooooooo<\/strong> <\/em>helpful, even without any of the other features (branches, merging, etc.).<\/p>\n<p>Now, there is a bit of a learning curve with any revision control system, and when you&#8217;re just starting out that learning curve can be a bit steep, especially in addition to all the other stuff you&#8217;re learning at the same time &#8211; but it is so worth the time and effort. Being able to undo changes, or make different changes to the same code (via branches), and just in general having a nice, detailed history of what you&#8217;ve done and what&#8217;s changed over time is simply invaluable. This is especially true if you&#8217;re part of a multiple programmer team, but it&#8217;s also just as true if you&#8217;re working by yourself.<\/p>\n<p>For anything beyond 5-minute throw-away projects, use source code revision control!<\/p>\n<h3>Write Comments So That You&#8217;ll Understand Them Months or Years Later<\/h3>\n<p>Writing comments is like writing a log entry that you&#8217;ll inevitably need to review much, much, much later &#8211; so taking the time to write it clearly is well worth it. Countless times I&#8217;ve run across old comments of mine and wondered &#8220;what was I thinking?&#8221;<\/p>\n<p>Same goes for commit messages &#8211; brevity may be the soul of wit, but not when it comes to commit messages! You shouldn&#8217;t need to do a diff on a particular commit just to figure out what you did; the commit message should at least give you a general idea.<\/p>\n<p>On the flip side, though, you don&#8217;t want to be writing novels in your comments or commit messages, either &#8211; so write enough to be understood, but don&#8217;t be needlessly wordy, either.<\/p>\n<h3>Automate the Build &amp; Deployment<\/h3>\n<p>It doesn&#8217;t matter how many times you&#8217;ve gone through the process of compiling or deploying a build, someday you will forget a step. And it&#8217;s also just so nice to be able to kick off a complete build &amp; deploy with a single click and then go grab a cup of coffee or something, instead of having to sit there and go through all the steps manually. So take the time to write a script to automate the process &#8211; it doesn&#8217;t need to be super-complicated, just something to do the work for you. Believe me, it&#8217;s worth it.<\/p>\n<h3>No Fix or Change is Ever Too Small to Not Test<\/h3>\n<p>Also known as &#8220;TEST EVERYTHING,&#8221; this one&#8217;s a hard rule to stick too, especially for really small things like changing a typo in some text &#8211; but you still have to do it. It might seem like a tiny change that couldn&#8217;t possibly cause any problems anywhere else &#8211; but code is complicated, and complexity breeds bugs in the weirdest ways. Maybe that little text change you made causes a display issue at higher DPI settings, or when using a different font &#8211; you won&#8217;t know until you test it.<\/p>\n<h3>If You Find a Problem, no Matter How Small, Put it in the Bug Tracker!<\/h3>\n<p>When making a fix &#8211; even for a small, seemingly insignificant problem &#8211; if it&#8217;s in production code (or in a released beta build), you&#8217;d better be writing up a bug report for it. Just making a comment in your SVN commit log isn&#8217;t enough &#8211; you need a proper report that can be searched and found and referenced, because someday, maybe years from now, you&#8217;ll need to know how or why you made this change.<\/p>\n<p>(I will make an exception here to &#8220;fixing a typo&#8221; text-only changes, but <em>only just<\/em>.)<\/p>\n<h3>Always Write a Spec (But Don&#8217;t Write a Novel)<\/h3>\n<p>Just as fixing (seemingly) simple bugs can have unexpected consequences, designing and adding simple features or changes can turn out to be unexpected complicated. Writing a spec &#8211; even if it&#8217;s just a quick outline on paper or on a whiteboard &#8211; can help immensely in heading off these unexpected complexities. (Or, at the very least, you&#8217;ll know there are complexities and can design around them.) Good software should always be designed first, then coded &#8211; and writing a specification is part of the designing step (if not the entirety of it).<\/p>\n<p>At the same time though you don&#8217;t need to write a novel&#8217;s worth of specifications, even for complicated changes or features. If the spec is too long (or goes into too much detail) then no one will read it &#8211; yourself included. If your spec just has to be that long, then maybe the feature or change you&#8217;re planning should be broken down into smaller parts first. Finding the right balance between length &amp; specificity is a skill that takes practice to get right, but it&#8217;s one that&#8217;s worth learning.<\/p>\n<hr \/>\n<p>These are just some of the things I wish I&#8217;d known when I started programming all those years ago &#8211; if you have things you wish you&#8217;d known, feel free to share them in the comments!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been programming for more than a few years now, but sometimes I like to look back at things I wrote when I was much younger, and reflect on how much I&#8217;ve learned since then. Of course, no one expects you to start out knowing everything, but there are a few things I wish I&#8217;d&hellip; <a class=\"more-link\" href=\"https:\/\/www.starkeith.net\/coredump\/2014\/10\/10\/things-wish-id-known-started-programming\/\">Continue reading <span class=\"screen-reader-text\">Things I Wish I&#8217;d Known When I Started Programming<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":4629,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"webmentions_disabled_pings":false,"webmentions_disabled":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[199,201],"tags":[370,100,107,97,369],"class_list":["post-4611","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-my-opinion","category-software-technology","tag-development","tag-opinion","tag-programming","tag-software","tag-source-control","entry"],"jetpack_featured_media_url":"https:\/\/www.starkeith.net\/coredump\/wp-content\/uploads\/\/2014\/09\/code.png","jetpack_shortlink":"https:\/\/wp.me\/pimUj-1cn","jetpack-related-posts":[{"id":1281,"url":"https:\/\/www.starkeith.net\/coredump\/2008\/08\/13\/10-tips-for-new-programmers\/","url_meta":{"origin":4611,"position":0},"title":"10 Tips for New Programmers","author":"Keith Survell","date":"August 13, 2008","format":false,"excerpt":"It occurred to me the other day that I've been doing this stuff (programming) for more than a few years now - most of them in a very much \"professional\" manner. So I guess that makes me qualified to come up with lists like this! Learn the machine. Build yourself\u2026","rel":"","context":"In &quot;My Opinion&quot;","block_context":{"text":"My Opinion","link":"https:\/\/www.starkeith.net\/coredump\/category\/personal\/my-opinion\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1201,"url":"https:\/\/www.starkeith.net\/coredump\/2008\/07\/10\/some-of-my-programming-book-recommendations\/","url_meta":{"origin":4611,"position":1},"title":"Some of MY Programming Book Recommendations","author":"Keith Survell","date":"July 10, 2008","format":false,"excerpt":"Well, I shouldn't say \"recommendations,\" since I'm just recommending one book: Testing Computer Software (Second Edition) by Cem Kaner, Jack Falk, and Hung Quoc Nguyen. This is an utterly invaluable book for anyone who ever aspires to be more than just a code monkey. Technically speaking, this book was written\u2026","rel":"","context":"In &quot;My Opinion&quot;","block_context":{"text":"My Opinion","link":"https:\/\/www.starkeith.net\/coredump\/category\/personal\/my-opinion\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":493,"url":"https:\/\/www.starkeith.net\/coredump\/2005\/05\/12\/joel-on-software-back-to-basics\/","url_meta":{"origin":4611,"position":2},"title":"Joel on Software &#8211; Back to Basics","author":"Keith Survell","date":"May 12, 2005","format":false,"excerpt":"This article makes a good point about something very important; namely, that to be a good software programmer, you have to know a lot about the nuts & bolts of how the computer works - from raw CPU instructions right up to drivers & other high-level nonsense.","rel":"","context":"In &quot;personal&quot;","block_context":{"text":"personal","link":"https:\/\/www.starkeith.net\/coredump\/category\/personal\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2800,"url":"https:\/\/www.starkeith.net\/coredump\/2009\/09\/08\/treating-our-legal-code-like-computer-code\/","url_meta":{"origin":4611,"position":3},"title":"Treating our Legal Code like Computer Code","author":"Keith Survell","date":"September 8, 2009","format":false,"excerpt":"Looking at some pending legislation through the eyes of a computer programmer... and finding it... wanting.","rel":"","context":"In &quot;My Opinion&quot;","block_context":{"text":"My Opinion","link":"https:\/\/www.starkeith.net\/coredump\/category\/personal\/my-opinion\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1882,"url":"https:\/\/www.starkeith.net\/coredump\/2009\/04\/09\/communication-and-programming\/","url_meta":{"origin":4611,"position":4},"title":"Communication and Programming","author":"Keith Survell","date":"April 9, 2009","format":false,"excerpt":"Programming is all about communicating - communicating with the computer, and with other people. So it follows that to be a good programmer, you need to be a good communicator, too.","rel":"","context":"In &quot;My Opinion&quot;","block_context":{"text":"My Opinion","link":"https:\/\/www.starkeith.net\/coredump\/category\/personal\/my-opinion\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4398,"url":"https:\/\/www.starkeith.net\/coredump\/2013\/06\/19\/know-your-code\/","url_meta":{"origin":4611,"position":5},"title":"Know Your Code","author":"Keith Survell","date":"June 19, 2013","format":false,"excerpt":"Q: As a .NET programmer, why do you care about being familiar with the Win32 API? A: Because the .NET framework is just another abstraction, and I like to think that I'm a good programmer - and good programmers know that all abstractions are leaky.","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/www.starkeith.net\/coredump\/category\/technology\/software-technology\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/posts\/4611","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/comments?post=4611"}],"version-history":[{"count":1,"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/posts\/4611\/revisions"}],"predecessor-version":[{"id":5943,"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/posts\/4611\/revisions\/5943"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/media\/4629"}],"wp:attachment":[{"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/media?parent=4611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/categories?post=4611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.starkeith.net\/coredump\/wp-json\/wp\/v2\/tags?post=4611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}