<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Eddie Prislac on Medium]]></title>
        <description><![CDATA[Stories by Eddie Prislac on Medium]]></description>
        <link>https://medium.com/@semperfried76?source=rss-804320492465------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JD8K606W08VqCitQb5tLtQ.png</url>
            <title>Stories by Eddie Prislac on Medium</title>
            <link>https://medium.com/@semperfried76?source=rss-804320492465------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 03:05:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@semperfried76/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why does ‘5’ + 0 equal 50?]]></title>
            <link>https://medium.com/vets-who-code/why-does-5-0-equal-50-a7359096b281?source=rss-804320492465------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7359096b281</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[type-coercion]]></category>
            <category><![CDATA[novice]]></category>
            <category><![CDATA[equality]]></category>
            <dc:creator><![CDATA[Eddie Prislac]]></dc:creator>
            <pubDate>Sat, 08 Jun 2019 21:51:27 GMT</pubDate>
            <atom:updated>2019-06-10T15:53:40.589Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Common JS noob mistakes with type coercion, and how to avoid them</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nn6gQKbJqjfqQe6RbkSHpQ.png" /></figure><h3>A short preface:</h3><p>Lately in <a href="http://vetswhocode.io/">Vets Who Code</a>, our head honcho, <a href="https://twitter.com/JeromeHardaway">Jerome Hardaway</a>, has been posting little code challenges, for the purpose of warming everyone up each morning, and getting our new troops prepared for the cohort we have starting in September.</p><p>These are not meant to be difficult problems, just a little something to wake up everyone’s brains in the morning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/357/1*olTzK29TYEM3awxjahbOkQ.png" /><figcaption><a href="http://vetswhocode.io/">Vets Who Code</a> is a non-profit org where we train vets, free of cost, to be badass React devs, and help them get jobs in the industry. The above pic is of Jerome, dressed in the contemporary uniform common during his time in the military. (I kid, of course. He got out of the Air Force a mere 10 years ago, and has a great sense of humor — at least I hope so, those guns ain’t photoshopped).</figcaption></figure><p>However, my brain does not like to be woken up in the morning. I work from home, and tend to work late, into the wee hours of morning. More commonly than not, I tend to rise about an hour before my first morning meeting.</p><p>By the time standup rolls around, my brain’s still attempting to assimilate the caffeine from my first two cups of <a href="https://deathwishcoffee.com/">Death Wish Coffee</a> (not a paid promo, I just love their high-octane brew, and they deserve the publicity).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gXEdwWVZIHdEQIqVoIzukA.jpeg" /><figcaption>I will, however, accept sponsorship if they offer. I like money (and/or free coffee). * (see footnote 1)</figcaption></figure><p>Wake my brain up earlier then it’s prepared to, and my cranky ass becomes possessed with a desire to rip shit up. This goes against best practices for working at home, I know. I cop to the fact that I, like many others, struggle to maintain the discipline and motivation it takes to maintain such a lifestyle. I’m working on it, but there are still some mornings where I’m not quite there yet.<br>It was when I was in this state of mind that I started to notice some common mistakes which appeared in quite a few of the submissions. Keep in mind, the folks that make these submissions have not started our program yet, they’re waiting their turn, so I really shouldn’t be so hard on them. However, it’s in their best interests to learn this stuff early, so with that in mind, let’s get started…</p><h3>An example problem:</h3><p><em>Write a JS function to calculate the sum of two given numbers.<br>If either param or the sum of both params are equal to 50, return </em><em>true</em></p><p>Sounds simple right?<br>At first glance, something like this may seem passable:</p><pre>function fiftyOrSumOfFifty (num1, num2) {<br>  if (num1 == 50 || num2 == 50) {<br>      return true;<br>  }<br>  else if (num1 + num2 == 50) {<br>      return true;<br>  }<br>  else {<br>      return false;<br>  }<br>}</pre><p><strong>Note:</strong> This was not taken from a specific student’s code, I’m not trying to call<br>anybody out on the quarterdeck. Rather, this was the most common<br>solution I saw, cleaned up a little, formatting-wise… and it’s not surprising, really. Given the fact that the students had little to no prior instruction outside of the pre-work they’d done to be accepted into the program, I’m actually quite happy to see something like it, even with its issues.</p><p>It even works, if you feed it the right params…</p><pre>console.log(fiftyOrSumOfFifty(25, 25)) // returns `true`<br>console.log(fiftyOrSumOfFifty(25, 0))  // returns `false`<br>console.log(fiftyOrSumOfFifty(50, 0))  // returns `true`<br>console.log(fiftyOrSumOfFifty(4, 50))  // returns `true`</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*mNdFP43_sl6B6CSpXUCcJQ.png" /><figcaption>Yup.</figcaption></figure><p>However, like I told you before, the sweetness of my creamer and that awesome caffeine buzz (thanks again, Death Wish!) had yet to overcome the bitterness of my morning funk, and I decided to start feeding it params it might not like. This leads to common JS noob mistake numero uno:</p><ol><li><strong>Not accounting for parameter type</strong></li></ol><p>JS is a weakly-typed language. As opposed to strongly-typed languages, <a href="https://en.wikipedia.org/wiki/Strong_and_weak_typing">which enforce the type of params allowed</a>, JS lets you stick any old thing into the params, and will happily feed you an answer, if it’s capable. However, that answer may not be the one we’re looking for. For example, in the above code, what happens if we feed a string to the function fiftyOrSumOfFifty?</p><pre>console.log(fiftyOrSumOfFifty(&#39;50&#39;, 0)) // returns `true`<br>// and...<br>console.log(fiftyOrSumOfFifty(&#39;5&#39;, &#39;0&#39;)) // also returns `true`<br>console.log(fiftyOrSumOfFifty(&#39;5&#39;, 0)) // also returns `true`</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*HZFuB76i-I4qV6GGW0HXlg.gif" /><figcaption>WHAT THE…. WHAT?</figcaption></figure><p>So, here’s what’s happening: as I said before, JS does not care if you feed it the wrong type of params. Because it’s a loosely-typed language, it will accept anything for a param.</p><p><strong>ANYTHING.</strong></p><p>You could feed it an Integer, Float, String, Boolean, Array, or nothing at all (null) if you wanted, and if it&#39;s able to do something with that param that fits into the code you&#39;ve written, JS will return something, without throwing an error. In the first case above where we submit a string, we&#39;re submitting a value that can be coerced to a type that can indeed equal 50, and so returns true. That actually leads into the next common mistake, and we&#39;ll get to that in a second. It&#39;s related to this one, but in a much more specific way. In the third string example, we&#39;re submitting &#39;5&#39;, a string, and 0, an integer. Why does this return true? Because you can use the + operator on a string, and it will work.</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Examples">It just won&#39;t sum the two params</a>.</p><p>When you use the + operator on a pair of strings, it <em>concatenates</em> the strings; that is, it sticks the second directly on to the tail end of the first. In the example function, this means that eventually, because neither param is equivalent to 50, the params get passed on to the summing operation, which, because we have provided a string for one of the params, now becomes a concatenation operation, and &#39;5&#39; + 0 evaluates as &#39;50&#39;.</p><p>Why does this work the same in the second example as in the third, where we are submitting two params of different types? Because JS utilizes a trick called<br><em>type coercion</em>... if handed two vars of different types in an operation like +, it will attempt to convert one of the vars into the first type that makes sense, which in this case means that both are treated as strings, and the 0 gets tacked on to the &#39;5&#39; as &#39;0&#39;, resulting in &#39;50&#39;, which will return true.</p><p>But wait a minute… if the + operator converted it to a string, why is that<br>&#39;50&#39; (a string, that is, text), evaluating as equal to 50 (a number)?<br>That should not be!</p><p>Well, yes and no… I’m coming to that, stop being so impatient.</p><p>First, remember how I told you that you could also slip an Array into the params? Well, one way you can get around the whole string concatenation bit I mentioned previously, is to parse your params as floats (ex: parseFloat(&#39;15&#39;) // returns 15)... when you do this to an Array, however, something interesting happens:</p><pre>console.log(parseFloat([&#39;50&#39;, 25])) // returns... 50??? WTH!!!</pre><p>When you use parseFloat on an Array, it only parses the first item in the Array! Does the weirdness never cease? This surprised me, and I only just discovered this oddness as I was typing out this article, as I&#39;d honestly never thought to try parsing an Array as a Float before. It’s actually so unheard-of to do this, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseFloat">it’s not even given a mention in MDN’s documentation</a>. Just goes to show you can learn something new every day. I decided to avoid the issue altogether, and if either param was an array (ex: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray">Array.isArray(num1)</a>...), I&#39;d just return false.</p><p>Anyways, getting back to type coercion…</p><p>2. <strong>=== &gt; ==</strong></p><p>The example function is evaluating equality using the == (&#39;double-equals&#39;) operator, which <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness"><em>infers typ</em></a><em>e</em>. This means that, like the + operator coerces the type of the var and changes its function from &#39;sum&#39; to &#39;concatenate&#39;, the double-equals operator is looking at the two vars and saying to itself: <em>“Hey, one of these things is not like the other... but maybe it could be, if they had the same type? Let&#39;s try that!”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*wumtkNDr9qIOfSFXN9AE5w.png" /></figure><p>Since &#39;50&#39; can be parsed as 50, &#39;50&#39; == 50 evaluates true. This is actually a pretty easy mistake to make, especially if coming over to JS from another language, as most other programming languages don&#39;t do this with their double-equals operator - the == operator in most other languages will function much like the === (triple-equals) operator does in JS, and will perform strict equivalence evaluation... that is, a string will NEVER be equal to a number, no matter how similar the text inside the string may be. In other languages, the === operator does not necessarily function the same way...</p><pre># For instance, in Ruby, `===` <a href="http://www.zenruby.info/2016/05/ruby-operators-equality-comparison.html">can be used to compare type</a><br>String === &#39;bacon&#39; # evaluates to `true`</pre><p>…and so, a JS newbie, when coming from Ruby, may not expect it to function<br>the way it does in JS, or even be aware of its existence. In Ruby, == does what === does in JS. Excusable, if you&#39;re new to the language, but use of == to check equivalence is a habit that should be broken swiftly when training new JS devs, lest they fall into a bad habit. There are just too many side-effects that using this operator can produce. Instead of using ==, === (triple-equals) should be used when checking equality, as <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness">it does not perform any type-conversion</a>.</p><p>Speaking of bad habits that ought to be broken swiftly:</p><p>3. <strong>Excessive conditionals and returns, or, ‘Failure to refactor’</strong></p><p>This can be attributed to lack of experience. Refactoring ones code to be more efficient eventually comes to be a habit, but it’s one that must be learned and self-enforced. The given example uses one if to check a condition and return true if that condition returns true, then uses else if to check another statement and return true if that statement returns true, then finally utilizes an else statement to return false if all else fails. Think about that sentence for a moment. The conditions themselves are <em>already returning a boolean value</em>. We don&#39;t need the conditional, at all. With the application of the || (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators">logical &#39;or&#39;</a>) operator, we can do return (condition1) || (condition2) || (condition3), and avoid the use of the conditional statements, altogether.</p><h3>Wrapping up:</h3><p>Here’s my first solution to the problem; it allows string params, so long as they can parse to floats and pass the conditions, to return true. I chose to do that because JS is primarily meant for the web, and if you’re doing DOM manipulation, it’s all text until you parse it to be otherwise (or use a number input, I guess; if you want the whole truth, I over-thought it). It will not, however, allow Arrays, undefined, or null, or any other data type that I’ve thought of aside from numbers and strings, to eval to true:</p><pre>const numOrSumFifty = (num1, num2) =&gt; !anyArr(num1, num2) &amp;&amp; any50(num1, num2)</pre><pre>const any50 = (num1, num2) =&gt; {<br>  return numIs50(num1) || numIs50(num2) || numIs50(sum(num1, num2))<br>}</pre><pre>const anyArr = (num1, num2) =&gt; Array.isArray(num1) || Array.isArray(num2)</pre><pre>const numIs50 = num =&gt; parseFloat(num) === 50</pre><pre>const sum = (num1, num2) =&gt; parseFloat(num1) + parseFloat(num2)</pre><p>However, had I chosen not to allow string params (which I probably should have done in the first place; over-engineering is an anti-pattern in and of itself, after all), this function could easily boil down to something much, much simpler:</p><pre>const numOrSumFifty =<br>  (num1, num2) =&gt; num1 === 50 || num2 === 50 || num1 + num2 === 50</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*2bc_aP-TStF7HJ-X3ucb1A.png" /><figcaption>How I felt about my past self, after refactoring my code.</figcaption></figure><p>Remember what I said about failure to refactor? Always check yourself, kids.</p><p>I wrote my functions out in <a href="http://repl.it/">repl.it</a> as <a href="https://jestjs.io/">Jest</a> examples, rather than straight JS examples, so I could write test suites for the functions (You can find the first <a href="https://repl.it/@eprislac/numOrSumFifty">here</a>, and the ‘no-string-params’ example <a href="https://repl.it/@eprislac/numOrSumFifty-noStrings">here</a>). I invite you to write your own tests for the suites in a fork and try to break my functions. If you can think of a case I haven’t, I’ll be more than happy to update my code, and credit you for the find; I love peer review! None of us is above reproach, and if I’ve gotten something wrong, I’d rather know and be able to fix it, than be left in the dark.</p><p>And with that, I hope I’ve shed a little light on some of the mistakes one can commonly make with Javascript’s loose typing as a novice JS dev (and a couple even a pro can make, if they’re not careful). Until next time!</p><p><em>references:</em></p><ol><li><strong><em>Strong and weak typing</em></strong><em>: </em><a href="https://en.wikipedia.org/wiki/Strong_and_weak_typing"><em>https://en.wikipedia.org/wiki/Strong_and_weak_typing</em></a></li><li><strong><em>Loose equality and sameness</em></strong><em>: </em><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness"><em>https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness</em></a></li><li><strong><em>Arithmetic Operators</em></strong><em>: </em><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Examples"><em>https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators</em></a></li><li><strong><em>parseFloat</em></strong><em>: </em><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseFloat"><em>https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseFloat</em></a></li><li><strong><em>isArray</em></strong><em>: </em><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray"><em>https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray</em></a></li><li><strong><em>Logical Operators</em></strong><em>: </em><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators"><em>https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators</em></a></li><li><strong><em>Jest: Delightful Javascript Testing</em></strong><em>: </em><a href="https://jestjs.io/"><em>https://jestjs.io/</em></a></li><li><strong><em>Repl.it</em></strong><em>: </em><a href="https://repl.it/"><em>https://repl.it/</em></a></li><li><strong><em>Ruby operators equality comparison</em></strong><em>: </em><a href="http://www.zenruby.info/2016/05/ruby-operators-equality-comparison.html"><em>http://www.zenruby.info/2016/05/ruby-operators-equality-comparison.html</em></a></li></ol><p><em>footnotes:</em></p><ol><li><em>This is a joke, medium.com is ad-free. I hear-by swear that no company has compensated me in any way for promotion in this article, and that I am in no way affiliated with Death Wish Coffee.</em></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7359096b281" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vets-who-code/why-does-5-0-equal-50-a7359096b281">Why does ‘5’ + 0 equal 50?</a> was originally published in <a href="https://medium.com/vets-who-code">The SitRep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adaptive Best Practices]]></title>
            <link>https://medium.com/vets-who-code/adaptive-best-practices-61a32a03d859?source=rss-804320492465------2</link>
            <guid isPermaLink="false">https://medium.com/p/61a32a03d859</guid>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[best-practices]]></category>
            <dc:creator><![CDATA[Eddie Prislac]]></dc:creator>
            <pubDate>Thu, 14 Mar 2019 15:26:25 GMT</pubDate>
            <atom:updated>2019-03-14T15:26:25.379Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UqX8w6VliDiYknE8hCyxGg.jpeg" /><figcaption>image courtesy of Markus Spiske on <a href="https://unsplash.com/photos/qjnAnF0jIGk">unsplash.com</a></figcaption></figure><p><em>Originally published Nov 10, 2015 on my website, </em><a href="http://semperfried.com/best-practices/2015/11/20/adaptive-best-practices.html"><em>semperfried.com</em></a></p><p>I’ve been reading up on best practices lately, not just in software, but in general, and came across Lindsey Dunn’s article entitled <a href="http://www.beckershospitalreview.com/healthcare-blog/best-practices-don-t-matter-here-s-what-does.html">Best practices don’t matter, here’s what does…</a>. The article raises some great points about the blind implementation of best practices and argues for an adaptive culture, citing Toyota’s great success, and how they teach the adaptive methods. Now, this may leave some scratching their heads a bit… you may ask what an article in an online hospital review magazine and an automobile manufacturer’s decisions about best practices have to do with software development. There are some that will be reading the linked article and in their head, they’re bare-chested, swinging their shirts around their heads, and screaming “WOO-HOO!!! THERE’S NO RULES!!!”. You guys, put your shirt back on, and all of you bear with me for a moment, there is a point to this.</p><p>The quote that struck me the most from the article goes like this:</p><blockquote>“We know we cannot implement perfect processes because, first of all, we are human and humans aren’t perfect. Secondly we know that, even if we design a perfect process, the environment will change around that process in unknown and unknowable ways. Therefore, although we work hard to design the best process possible, it is much more important for us to know when our processes fail and then improve them or the environment around them as quickly, simply and easily at the lowest-cost possible.”</blockquote><p>So, identify process failures, then rapidly implement new ‘best practices’ to solve them. While on the surface, the article seems to speak against best practices, the point it actually makes is that we can’t be blind slaves to them; If something in your process breaks or changes, what you previously thought of as a best practice could end up not being so great after all (it’s kind of a “best practice” in and of itself, when you think about it — ironic, huh?). How this relates to software development should be obvious, by now, as this is the essence of the Agile programming model, and a metaphor for the pace at which technology and product life-cycle changes can affect our lives as developers.</p><p><strong>Case 1:</strong> In 2010, OpenStruct was listed in <a href="http://rails-bestpractices.com/posts/2010/08/25/use-openstruct-when-advance-search/">Rails Best Practices</a>, and as late as 2013, Ruby devs were singing the praises of <a href="http://www.schneems.com/2014/12/15/hashie-considered-harmful.html">OpenStruct over Hashie::Mash</a>. Of course, by this time people were already starting to <a href="http://rubyrailroad.com/2013/06/04/pass-openstruct-or-object-to-controller-from-view/">doubt</a>, and with improvements to the Ruby 2.x codebase in 2015, there’s now evidence that POROs constructed with keyword args greatly outperform not only OpenStruct, but Hash as well, prompting at least one dev to make the argument that <a href="http://palexander.posthaven.com/ruby-data-object-comparison-or-why-you-should-never-ever-use-openstruct">you should never, ever use OpenStruct</a>.</p><p><strong>Case 2:</strong> Everyone remember the <a href="https://en.wikipedia.org/wiki/Waterfall_model">Waterfall model</a>? When software development first became a thing, there was no process model for development cycles, so the Waterfall model was straight-up lifted from production and manufacturing- and for a while, it was the de-facto standard for working on projects in the industry; Although there were naysayers and mutations to the model, it worked, more or less, for a very long time.</p><p>Nothing lasts forever, though.</p><p>When <a href="https://en.wikipedia.org/wiki/Agile_software_development">Agile software development</a> was introduced in 2001, its’ iterative nature, short timeframes, feedback loops, and instant-gratification feel left a lot of us wondering why we’d ever wasted our time with Waterfall. One of my least-favorite phrases in the English language is ‘This is the way we’ve always done it’ (as if that was any justification whatsoever to continue doing something, even when you know that there may be better options available), and Agile seemed to fit my way of thinking to a tee, at the time.</p><blockquote><em>The 12 Principles of the Agile Manifesto:</em></blockquote><blockquote>Customer satisfaction by early and continuous delivery of valuable software</blockquote><blockquote>Welcome changing requirements, even in late development</blockquote><blockquote>Working software is delivered frequently (weeks rather than months)</blockquote><blockquote>Close, daily cooperation between business people and developers</blockquote><blockquote>Projects are built around motivated individuals, who should be trusted</blockquote><blockquote>Face-to-face conversation is the best form of communication (co-location)</blockquote><blockquote>Working software is the principal measure of progress</blockquote><blockquote>Sustainable development, able to maintain a constant pace</blockquote><blockquote>Continuous attention to technical excellence and good design</blockquote><blockquote>Simplicity — the art of maximizing the amount of work not done — is essential</blockquote><blockquote>Self-organizing teams</blockquote><blockquote>Regular adaptation to changing circumstance</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J_gjHIcjDIgS5rmk2-TtJg.jpeg" /><figcaption>image courtesy of Daria Nepriakhina, from <a href="https://unsplash.com/photos/zoCDWPuiRuA">unsplash.com</a></figcaption></figure><p>Agile wasn’t perfect, either, though — there have been many refinements since it was introduced (one might say that this itself fits in with the spirit of Agile, as it’s all about responding to changes and quickly adapting accordingly), and even outright challenges to it’s assumptions… The <a href="https://en.wikipedia.org/wiki/Software_craftsmanship">Software Craftsmanship</a> manifesto is one such response. Nowadays, I tend to be in the middle of this argument — there’s no reason why Software Craftsmanship and Agile can’t live side-by-side in harmony. “Projects are built around motivated individuals who should be trusted” — why should they be trusted? If a dev devotes him/herself to the rigors of precision, predictability, measurement, risk mitigation, and professionalism, there’s no reason to have any doubt. Adaptability is a high mark of professionalism in many organizations (the U.S. Marine Corps is one of these — “Adapt and Overcome” is one of the mantras they drill into you in basic training), and should be viewed as such in the software industry. “Working software is the principal measure of progress”; When one applies a professional mindset (and toolset) for testing and gauging the quality of one’s own code, working software is a natural outcome, (and exercising them falls in line with “Continuous attention to technical excellence and good design”). Moreover, applying said disciplines can lead to seeking out more ways to automate existing processes, allowing one to “…maximize the amount of work not done”.</p><p>So OpenStruct goes from being a best practice to something that’s frowned upon as being not only un-performant, but relatively dangerous from a security point-of-view. Waterfall goes from being the only game in town, to being beat out by Agile, which in turn is challenged by the Software Craftsmanship crowd. There’s a lesson that we can learn from this (aside from “not using OpenStruct, or Waterfall methodologies”) The lesson is this:</p><blockquote>“The best way of doing something now is not necessarily the way it was best done yesterday, and almost certainly not the best way available in the future”.</blockquote><p>Change is the only constant. Best Practices are good rules to follow (and I’ll never argue against them, on the whole) — they help us develop a sense of discipline and professionalism in our daily work, and most often do help us write better code. However, without the ability and willingness to learn new things and adapt to changes in the industry, you’ll eventually find your “best practices” will have you practicing the wrong thing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61a32a03d859" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vets-who-code/adaptive-best-practices-61a32a03d859">Adaptive Best Practices</a> was originally published in <a href="https://medium.com/vets-who-code">The SitRep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A career without a mentor, and why I wish I’d had one.]]></title>
            <link>https://medium.com/vets-who-code/a-career-without-a-mentor-and-why-i-wish-id-had-one-9863df014b68?source=rss-804320492465------2</link>
            <guid isPermaLink="false">https://medium.com/p/9863df014b68</guid>
            <category><![CDATA[mentorship]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[stories]]></category>
            <dc:creator><![CDATA[Eddie Prislac]]></dc:creator>
            <pubDate>Wed, 06 Mar 2019 18:59:43 GMT</pubDate>
            <atom:updated>2019-03-06T19:08:00.748Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*imdsUaZ8eulJWtKQv_Fqog.jpeg" /><figcaption>Not my Grandpa’s actual computer, but the same model. My Grandma also had a cat pretty similar to the one in the pic as well.</figcaption></figure><p>I first got into coding kind of by accident. My uncle, who is roughly the same age as I am, had experimented with programming when we were young, messing around with writing simple games on his dad’s Tandy-1000 (an antiquated bit of hardware today, but back when Grandpa got it, that thing was mind-blowing to us… it was like being a cave-man who’d discovered a portal into the future). I was impressed with him, but not enough to pick it up myself at the time… I was more interested in honing my artistic skills drawing and painting. It wasn’t until the web became something familiar with consumers quite a few years later that I actually started to take notice. I’d moved in with my uncle and started to dabble with Macromedia Flash, as its visually-oriented tools made a lot of sense to me. I rarely touched any of the backing code, however, focusing instead on the graphical end of things. This dalliance was interrupted by my entry into the Marine corps, and it wouldn’t be until I was able to purchase my first computer (a cheap eMachine) about a year into my enlistment, that I began to seriously endeavor to learn anything useful. However, this being the days when the internet was still in its adolescence and Google was just starting to be a thing, I spent a lot of time learning through trial-and-error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*Gy2qoS_KPxvmjkzlKWGHTw.jpeg" /><figcaption>Not what actually happened, but when spending $500 on a computer drains your bank account, installing Linux on a computer whose hardware doesn’t fully support it feels kind of like this.</figcaption></figure><p>My first real lesson was when I decided to learn something about this ‘Linux’ thing I’d been hearing about. I was sort of familiar with UNIX and knew a lot of important systems ran it, so thought it might be useful to learn a similar OS. I purchased a book on Linux and an actual hard-copy of RedHat from the PX on our base, and proceeded to install the OS on my machine… only to discover to my horror that the dial-up, 56kbps winmodem that came with my computer was not supported by Linux. I’d lost the ability to access the internet, negating the usefulness of my computer in a little less than an hour. I spent the rest of the night reformatting my hard drive and reinstalling Windows ME (yes, it was that long ago). This was the first occurrence of breaking something, and then learning on my own how to fix it, that would become my normal pattern of learning in the years to come.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H_5wA4z9hwRjI9HltzrOYQ.png" /><figcaption>A blurry pic of the crew I worked with to put in the solar field at The Marine Corps Air-Ground Combat Center, Twentynine Palms. That goof with the big ears on the top-right? That’s me.</figcaption></figure><p>Skipping forward a few years, I’d taken some programming courses at the local community college, and gotten married. Facing my imminent exit from the Corps upon my EAS, I’d taken a job from a temp agency, doing construction work on base, with the promise that there would be more work with the crew upon completion… a promise that was not fulfilled. The temp agency, however, had a job opening for a tech director, and they saw I had some computer experience, so offered me the position. What I didn’t know at the time, was that ‘Tech Director’ actually meant ‘The only guy on staff that knows anything about computers and needs to install and keep everything running, as well as design and write all the content for the company website’… a position I was woefully unprepared for. While I gave it my best shot, I was unsurprisingly let go from that position about six months later. Despite my failure, I was determined to make my way in the industry… my next job came in the form of a recommendation from one of my old Sergeants… he had a buddy who had started his own tech company, and needed some help. His company, as it turns out, handled network wiring. Not exactly what I’d wanted, but it still involved a lot of work with computers, so I spent much of the next year running network cable in warehouses and office buildings. In my spare time, I worked on the company’s website, and honed my skills in HTML and CSS to the best of my abilities. This was working out great, I thought… until it turned out that my employer was spending all the company’s funds (including as it turns out, my payroll) on his new girlfriend. I discovered this one morning when, after having deposited my paycheck and payed my bills for the month, I woke up to a negative balance of a few thousand dollars, as my employer had cancelled my paycheck after issuing it to me, and then skipped town. Dejected, I spent much of the next year in a protracted legal action against my former boss. I was awarded a $12k settlement, of which I’ve never actually seen a dime. I also didn’t work in tech for the next couple of years. I did, however, find work at the local Pizza Hut, as an assistant manager. There, I worked alongside two Cisco-certified engineers who had also been having trouble finding work, due to the fact that the ‘dot-com bubble’ had just burst, and there was now a glut of similarly-skilled tech-workers in southern California who were now finding themselves in the same position… out of work and wondering just why they’d bothered dropping so much cash on training and certification. I thought, if these guys, so much more qualified than I was, were having such a hard time finding employment in their chosen field, there was little hope for me. My salvation came in the form of that uncle I mentioned earlier, who recommended that I come back home to Texas and apply at the company he now worked for.</p><p>Skipping ahead a year or so, I was now working for that company in Houston, and again, much of my duties involved pulling cable (as well as providing IT support and computer repair for the boss’ family, ugh), but I was afforded much more time to hone my web development skills, as I was also to take over management of the company’s various websites. All for the low, low wage of $10/hr. Again, I found myself in the position of the company’s lone developer, so did most of my learning on the internet. At first, I did so through a couple of online colleges — both of which restructured their GI Bill programs so as to make them totally unworkable by anyone who was also trying to support a family of six while attending school, forcing me to eventually drop out. After that, I relied on various message boards, tutorial sites, books, and so on, trying desperately to consume any and all knowledge I could, and struggling to keep up with the constant inflow of new information. I went off in several different directions, but eventually learned enough C# to get roped into writing a bit of concierge software to control the automation systems for one of the high-end condominiums we were servicing. I had not, however, learned anything about version-control systems at this point… not that it really mattered, because a last-minute hardware change to a Linux-based tablet platform required me to rewrite the entire software from the ground up in PHP. It was at this point I was offered a job writing Flash apps for twice what I was making at the position I was then in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*pp-gADKXk1XteycmSBA87Q.png" /><figcaption>So yeah, this is how I was starting to feel, except minus four arms and everything piled on top of me, instead of being expertly juggled.</figcaption></figure><p>At this new company, I found myself in the strange position of being the lone Flash (and later, lone OSS) developer at a mainly Microsoft-based development shop. While I got to do a lot of design work at this company as well, my duties once again included supporting the various websites the company relied on, as well as doing a lot of application architecture and UX engineering… basically, if there was a job the company was offered that did not require a certified C# or SQL-Server engineer, the job fell to me. I continued to learn all I could, from all the sources available to me, but it was still pretty aimless… I was starting to get really perturbed by the thought that, despite all the experience I was getting, I’d always be in a position where I’d be a jack-of-all-trades, and a master of none. I decided to deep-dive into Ruby development, as Ruby’s syntax had always appealed to me, and its package ecosystem was pretty mature. I landed a gig building a Ruby application for a logistics company that supported the oil industry, again doubling my salary. Wow, this is working out great, I again thought… and it did, until the bottom fell out of the oil industry a short while later, and the project was cancelled.</p><p>Once again, I was out of work, but that didn’t last for long. Over the course of the past decade, I’d garnered enough experience to finally be seriously considered for an awesome position with the company with which I’m currently employed. I now work from home, I write Ruby, SQL, and Javascript code all day, and make good money for it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*uNXfPI_VKFmwIFUbxUtsWA.jpeg" /><figcaption>Ok, yeah. Here it is…</figcaption></figure><p>The story I’ve just shared, while it seems long-winded, is actually the short version. I told you all that, so I could tell you this… the long, rough, winding road I undertook to get where I am today could have, for the most part, been avoided, if only I’d had someone to guide me down the right path. A mentor. Someone who’d already established themselves, and knew what it would take for me to get where they are. When I first discovered Vets Who Code, I was immediately impressed with their program, and wanted to contribute in any way possible. Here was a community that, by assigning established mentors to veterans who were just starting out in the industry, was able to impart years worth of the right knowledge in months, and allow fledgling developers to achieve what it had taken me over a decade to do on my own. The difference having a mentor makes is obvious to one who’s made his way without one. While coming up, I had no one to warn me of dubious employers or poorly-defined positions, or even what a fair wage was for a developer. I had no one to point me at the tech which would best serve me when looking for work, or the best-practices and tools which I’d need to work with that tech. Even what I’d learned through nearly completing a computer science degree had not prepared me for the realities of the business, nor had it given me any sense of direction. I had the basic knowledge, but no focus. The VWC program provides our troops (at no cost to them, aside from the work we expect them to put in) all that I was missing… real-life experience with the industry-standard tools and tech of the trade, and the guidance to parlay those skills into a well-paying position. While most paid coding boot-camps will give you the knowledge, few of them will give you the community, and the guidance. To me, that’s where our program really provides its value. Had this program existed when I first began my journey, I have no doubt my career path would have been radically different. I’ve watched graduates of the program score gigs I would have killed for when starting out, and some I’m a little envious of now, if I’m being perfectly honest. As a mentor in the program, I’m damned proud of all of our troops and their continued success, and strongly encourage any vet interested in becoming a developer to give the program a shot. And if you’re reading this and are already established in the industry, I invite you to volunteer as a mentor… help make a fellow vets’ path to success that much easier; the road they have ahead of them is tough enough as it is.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9863df014b68" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vets-who-code/a-career-without-a-mentor-and-why-i-wish-id-had-one-9863df014b68">A career without a mentor, and why I wish I’d had one.</a> was originally published in <a href="https://medium.com/vets-who-code">The SitRep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Skin a Cat: FizzBuzz in Five Languages]]></title>
            <link>https://medium.com/quick-code/how-to-skin-a-cat-fizzbuzz-5-ways-dc4ec811bfcb?source=rss-804320492465------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc4ec811bfcb</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[clojure]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Eddie Prislac]]></dc:creator>
            <pubDate>Fri, 22 Feb 2019 09:00:00 GMT</pubDate>
            <atom:updated>2019-05-02T00:05:52.244Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sHQ-D0vPP4eiGuItt5yEHg.jpeg" /><figcaption>SKINAWHUTNOW?</figcaption></figure><p><strong>— UPDATE</strong>:<em> Due to some helpful suggestions in the comments, I’ve revised this article from the original version I published, so if you’re seeing this for the second time, don’t be surprised if it reads slightly differently. It’s also why I changed the name from ‘FizzBuzz 5 ways’ , to ‘FizzBuzz in Five Languages’, as there are WAAAAY more code examples than I had, previously. Also, more cat jokes and references, so there’s that.</em></p><p>FizzBuzz is a first-year computing problem many of us have faced. The rules are pretty simple: Given an integer, if the integer is a multiple of three, return ‘Fizz’, if the integer is a multiple of five, return ‘Buzz’, if a multiple of both three and five, return ‘FizzBuzz’, and if it’s not a multiple of either, return an empty string. Most folks’ go-to in this situation is to whip out a simple if/else conditional, but honestly, that’s kid-stuff. To make this a bit more difficult, today, we’ll be trying to accomplish this seemingly easy task using as few conditional statements as possible. To make matters even more difficult, we’re gonna do it in five very different languages (and that’s where this article gets its name… “There’s more than one way to skin a cat… get it?)</p><blockquote>Eddie, you’re a madman, that’s crazy talk!<br>~ you.</blockquote><p>We’ll see.</p><h3><strong>Javascript</strong></h3><p>The first language we’ll start out with is the one that most beginning developers will be familiar with: Javascript.<br>Javascript is so ubiquitous in the world of software development these days, that if someone says “I’m a programmer’, it’s more likely they write JS than any other language. The explosion of popularity in what used to be derided by ‘real programmers’ as a ‘scripting language’ can be ascribed to the advent of node.js and its npm ecosystem of libraries. Nowadays, you’d be hard-pressed to find a type of program you couldn’t write in Javascript. While in the past, it was limited to crafting cheesy animations and simple interactivity on web pages, JS can now be utilized to write entire UI frameworks, network servers, real-time chat applications, even automation and/or robotics controllers, such as those created with the <a href="https://www.raspberrypi.org/">Raspberry pi</a>.</p><p>Before you say anything, I’ll be deliberately omitting type checking and error handling, just in case any of you are in school and are thinking this article is going to be a good way to cheat.</p><p>The most basic code for accomplishing FizzBuzz in JS goes like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cfbc34a21beff96fbf135546630e8e8f/href">https://medium.com/media/cfbc34a21beff96fbf135546630e8e8f/href</a></iframe><p>First, a few explanations:<br>1. If you’re just starting out, you may be wondering what that % operator is doing… that doesn’t actually mean ‘percent’. The % is the modulus operator, and modulus is a function we’re going to make a lot of use of in this article. Modulus is the function used when you want to find the remainder of dividing one number by another. In this case, we want to check if the number is cleanly divisible by 3, 5 or both, so we check if the number mod 3 or 5 is equal to zero.</p><p>2. No, you’re not seeing triple, those triple-equals signs are the way we check equivalence in JS. Most languages use a double-equals to check equivalence, and a single-equals for variable assignment (ex: let x = &quot;foo&quot;). In JS, the double-equals is used as well, but not as commonly, as the ==operator allows for type coersion; in other words, a string value of &#39;1&#39;would evaluate to be equivalent to a number value of 1. That’s useful if you’re yanking the innerHTML of a tag to compare to a number in your script, but generally ill-advised. The === operator is a strict equivalence comparison, meaning &#39;1&#39; === 1 would evaluate to false.</p><p>3. The double-ampersand ( &amp;&amp;)in that third conditional branch is a logical AND , but we won’t be using it again for the remainder of this article, so this will be the last time I mention it.</p><p>This code will run reasonably well, and do what it’s supposed to do. However, it can also be written like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/986b28dc232f0c7078cdcd1b939d4229/href">https://medium.com/media/986b28dc232f0c7078cdcd1b939d4229/href</a></iframe><p>In this snippet, the code is a lot cleaner-looking. Unfortunately, because we need to instantiate Object twice, it runs about 82% slower than the first example. If it’s slower, why would I even bother showing it to you, you might ask? Well, performance was not the point of this demonstration, but since you asked, consider the results from <a href="https://jsperf.com/switch-case-vs-if-else/13">this test</a>, in which I compare the results of using an Object map vs if/else, vs case/switch (I’m using Chrome — between Chrome, Edge and Opera, which all use the ‘Blink’ rendering engine, you have an overwhelming share of the browser marketplace — The browsers that handle Object mapping slower than conditionals, (Firefox, Safari and IE) when combined, only comprise a little over a quarter of the marketplace, by comparison). In a case where you need to compare static results, tables have turned, and Object mapping is now 80% faster than if/else, and narrowly beats out even switch/case. Why the flip? In this case, if/else is the one which needs to run comparisons every time the operation is run, whereas the object is being used as a binary search tree… it’s only taking the sum and looking up the key in its structure. This is why it’s sometimes much, much faster to utilize this type of structure than iterating over load of conditionals.</p><p><strong>— EDIT:</strong> <em>I knew when I was writing this that there had to be a better way, and commenter Paul B. was kind enough to point out that there’s a much simpler, and way more elegant solution — string interpolation:</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e881b893b5a1a4c0856f2b1287a765dd/href">https://medium.com/media/e881b893b5a1a4c0856f2b1287a765dd/href</a></iframe><p>In this example, we’re making use of a string literal to interpolate the results of the modulus calculations directly into the string, thus shaving away the operation down to its barest essentials, and doing away with the Object entirely . This functionality was introduced as part of ES2015, along with the ‘fat-arrow’ function notation I’m using in my examples. True, it goes against the original point of the article by still relying on conditionals, however, this is WAAAY faster and cleaner than both the Object map method and if/else.</p><p>Don’t see the conditional? Look a little closer…</p><p>Can you spot it? It’s this:</p><pre>num % 3 === 0 ? &#39;Fizz&#39; : &#39;&#39;;</pre><p>That’s a <strong>ternary operator</strong>. Most modern languages support them. What’s going on here is that we’re returning ‘Fizz’ if the condition before the question mark evaluates to ‘true’, else returning an empty string. The question is shorthand for if and the colon for else. This is what’s coined in the biz as a bit of ‘syntactic sugar’.</p><h3><strong>Python</strong></h3><p>Going back to the key/value pairs method, let’s try it out in Python:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ead9030d24e6d6f68bf11c3096f91c95/href">https://medium.com/media/ead9030d24e6d6f68bf11c3096f91c95/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*TmwjhHeBOr1TNde_UbVMFQ.png" /><figcaption>Python is kinda fun. (Image courtesy of <a href="https://www.xkcd.com/353/">https://www.xkcd.com/353/</a>)</figcaption></figure><p>In Python, we see that we can again use a reduce function, and a lot of the parts can almost be recognized from the JS version we looked at previously, even though the syntax has changed greatly. Here, we’re using a lambda list comprehension to reduce the keys to a single string. Also, in Python, whitespace is important… this is why I’ve used four spaces to indent my code instead of two, like in the rest of my examples — in many other languages, whitespace is a nicety, but screw it up, and it’s no big deal. Not so in Python, if your formatting’s off even a little, it causes big problems for your code. (As commentor nleamba pointed out, you can technically use two spaces instead of four for indentation in Python, but the recommended spacing from their own <a href="https://www.python.org/dev/peps/pep-0008/#indentation">API documentation</a> is four.)</p><p>My Python example is less code than the JS version, but I couldn’t quite get away from using that ifstatement, even if it’s in a guard clause, rather than a standard conditional. Also notice the double-equals used to determine equivalence in our modulus checkers — the === does not exist in Python, but that’s the norm, and JS is really the exception, as we’ll see in the rest of our examples…</p><p>Paul B’s suggestion got me to thinking… could I use string interpolation to shave some strokes off of my code-golfing game for the rest of my examples? As of Python 3.6, we can, with the f function. However, Python’s ternary is worded as a guard clause, rather than using the x ? y :z format we see in JS, meaning we’re falling back on if/else statements:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c60803dd364ba54e97fb86ae1af479bf/href">https://medium.com/media/c60803dd364ba54e97fb86ae1af479bf/href</a></iframe><p>Python does give us a shorthand ternary that we can use to avoid if/else as well…:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e08ecac97fdaf0aee6cc01d188853700/href">https://medium.com/media/e08ecac97fdaf0aee6cc01d188853700/href</a></iframe><p>… however, the shorthand version is not recommended by most Pythonistas, as it is not as ‘pythony’ as most would like. In the shorthand, we’re using tuples (a Python datatype for defining pairs of vars) to define our results, and placing the condition in brackets after the return values. It’s kind of like Shrödinger’s cat… the tuple is your return and exists in a state of both true and false until observed by the conditional behind it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*4IcXrTH0iAibEJDccqjmKg.jpeg" /><figcaption>Hooray! Sciency cat joke!</figcaption></figure><p>The ‘false’ return in the ternary shorthand tuple is defined first, which is a bit confusing, as most folks tend to think in terms of ‘true or false’ rather than ‘false or true’. Also, the shorthand version runs the evaluation for both of the values in the tuple, meaning that the condition will be run twice, no matter what. The if/else structured ternary follows standard if/else logic, and does not suffer from the same problem. (refer <a href="http://book.pythontips.com/en/latest/ternary_operators.html">here</a> for more details)</p><h3>C++</h3><p>Remember how, in our first Python example, we had to import the reduce statement? Kinda reminds me of C++… In fact, let’s consider C++:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb4b6f6657efbbe298ecdc32f5c398eb/href">https://medium.com/media/bb4b6f6657efbbe298ecdc32f5c398eb/href</a></iframe><p>HOKEY-SMOKES, BULLWINKLE, that’s a lot of code!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*gzcMTYu8No4Q-1av5H4rag.png" /><figcaption>Wouldn’t it be more thematic to say, ‘HOLY CATS!’?</figcaption></figure><p>Of course, I did have to add an entry point (int main() ) with operations to accept input and output the results, (cin and cout) because C++ is a compiled language. JS and Python, are interpreted languages, and can call their functions at runtime without any prep, but as I needed to be able to run the C++ code as a shell script, it was either do it this way, or script in a way to take the number param from the command-line (sorry, I just didn’t feel like it, it’s already a buttload longer without doing that). You’ll notice that even though the syntax looks similar to JS with the parentheses wrapping the params and braces surrounding the methods, we need to do something else in C++, and that’s define the types, not only for each variable we’re using, but also for the return values of each method. We also don’t get quite the easiest way of defining our key/value pair list, which here is called a map. In C++, a vector takes the place of an Array, and we need to set the maximum size of the vector when defining it. This is because C++ forces you to pay a lot closer attention to the memory being used by your program. This is also the reason we need to include the libraries for each of the datatypes we want to use in the program up at the top of the file, because C++ will only include the bare minimum it needs to compile. We also declared a namespace: std. This is because all the libraries we’ve included come from the ‘standard’ library, and if we don’t declare the namespace, we end up writing out std. in front of every declaration of a variable that uses those types. If we’d wanted, we probably could’ve written the same program in C++ using same algorithm as in our first JS example, and it would’ve looked very similar, but still would’ve required a bit more setup and code. JS and Python are both dynamically typed, meaning they infer the type of the variable from the data that’s assigned to the variable. C++ on the other hand, will throw an error if you try to assign a string to a variable which you’ve defined as an int. One final note is that hard as I try, I couldn’t get away from having at least one conditional statement, that ternary operator I mentioned previously in the JS segment.</p><p>But can C++ interpolate, Bro?</p><p>Short answer? No.</p><p>However, I wasn’t about to let that stop me from coming up with something better than that Lovecraftian behemoth I’d originally written, so I did some digging. There are libraries you can add to C++, such as <a href="https://www.boost.org/">Boost</a>, which include string formatting, but from what I’ve read, including Boost libs tend to slow down your compile-time, and I didn’t want that. I’d rather figure out a way to do it using the standard library, and eventually, I found a way…</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b6a19f7f132c2c881fdb8dda7f73f56b/href">https://medium.com/media/b6a19f7f132c2c881fdb8dda7f73f56b/href</a></iframe><p>In this example, I included the sstreamheader, which allows us to use a basic stringstream to build the string we want to return. Doing this, we can reduce the total lines of code by about half. Still not as pretty as our other languages, but hey, it’s better than it was before.</p><p>OK, that’s enough about C++ for now, I need a palate-cleanser. Let’s move on to Clojure.</p><h3>Clojure</h3><p>Clojure is a functional language, a dialect of Common Lisp that can be run in the JVM, and can utilize Java libraries. We won’t be getting into any of that Java stuff for now, because we really don’t need it for this example. Be prepared, though, even though Clojure provides us with what was originally the shortest example in this list, and it’s also one of the weirdest-looking:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae7ad52e34435d127e7ede28b087f940/href">https://medium.com/media/ae7ad52e34435d127e7ede28b087f940/href</a></iframe><p>Yep, excluding the functions’ name, that whole method is only two lines of code, but what the hell is going on?<br>The first thing is that the entire thing gets wrapped in a set of parentheses, (Clojure is pronounced ‘closure’, after all…), and our function declaration starts off with a defnstatement. Also notice that the param we’ll be inputting ( num ) is wrapped in brackets instead of parens. The other things you should notice is our tblvar is defined with a def statement, and that there are no colons separating the keys from the values. And how about those values? In Clojure, rather that using a % operator, we get the modulus using the mod function, and it comes before the two params… rather that writing num % 3 == 0 , we’re writing mod num 3, which will result in 0. Why are we doing it differently than the other examples? Well, in the list comprehension we’re using to filter down the values, you’ll see that we’re using the comp(compare) function to compare the values to zero. If you squint really hard, that function should remind you a little of the last line of our Python example… the syntax may be different, but the structure of the line is very similar.</p><p>In keeping with my other revisions, here’s an example in Clojure using only one line to build a string:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e00606fa93a87e176bf62757548eb696/href">https://medium.com/media/e00606fa93a87e176bf62757548eb696/href</a></iframe><p>Here, we make use of Clojures’ str function to build a string, and the when conditional, which will only return a value when its condition is met.</p><h3>Ruby</h3><p>My final examples come from Ruby. Ruby makes me smile, because it allows us to do something really clever. See if you can spot it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/68f72e47326959accddf98ad0408c284/href">https://medium.com/media/68f72e47326959accddf98ad0408c284/href</a></iframe><p>Hey, you may say, that doesn’t look so special… it’s longer than all but the C++ versions of this method, but otherwise doesn’t look all that different from the JS ver… wait what… whaaaaa? What’s that class definition doing there? Where’s your num param? What’s that call to self? WHAT DID YOU DO???!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*HCpV0h9_-Xug4IJl0Sk4pw.jpeg" /><figcaption>I iz skurd.</figcaption></figure><p>Ruby, while also an interpreted, dynamically typed language like JS and Python, and object oriented like C++, allows us a few liberties we can’t really take all that easily in other languages. One of those is the ability to re-open any class and add methods to its definition. In this example, I’ve reopened the Integer class and added the fizzbuzziness method directly to it. This allows the method to be called directly on the number we want to get the ‘fizzbuzziness’ of, rather than calling the method with the number as a param (ex: 5.fizzbuzziness instead of fizzbuzziness(5)). Why in Gods name would you want to reopen a core class of the language and add methods to it? Isn’t that dangerous? Kinda, yeah. You really shouldn’t do it all that often, as methods you add may collide with methods that get added to the standard Ruby library later on, and this could result in massive code-breakages for your application. There’s also the possibility that you could overwrite any method in the class, and end up with something completely nonsensical, like so:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/536e67e8ec422b60ae0b6002882c2884/href">https://medium.com/media/536e67e8ec422b60ae0b6002882c2884/href</a></iframe><p>It’s for this express reason that, even though similar behavior is possible by modifying a class’ prototype in Javascript, they tell you in big, all-uppercase, shouty letters in their API documentation that you should NEVER EVER do it with a standard library class. However… in Ruby, if you have a method like mine that isn’t likely to get added to the standard library, it can be extremely useful as well, as it helps your application adhere to the principle of ‘<a href="https://www.martinfowler.com/bliki/TellDontAsk.html">tell, don’t ask</a>’ in a way that’s more idiomatic to Ruby programming.</p><p>We can also do it with string interpolation and ternary operators, like so:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b164abb240491cab6a22a8bfe9fd84f4/href">https://medium.com/media/b164abb240491cab6a22a8bfe9fd84f4/href</a></iframe><p>And so, oh my droogies, we come to the end of the article. Different programming languages, different methods, same result. A first-year coding problem, beaten within an inch of its life with a meat tenderizer and examined under a microscope. You may not enjoy digging around in different languages to compare how they work as much as I do, but I hope you had as much fun reading this article as I had researching and writing it. Until next time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc4ec811bfcb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/quick-code/how-to-skin-a-cat-fizzbuzz-5-ways-dc4ec811bfcb">How to Skin a Cat: FizzBuzz in Five Languages</a> was originally published in <a href="https://medium.com/quick-code">Quick Code</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Neatness counts: A beginner’s guide to why style matters in programming]]></title>
            <link>https://medium.com/vets-who-code/neatness-counts-a-beginners-guide-to-why-style-matters-in-programming-6eee3a1d0190?source=rss-804320492465------2</link>
            <guid isPermaLink="false">https://medium.com/p/6eee3a1d0190</guid>
            <category><![CDATA[code-style]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Eddie Prislac]]></dc:creator>
            <pubDate>Fri, 15 Feb 2019 06:31:16 GMT</pubDate>
            <atom:updated>2019-02-15T16:09:44.506Z</atom:updated>
            <content:encoded><![CDATA[<h3>Neatness Counts: A beginner’s guide to why style matters in programming</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kuEe-DeRjttWiRqF5kyICg.png" /><figcaption>Does this remind you of your code? Here are some helpful tips to help you avoid weaving a time-wasting nightmare.</figcaption></figure><p>I’ve always been a person who’s valued creative expression, someone who colored outside the lines. I was never one to follow MLA format when writing essays in school, and in fact, gave up on using more than one case in my handwriting (I began to print in all uppercase in my Sophomore year in high school, before it seemed all shouty to everyone else with the advent of texting, and have retained the habit to this day). I loved the crazy, cut-and-paste style of William Burroughs novels. And yet, as a software developer, nothing irritates me more than poorly formatted, undocumented code. How did it come to this?</p><p>Easily, as it turns out.</p><p>You see, writing for entertainment, or even educational purposes is very<br>different from writing code; Unless you’re working solo on a project (and God<br>help you, if you are, you poor, brave soul), other devs are eventually going to<br>need to pore over your code, and they’re going to need to be able to understand what you’ve written. No matter how clear your code may appear to you, or how well it works, if you’re writing paragraph-length functions that run off the side of the page, you’re not going to gain many fans among your peers. If your variables are oddly-named and you’ve left your code undocumented, anyone maintaining your code is likely to get lost, spending hours or maybe even days trying to navigate the functions you’ve written. This can not only frustrate your team, but also increase the cost of developing new features and fixing bugs in valuable man-hours, which your business product team will eventually translate into real-world dollars. A nebulous legacy code-base is one of the top time-wasters on any long-running project, and writing code that is clean, easy-to-read, and most importantly, easily-maintainable, will go a long way to avoiding the mounting tech-debt that poorly-written code inevitably causes.</p><ol><li><strong>Line-Length</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*_CKWFT9hM2Tt6LIvu8Hceg.png" /></figure><p>In ye olden days of coding, <a href="https://en.wikipedia.org/wiki/Punched_card#IBM_80-column_punched_card_formats_and_character_codes">punch-cards were limited to 80 characters per-line</a>.<br>Even after terminals began to be used, screen-size was severely limited compared to what we’re used to today, so the 80-character limit imposed by punch-cards continued to be honored. However, with modern screens allowing upwards of 5K resolution, one might be tempted to take advantage of the entire screen width. Why is this a bad idea? Firstly, it’s common practice for many devs to keep more than one editor pane open on their screen, in order to perform side-by-side comparison while writing code. Exceeding the time-honored 80-char tradition often will force these devs to scroll side-to-side or wrap text in order to view the entire line. Limiting line-length also gives devs extra space to perform actions like git blamein-editor. However, these are merely matters of convenience, and the biggest reason for limiting your line-length is much more important. You see, <a href="https://baymard.com/blog/line-length-readability">typographical research into line readability</a> tells us that the optimal line-length for human reading comprehension lies within the range of 60–75 characters, with comprehension severely dropping past that length. This is also the reason why <a href="https://www.quora.com/What-is-the-reason-for-multi-column-layout-in-magazines-and-newspapers">magazines, newspapers, and even e-book readers will split their columns</a>.<br>Although coding languages often set optimal line-lengths at <a href="https://en.wikipedia.org/wiki/Characters_per_line/In_programming">different lengths</a>,<br>many set their max-line-length at the traditional 80 characters. To paraphrase<br>Jack Sparrow, this is more of a guideline than an actual rule, and you’re usually safe to go even up to 100 characters, but exceeding the limit should be done sparingly, and not without good reason. Myself, I set two guides in my editors, one to 80 characters and one to 100, treating the space in-between as a sort of ‘danger-zone’, and if I find myself straying too far beyond the 80-character limit, if I can’t justify the extra length, I’ll take the extra time to<br>re-arrange my text into a more readable format. This even extends to non-code writing… even now, as I’m writing this article in a full-screen-width vim<br>window, I’m forcing myself to adhere to the same rules I set down for myself<br>while writing code, and have very few lines where I’m exceeding 80 characters, and only exceeding 100 when absolutely necessary (usually when defining linked text).</p><p><strong>2. Method/Function Length</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*tA9pD-5On_iP3jGjJZZJ_A.png" /></figure><p>The reasons for method/function-length limits are related to the reasons one<br>would set line-length restrictions, insofar as the length of a function can<br>affect one’s comprehension while reading the code, but there’s also a technical reason. When defining a function, one wants to adhere to good design practices, and the <a href="https://en.wikipedia.org/wiki/Single_responsibility_principle">single-responsibility principle</a> states that a function should only be responsible for a single part of the functionality provided by your software. How does that translate to method-length? The longer your method/function is, the more likely additional functionality is creeping into that method, making it all the more difficult to debug and/or write proper unit tests for that method. What defines a manageable method/function length will vary from language to language; in javascript, many devs will set the max function-length between 16–25 lines, whereas ruby devs will more commonly stick to methods with a maximum of 10 lines (with some even<br>stating that your methods should be no more than 5 lines, max, and as a<br>primarily ruby developer, I often get the feeling when looking at javascript<br>functions that I’m reading a big collection of run-on sentences). When you begin to exceed your maximum method-length, it’s usually a good indicator that you should step back and put some serious consideration into refactoring. If you’ve written a function that you need to do any scrolling to read in its entirety, it’s definitely a sign you’re doing something wrong.</p><p><strong>3. Class/File length</strong><br>More related to the modularity of your code than anything else, an overly-long class or file-length is often an indicator that you’re attempting to stuff too<br>much functionality into your class. An overly long class can also make debugging and maintenance difficult, as you’ll find yourself scrolling all over the place to find the location of whatever specific line of code you’re attempting to change. The maximum file/class length will again vary between languages (with many java devs arguing that there is NO upper-limit to class length), however, another factor to take into consideration is your system limitations (or, more likely, your peers’ system limitations). A larger file will take longer to load into a code editor, and keeping many large files open can be taxing on certain systems. This becomes particularly important if there’s a chance you may end up editing code for your application from a remote machine. I like keeping my maximum file-size to around 200 lines, but ultimately, this metric is going to be up to your team to decide.</p><p><strong>4. Indentation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*-xD77ULjNPo84ullru4C4Q.gif" /><figcaption>WRONG, WRONG, WRONG.</figcaption></figure><p>If you want to start an argument in a large group of developers, there’s often<br>no better way than to bring up indentation. Wherever your team falls on the old “tabs vs. spaces” debate (I’m no exception here, if you say tabs, you are WRONG), a consistent indentation style is crucial to the legibility of your codebase. In certain languages (CoffeeScript and Python immediately come to mind), improper indentation will, in fact, render code unable to build or function. Again, the style of indentation you end up settling on will vary from language to language (and sometimes from project to project), but the most important thing to consider (at least, in languages whose functionality does not depend on a certain style) is consistency… inconsistent indentation makes it difficult to tell when a code-block begins or ends, and at the very least, tends to make your code look really sloppy. You and your team should decide early-on which indentation style to use, and stick to it, and if you’re joining a team with an existing codebase, discovering what indentation style your team uses should be one of the first tasks you undertake.</p><p><strong>5. Whitespace</strong><br>Have you ever read a block of text that just seemed to go on and on? Chances are your attention started to drift, and you may have even needed to go back and re-read segments of the paragraph, as new bits of information get pushed out of your fallible, non-computerized human memory. It’s common among all programming languages to separate functions with a single blank line; less commonly, blank lines are also used in many languages (such as Javascript) to break up code within functions into logical chunks. Whitespace should be used judiciously, however, as some languages will not compile properly with improper whitespace, while others will ignore it completely.</p><p><strong>6. Documentation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*pOovwYG2BVk_swp3RbthQA.png" /></figure><p>Another hotly-debated topic amongst developers, many programmers (especially when fresh out of college) will argue that in-code doc-comments only serve to diminish code legibility, and that your functions should be ‘self-documenting’, or that ‘your tests should be your documentation’. While there is some truth in these statements, (and in fact, self-documenting code is something we should always strive for), the reality of the situation is that code which appears to be self-documenting and perfectly understandable to you, may be incredibly hard for the next dev to touch your code to comprehend. Additionally, your specs may not adequately describe your code, or may need to address so many edge-cases as to make comprehension of your code’s functionality far from easy. A well-written doc-comment in a format such as YARD for ruby, or JSDoc for javascript, can go a long way towards allowing other devs to understand your codes underlying purpose. I’ve worked on teams where this was not only recommended, but required, and would often be told to go back and document my code if I tried to submit a pull-request that omitted documentation. This is so important, that some editors, such as Microsoft Visual Studio, will actually help you out by adding in a doc-comment skeleton to your methods/functions by default. As necessary as<br>documentation is, overly-documented code can also be a problem, as yes, it will affect code legibility. Inline comments, as opposed to doc-comments, should be avoided… if you find it necessary to include such comments in your code to explain what you’ve done in a particular line or function call, it’s usually a sign that your code is becoming too convoluted, and again becoming a candidate for refactoring.</p><p><strong>7. Function/Variable/Class Naming</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*LjlMmvTR00AV1Bml-aHxWg.png" /><figcaption>courtesy of <a href="http://geek-and-poke.com/">http://geek-and-poke.com/</a></figcaption></figure><p>With so many coding tutorials where we’re presented with variable names like<br>`foo` and `bar` (not to be confused with FUBAR, if you’ve read my previous<br>article on <a href="https://medium.com/vets-who-code/keep-calm-and-bohica-military-acronyms-applied-to-software-development-ba77b2fc0927">military acronyms applied to software development</a>) you might be forgiven for thinking that variable naming doesn’t matter. You’d be wrong, but it’s be forgivable. The truth is that good variable naming is fundamental to writing good code. The reason boils down to the two things we’ve been talking about this entire article: legibility and comprehensibility. It’s really a no-brainer, when you think about it. The name of a variable, function, or class is essentially meta-data that’s telling the developer the objects’ purpose. Providing meaningful data when naming your variables and functions is absolutely essential, and it’s something you should take seriously. A name should not be overly dependent on abbreviations, yet should not be descriptive to the point where line-length begins to become an issue. Also, and this is one point even I struggle with, you should not make attempts at humor with your naming. All it takes is one dev who doesn’t get the reference to throw extra man-hours down the drain, as your maintainer struggles to understand that reference to an obscure 90’s movie that you and maybe a few<br>other members of your team might have found hilarious when you were writing it. Variable naming should tell a story, so it’s imperative that you tell the right story.</p><p><strong>Final Notes: Tooling</strong><br>I could honestly write an entire article on each of these seven points I’ve<br>covered here (and probably will), that’s how much I believe in the importance of a rigorous adherence to a well-defined style-guide while programming. As I once heard and have often repeated, one should always write code as if the next person to maintain it is one frustration away from snapping and going on a psychopathic rampage, and that person knows where you live. The good news is, you don’t always need to keep all this info in your head when you’re<br>writing your own code. There are plenty of automated tools available to help you stay on the right path to writing clean, maintainable code, and to do them<br>justice, they’ll most likely be getting their own articles as well. For ruby, I recommend rubocop for code-style linting, and YARD for documentation, and for JS, esLint and JSDoc… all of which can be configured to best suit your teams’ chosen code-style, as well as run from your editor of choice and on whichever CI platform you run. Beyond that, there are code-quality linters, which analyze your code using various metrics to help you eliminate code-smells that go beyond mere stylistic issues, but those are also a story for another day. What I hope to have given you today is a starting-point upon which to develop your own appreciation for clean, well-styled, easily understood code, and hope you’ll take the beginnings I’ve given you to build up a well-polished code-style of your own.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6eee3a1d0190" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vets-who-code/neatness-counts-a-beginners-guide-to-why-style-matters-in-programming-6eee3a1d0190">Neatness counts: A beginner’s guide to why style matters in programming</a> was originally published in <a href="https://medium.com/vets-who-code">The SitRep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Keep calm and BOHICA: Military acronyms applied to software development]]></title>
            <link>https://medium.com/vets-who-code/keep-calm-and-bohica-military-acronyms-applied-to-software-development-ba77b2fc0927?source=rss-804320492465------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba77b2fc0927</guid>
            <category><![CDATA[military]]></category>
            <category><![CDATA[acronyms]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Eddie Prislac]]></dc:creator>
            <pubDate>Wed, 06 Feb 2019 10:58:34 GMT</pubDate>
            <atom:updated>2019-02-06T15:34:07.208Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fWnPrq5Z_m60ynDuUCfhVA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*JqhZHSHNrD493aJ9y3VM9Q.jpeg" /></figure><p>In my newest role in Vets Who Code, I’ve been tasked with guiding and motivating our applicants with completing their pre-work; small reading and rudimentary coding assignments to give us an indication of how serious the applicant is to complete the program. As we’re an all-volunteer organization, this is important, as it allows us to weed out the non-hackers (a phrase, which in this case means one who ‘just can’t hack it’, and not someone who lacks the capabilities of a ‘L33t H@x0r’), and concentrate our energies on those who can. I begin each of my Facebook posts to the group with “Howdy, FNGs!”, and jokingly refer to myself as the ‘Head FNG Wrangler’; FNG being a term familiar to most veterans, but esoteric to those not in the know. We do love us some acronyms in the military, but they often appear to be a second, secret language to civilians. It was in explaining this term to my project lead at NBC that I got the idea for this article, in which I’ll be trying to correlate certain military acronyms to a context relevant to the software development industry. Fittingly, I’ll be starting with ‘FNG’.</p><p>(A warning to those with virgin eyes, ya’ll may want to move on to something else right now… it’s long been my stance that veterans have a right to swear anywhere they choose, and that I’m pretty sure it’s one of our official benefits. These are actual military acronyms, and honestly, dirty words are the last thing most folks in the military worry about, choosing instead to concern themselves with not getting shot or blown up, and ensuring that if it’s entirely necessary that someone does need to be shot or blown up, it happens to someone on the other side. At any rate, as someone who swore an oath to uphold the Constitution of the United States and all the freedoms it guarantees, censorship just gives me the red-ass, so I won’t be censoring myself here. Now that that’s out of the way…)</p><p><a href="https://en.wiktionary.org/wiki/FNG"><strong>FNG</strong></a><strong>: Fucking New Guy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/1*Dcrz5eYaOgCUU73K1N5BRA.jpeg" /></figure><p>Yes, an F-bomb in the very first acronym. I wasn’t kidding with that warning. Often also referred to as a ‘boot’ (one who has just graduated basic training, or ‘boot camp’), the FNG is one who knows just enough to be given basic tasks, and can also be trusted, as often as not, to screw up those basic tasks. Most of the time, they have the knowledge, but no actual experience. In military terms, this is someone who needs to be shown the ropes and guided through nearly everything they’re given to do, and on a development team, there isn’t much difference. An FNG on a dev team is a new-hire, and even if that person has ten years of development experience and has been hired for a senior developer position, chances are they’re going to be pretty lost when first getting started. They’ll need to be on-boarded, a term which here means to be given basic knowledge of the day-to-day activities and expectations, given access to work with various systems, and given an overview of the codebase, its inner workings, and idiosyncrasies. (On-boarding, interestingly enough, also has origins in military, specifically naval, tradition, as its original use was more literally applied to the process of acclimating a new sailor to his duties on the crew of a ship.) While the term is somewhat derisive, as in the military, it’s important to remember that an FNG is someone who, once they have proven to be competent, will be a valuable asset to your team. An FNG will often have fresh ideas to bring to the group, and recently-learned knowledge that you may not have had time to get up-to-speed with, so do your best to guide them through the basics and listen when they have questions or suggestions. When you’re the FNG on a team, listen to the senior team-members and do your best to learn all you can as quickly as possible, but be wary of anyone who tells you to just go ahead and commit a library update to master branch. This can lead to our next acronym…</p><p><a href="https://en.wikipedia.org/wiki/SNAFU"><strong>SNAFU</strong></a><strong>: Situation Normal/Nominal, All Fucked Up</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IPRfT5UEIMK0vPjAhYyyOA.jpeg" /><figcaption>“Shoot in any direction you want, those bastards won’t get away from us this time!” — General Lewis B. ‘Chesty’ Puller, patron saint of the Marine Corps</figcaption></figure><p>This is one that, due to movies and TV, and even if they don’t know the term is actually an acronym, most civilians will have some degree of familiarity. Originating all the way back in WWII, SNAFU refers to a situation where something has gone horribly, horribly wrong. It’s often used to describe when an operation has gone all <a href="https://en.wikipedia.org/wiki/List_of_military_slang_terms#FUBAR">FUBAR</a>, a term which in this case means ‘Fucked up beyond all recognition’, and is unrelated, as far as I know, to the ‘foo/bar’ terms used in programming tutorials. In the military, this can describe something catastrophic, like walking into an ambush, or something as mundane as trying to maintain normal operations when all your equipment has degraded to the point of uselessness, and you’re unable to get the tools or supplies to carry on in an efficient manner. Again, there are parallels in software development, such as when an FNG introduces a breaking change into a production build. Another, more common example, is when you’re working on a project that’s been around for a good deal of time, and which has legacy code that, for whatever reason, has a bloated, brittle, antiquated and/or unmaintainable codebase, for which your business product team cannot see the value in serious refactoring. Dealing with a SNAFU requires a level head, and an ability to adapt, improvise, and overcome. The important thing is to concentrate on ways to fix the situation, rather than let it devolve into a blame-flinging contest. In the case of the breaking change, determine the origin point of the change, revert to the point directly preceding, cherry-pick anything you need to get the project back up to the point you need it to be, and calmly discuss it in a retro meeting (for my FNGs, a retro meeting is like an AAR (after-action report) for the week or whatever unit of time your team uses to break up your development sprints). For the aging codebase, the solution is a bit more complicated. It’s to your benefit to do some planning and break it down for your business team in terms of value to them… for instance: the spaghetti code that currently exists in your app is hard for developers to navigate through, costing additional man-hours to resolve relatively minor issues that could better be applied to writing new features; when you relate frustrations you’re experiencing as problems which in the end cost the product team more money, they tend to be more amenable to changes you’re likely to suggest. Speaking of planning:</p><p><strong>PPPPPP: Proper Planning Prevents Piss-Poor Performance</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*ROYQiOV2hwq9KFm-mRgrGg.jpeg" /></figure><p>Ok, so this one is more of a mnemonic than a proper acronym. Po-tay-toe, po-tah-toe. Sue me, if this article hasn’t already been taken down due to my use of profanity. In the military, proper planning can mean the difference between life and death, whether it be mapping out a transit route that won’t place you in the middle of a kill-box, or simply ensuring that you’ll be bringing the proper tools and supplies to maintain your equipment, supply your guns with ammo, and keep your troops from starving. In other words, proper planning will help to avoid SNAFU. In software development, the benefits of proper planning would appear to be self-evident. However, those benefits are often overlooked, in favor of just pushing the latest features out the door to your consumers. While the situations that arise in development from skimping on the planning are not usually as life-threatening as in the military (and if you’re designing military or air-traffic-control software, that statement may well be false), proper planning should not be ignored. Requirements which have been poorly defined are the bane of any software developer tasked to fulfill them, and even after they are adequately defined, it pays off for you, as a developer, to adequately define how you will fulfill them before even writing one line of code. Sit down with a pad and paper and sketch out those control-flow diagrams. Make lists of software libraries of which you may make use, and do some research into the APIs, even if you’ve used them in the past. Look into which design patterns may fit the features you’re trying to implement, and which code-smells and anti-patterns which may arise, so you can do your best to avoid them. If you’ve done your planning well enough, your planning style may even evolve into SOP…</p><p><a href="https://en.wikipedia.org/wiki/Standard_operating_procedure"><strong>SOP</strong></a><strong>: Standard Operating Procedure</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*Q8SCAtT44bUTvMWpcfBtwQ.jpeg" /></figure><p>In the Marines, we kept notebooks known as “desktop turnovers”… these were thick binders filled with information that described our day-to-day duties, step-by-step, to ensure that we not only had a reference to utilize to keep us from leaving out any steps, but to also allow any FNG who stepped in to fill our position to do our jobs, as capably as we could. I worked in an armory as a small-arms repair technician, so my turnover described the procedure for keeping proper access and materiel-checkout logs, instructions for proper behavior when standing guard, gauging and calibrating weapons, and conducting daily inventory surveys. It was also SOP to always keep our technical manuals in front of us when repairing and maintaining weapons, as human memory is fallible, and having the instructions out in black-and-white in front of you is the easiest way to avoid making mistakes. On a development project, your SOP will often be defined in a wiki (wiki itself being an acronym for ‘What I Know Is’), and if your project doesn’t have one, start one. NOW. I cannot stress enough how important this kind of detailed documentation can be, even to someone who has worked on their specific project for an extended period of time. This wiki should contain things like lists of software you’ll need to run and develop the project, contribution guidelines, pull-request and peer-review instructions, code-style guidelines, best-practices, code-quality metrics used on the project, and instructions for merging and deploying new code. As for referring to our technical manuals while working, this correlates to keeping API documentation, Stack-Overflow articles, and Google (or your search-engine of choice; I’m a Duck-Duck-Go man, personally) open at all times.</p><p><a href="https://en.wikipedia.org/wiki/List_of_military_slang_terms#BOHICA"><strong>BOHICA</strong></a><strong>: Bend Over, Here It Comes Again</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*T_pKHZrEnAxt_ITLWge7vg.jpeg" /></figure><p>My final term is often nervously uttered by Marines and Soldiers when faced with yet another imminent, unwanted screwing with the proverbial ‘Big Green Weenie’ of their chosen military branch. BOHICA can be utilized to warn others of anything from upcoming police-calls, barracks field-day or ‘health and welfare’ inspections, surprise random urinalysis, or being deployed to a particularly hot theater of war. In software development, BOHICA applies when your business product team tells you that they’ll be speeding up the op-tempo, requesting complicated new features with the potential to break existing features or negatively impact performance, or that they’re planning to conduct performance reviews. A BOHICA moment is usually a precursor to a period of incredible stress, long hours, and general frustration. While BOHICA moments are unavoidable, rather than complaining, remember your training. By following a well-defined SOP and conducting Proper Planning, you’ll be able to avoid SNAFUs and keep your FNGs from panicking, enabling your team to stay on track, and accomplish any mission.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba77b2fc0927" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vets-who-code/keep-calm-and-bohica-military-acronyms-applied-to-software-development-ba77b2fc0927">Keep calm and BOHICA: Military acronyms applied to software development</a> was originally published in <a href="https://medium.com/vets-who-code">The SitRep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mercy Is For The Weak: A guide to proper peer reviews]]></title>
            <link>https://medium.com/vets-who-code/mercy-is-for-the-weak-a-guide-to-proper-peer-reviews-4c9183bcde66?source=rss-804320492465------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c9183bcde66</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[peer-review]]></category>
            <category><![CDATA[code-review]]></category>
            <dc:creator><![CDATA[Eddie Prislac]]></dc:creator>
            <pubDate>Wed, 30 Jan 2019 23:22:11 GMT</pubDate>
            <atom:updated>2019-01-31T17:17:29.736Z</atom:updated>
            <content:encoded><![CDATA[<h3>Mercy Is For The Weak: Best practices for a successful peer-review</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bChXx0vRL3Ef-pb_kEBk8A.jpeg" /></figure><p>Everyone hates to be criticized; this is human nature, and it goes double for developers. It takes a long time to gather the skill-sets required to be successful as a developer, and on the whole, knowing this tends to be quite an ego boost. It’s when those egos get threatened and tempers flare out that code review practices can fall by the wayside, often to the detriment of the project. It’s easy to want to go easy on the people you get along with the most, those who are like-minded individuals who agree with you on the ‘right way of doing things’, and be merciless with those you don’t. This is an entirely wrong-headed way of going about it. We’ve all got this ego-monster living in our heads that screams out “WHAT THE F&amp;#% DO YOU KNOW?” on every line of a peer review. Software development, unlike a lot of creative disciplines, is by nature a team effort — you have many devs with different skill-sets working towards the same goal: delivering working software that meets business expectations. If your project is big enough (and most are), chances are no matter how skilled a developer you are, you need everyone on your team to be able to complete your mission. Learning how to keep the ego-monster in check while your code is under review is probably one of the best skills a dev can acquire. Learning how to write a peer-review that’s merciless while at the same time respecting your colleague as someone who is most likely your equal and quite possibly even your better at some aspects of programming, is another.</p><h4>A brief divergence into personal history</h4><p>It may surprise a lot of folks to learn that my first experiences with peer-review best-practices came not from software engineering, but from art class. During my Junior and Senior years, I was an A.P. Art student at a high-school that had a reputation for students placing in the highest tier in local, state, and national competitions (who knew the art world was so cut-throat?). One of the reasons my schools’ art program was so successful was that we had a system for peer-review which we implemented on a weekly basis. We called it ‘critiquing’, but essentially, it was the same thing; An open discussion on the merits and faults of each student’s current project. Egotistical, self-absorbed punk that I was, I despised these things when we first started. No artist likes a critic, and we were no exception. To an artist, a critic is someone who can’t do what you do, but gets to decide whether what you do is good or bad, and this is a horrible, horrible thing. As my grades were tied to how well I could give and deal with critiques, however, I was forced to play along. At first, we were apprehensive about hurting each other’s feelings (we were artists, after all), and often blew off the critiques as meaningless…</p><blockquote><em>“I like how you made those happy little clouds look so fluffy.”</em></blockquote><blockquote>- a quote from one of my high-school art critiques</blockquote><p>… but as we grew more accustomed to the format, the critiques became more brutal, more demanding. We questioned each brushstroke, each line and choice of color. We demanded justification for every image, why we chose the symbols we chose, and why we chose to represent them in the way that we did. What were we trying to say with the piece. Whether or not it was successful in conveying it’s message. Whether or not the work looked derivative of another artist, or whether the workmanship was not up to par, whether or not we were reaching above our skill-set, or whether we weren’t reaching far enough. Art being a subjective medium, it’s true that the critiques were solely opinion-based, and not really defined by a set of metrics, the true value of them wasn’t in the critiques themselves, but in teaching us the ways that successful people deal with giving and receiving criticism. Like all the best teachers, my instructors were guiding us to think about our work (and the work of others), utilizing many different perspectives, with the ultimate goal of helping us mould each other into better artists. While professional software development is worlds away from being as subjective a discipline as oil-painting, sculpture, or mixed-media collage, the goals behind peer-reviews in both fields are strikingly similar. The methods for conducting a successful peer-review in both fields are also not as different as one might think.</p><h4>10 Best-Practices for a successful peer-review:</h4><p><em>1. First of all, decide with your team on what should matter.</em></p><p>It goes without saying that developers can be a very opinionated bunch. I’ve had long and heated discussions on whether or not to document one’s code; whether commenting helped make the codebase more understandable, or if it cluttered the code and should be scrapped in favor of ‘letting the tests be the documentation’ . Before any peer-review takes place, developers should decide on which metrics should be used to gauge code-quality and style; Otherwise, you’re just setting yourself up for hours and hours of bickering and in-fighting (none of which will be very productive). Metrics for code-style should be based on what your team is most comfortable with — while there are scientific reasons for keeping your line-length to a certain number of characters, the best-practices advised length of 80 characters may not suit the reality of your team’s overall coding style (in PAM/SMS, we compromised at 100 characters, your team’s comfort zone may vary). Other metrics, such as those for code-quality and security, may be more strict (<a href="https://en.wikipedia.org/wiki/Law_of_Demeter">Law of Demeter</a> violations, <a href="https://en.wikipedia.org/wiki/Separation_of_concerns">Separation of Concerns</a>, <a href="https://en.wikipedia.org/wiki/Cyclomatic_complexity">Cyclomatic Complexity</a>, <a href="http://c2.com/cgi/wiki?AbcMetric">Assignment/Branch/Conditional</a> ratios, etc..), as these can affect not only the readability and maintainability of the codebase, but can also introduce harmful side-effects. Inclusion of relevant tests (or updating existing tests), should be a requirement, and a show-stopper for any peer-review. Anti-patterns should also be checked for, and rigorously wiped out.</p><p><em>2. Actually pull and run the code.</em></p><p>I didn’t include this point when I originally wrote this post, but you’d be surprised how many devs will just scan a pr and leave their two cents without ever downloading the branch to run the code locally and make sure it actually does what it says it can. Use your heads, people.</p><p><em>3. You have the tools, use them!</em></p><p>Code metric tools, such as <a href="https://github.com/bbatsov/rubocop">RuboCop</a>, <a href="https://github.com/whitesmith/rubycritic">RubyCritic</a>, and <a href="https://github.com/railsbp/rails_best_practices">Rails-Best-Practices</a>, security scanners such as <a href="http://brakemanscanner.org/">Brakeman</a> and test-coverage tools like <a href="https://github.com/colszowka/simplecov">SimpleCov</a>, are an invaluable resource to any reviewer. Most of these tools can be tweaked to your team’s specifications for acceptable tolerances, an chances are, you’re even using some, if not all, of these sorts of tool in some capacity as part of your continuous integration strategy (we utilize all of the above-referenced tools on our CI server on PAM/SMS). That being the case, it makes perfect sense to run them against code before it’s been merged into develop, to avoid running into issues down the line. Using a code-metric tool in the process of a peer-review can also take a little bit of the personal sting out of a review — it’s a lot easier to take criticism from a tool that uses a set of rules defined by the team than from one of your co-workers. Best of all, once your team has laid out the foundation for what they expect your code to look like, many of these tools can be automated with a tool like <a href="https://github.com/mmozuras/pronto">Pronto</a>, which can run several different code-metric tools against a pull-request before it’s even been read by another set of human eyes. Automated tools should never entirely take the place of human review, however; You or your peer may have a very good reason for doing things the way they did, and the automated tool isn’t going to give the a chance to state their case. They may be entirely wrong about that very good reason, but that should be decided by reasonable discussion, and not by rigid adherence to a standard set of rules.</p><p><em>4. Be merciless and consistent.</em></p><p>Don’t be afraid to call your colleagues out on something you think is wrong, or if they’ve violated the code-quality standards, if you find fault, list it — that’s the entire purpose of doing a pull-request, to get that sort of information. Peer review that isn’t merciless doesn’t really help anyone learn all that much, and sparing someone’s feelings isn’t worth letting bad code-smells into the source. Just as important, though, is to be consistent. If you’re going to call someone out on ‘method too long’, don’t call them out on a fifteen-line block and ignore a twenty-line block elsewhere. Be consistent in how you review your peers on the whole, rather than changing up your review-style for folks you get along with, and especially not for those you don’t. This is where automation in the peer-review process can truly shine. Nothing is more merciless and consistent than a well-written linter or code-metric scanner.</p><p><em>5. Expect/Demand that others do the same to you.</em></p><p>Hey, you’re not perfect either, and deep down you know it. I know as well as anyone that I’m capable of making mistakes. If I wasn’t, I’d have no reason to make a pull-request. They’re not for showing off perfect code, they’re for correcting and learning from your errors, and using what you’ve learned to become a better developer. As fast as the software development industry changes, we can all stand to learn something new on a regular basis, so insist that your colleagues have a go at your code with the same merciless attitude as you exhibit in your own reviews. Mercy is for the weak… you’re not weak, are you?</p><p><em>6. Be relevant, be polite, and back up your arguments.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*JysqryAw14XIE_YiJ7U5OA.jpeg" /></figure><p>This is a best-practice that’s useful in any type of discussion, really. I have an old friend who’s an astro-physicist, and who sits on the opposite side of the political fence from me (I won’t go into details). I cut my teeth on fact-checking and relevance while engaging in lengthy political discussions over social media, as she’d hold my feet to the fire whenever I didn’t provide credible research to back up any claims I’d make. It infuriated me plenty, but it also taught me a valuable lesson that I’ve carried with me into my professional life. The other half of the lesson was keeping in mind that no matter how much we disagreed on something, this was a person I liked, personally, and respected as a highly intelligent individual. The same should hold true in your interactions with your colleagues, while discussing code. Remember, your colleague is not ‘as bad as Hitler’ for wanting to use a design pattern you disagree with, or leaving a binding.pry in their source code, don&#39;t treat them as such.</p><blockquote><em>“Christ people. This is just sh*t..”</em></blockquote><blockquote>Don’t start a review like this. We can’t all be <a href="http://lkml.iu.edu/hypermail/linux/kernel/1510.3/02866.html">Linus Torvalds</a>.</blockquote><p>In a peer-review, backing up your arguments can take several forms, such as providing links to StackOverflow articles or api references, or running performance tests to compare the old and new versions of the code. Providing evidence that validates your argument is always preferable to providing your opinion.</p><p><em>7. Remember, thou art human…</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*M7TTQ3FgXLPmy9-1nAX7eg.jpeg" /></figure><p>We all tend to think we know what’s best when it comes to the codebase on our projects, so it’s difficult, sometimes, to accept the fact that we might be on the losing side of an argument, that our perception of the right way of doing something may be flawed. This swings both ways in a peer-review session — your review may be based on an old notion of best-practices that may be outdated, and the same might be said for code you’ve written. It’s easy to fall into habits, once you’ve found something that works, and it can be hard to let go of those habits. Never let your pre-conceived notions stop you from learning from your peers; Remember, these people, in most cases, passed the same vetting process you had to go through to get your job. They’re most likely not stupid, and you need to respect that. We should all take the discussions in peer-review sessions as an opportunity to learn and grow as developers, no matter which side of the review that we’re on.</p><p><em>8. Wait for at least two devs to approve your pull-request before merging your code.</em></p><p>Waiting for two or more developers on your team review your code not only gives everyone on your team the chance to go over and familiarize themselves with your changes (thus allowing everyone to better understand the system), but also may provide valuable insight that the first dev who reviewed your code may not possess. Everyone tends to specialize in different areas, and may be better at seeing the strengths and weaknesses of a certain piece of code than others.</p><p><em>9. Be timely in responding to pull-requests and peer-reviews.</em></p><p>Pull-Requests and peer-reviews only provide value so long as they’re responded to shortly after being posted — no matter how good the code is that results from a peer-review, business isn’t going to like it if the review process ends up slowing your sprint-cycle down to a crawl. If you’re not punctual in both reviewing and responding to review, you’re not only holding up the process and annoying folks (not to mention needlessly costing business money, which, as I stated before, they won’t be happy with), you’re likely allowing the un-merged code to grow stale, as more and more pull-requests are approved and merged into the codebase.</p><p><em>10. Follow through.</em></p><p>Peer reviews can be a valuable resource for learning, but dissemination of knowledge gained from the peer-review process is important as well. Not all of your team may have participated in any given review due to time-constraints, and valuable information could be slipping through their fingers. Such a loss can lead to other devs making the same mistakes you just corrected through the peer-review process (whichever side you were on). Share the key points of interest in discussions with the rest of your team, and invite others to chime in with any insight they might have, even after the issue is resolved. Chances are you might uncover something that’s been affecting some other part of your application, or insights from other team members that may make you reverse decisions made in peer review. Sharing the info, at the very least, can save everyone valuable time by not having to correct the same mistakes over and over again. Following through also means accepting the value given from the criticism and learning from it, by not making the same mistakes in your own code. There’s no sin in making a mistake, everyone’s capable of that; it’s not learning and adapting from those mistakes that’s a mortal sin for a developer.</p><p>So, just as the goal of our critiques in high-school art class were geared towards making us better artists and improving the quality of our work as a whole, the goal of any peer-review session should be the improvement of the codebase as a whole, and the refinement of all involved into better developers. Big thanks to Karen Fearon-Barr, Susan Sheets, Kathleen Davis, and Dr. Elizabeth Jensen, for lessons learned over the years that I’m still finding value in today.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c9183bcde66" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vets-who-code/mercy-is-for-the-weak-a-guide-to-proper-peer-reviews-4c9183bcde66">Mercy Is For The Weak: A guide to proper peer reviews</a> was originally published in <a href="https://medium.com/vets-who-code">The SitRep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git Branching for beginners]]></title>
            <link>https://medium.com/vets-who-code/git-branching-for-beginners-a0aa98bea330?source=rss-804320492465------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0aa98bea330</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[branching]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Eddie Prislac]]></dc:creator>
            <pubDate>Mon, 28 Jan 2019 08:44:55 GMT</pubDate>
            <atom:updated>2019-01-28T18:08:16.520Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*Q95Cadj1XcbeVxjfQk7fFg.jpeg" /><figcaption>Not this kind of branch.</figcaption></figure><p>If you’ve never dealt with a version control system before, the concept of branching may be entirely foreign to you. In Git, you start off with a “master” branch, which you are entirely able to directly commit all of your work to. However, this is generally not recommended, and if you do this, you’re missing out on a lot of the power a system like Git offers. Especially if you’re planning on collaborating with anyone else, branching will become an important part of your life. If you’re starting your own project from scratch, what you’ll want to do, is create a branch off of your master branch, immediately after your first commit. Call this whatever you like, but conventionally, this should be something like ‘develop’, ‘development’, or simply ‘dev’. If you’re joining a team, this will most likely have already been done before you join. The command to create a new branch goes like this (replace the bracketed text with your branch name):</p><pre>git checkout -b &lt;branch_name&gt;</pre><p>git checkout is ordinarily used to switch branches, but by adding the -b flag, you’re telling Git to create the branch you’re naming.</p><p>When you make a commit to this new branch, it will not be available on the base branch until your new branch has been merged. Change a file on your develop branch, commit your work with the message ‘WIP’ (NEVER actually commit ‘WIP’ to a branch you’re going to share, this is for demonstration purposes only): git commit -m &#39;WIP&#39;.</p><p>When you run the command git log, you should be able to see your new commit along with the commit SHA, and some information about the branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X8fn5n7qyRLGpWrODtW6FQ.png" /><figcaption>Below: `origin/master` denotes the base remote branch (in red), with `master` (in green) being the local base branch. Above: `HEAD` in teal represents the start of the branch, `develop` in green is the local branch name.</figcaption></figure><p>To push your branch up to your remote origin, you’ll want to ensure that the first time you do so, utilize the -u flag to denote which branch you want to track as your remote:</p><pre>git push -u origin &lt;branch_name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gPGgBNWita1IYxEDooBfPQ.png" /><figcaption>Upon successfully pushing to your new remote origin, you should see something like this. Your prompt may not look as cool as mine. I use <a href="https://ohmyz.sh/">Oh My Zsh!</a> to customize it to show the directory I’m in, which branch I’m on, Git branch status, and current (short) commit SHA.</figcaption></figure><p>If you switch back over to your master branch using the command git checkout master, and then check the log using git log, you should see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ubq4hVeWNeMPp4MU8iABg.png" /><figcaption>Note your commit from the develop branch will not show up here.</figcaption></figure><p>To merge your new changes to the master branch, you can use the command:</p><p>git merge &lt;branch_name&gt; , which should give you a result like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3RUVI9pGoH6mghB_3wmpGg.png" /><figcaption>Here, we’re merging `develop` branch into `master`</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bx2TN6ujXnvCdc_ogeM_KQ.png" /><figcaption>`git log` results. Notice the commit from `develop` branch now shows up.</figcaption></figure><p>Notice in the merge screenshot there’s an up-arrow with a 1 next to the branch name? This denotes that the local branch is ahead of the remote branch by one commit. (I realize I should have explained this earlier when I was pushing up the develop branch, but I forgot to screenshot it before I pushed it up.) Again, this is not a standard thing you’ll see in your prompt, to get it, you’ll need to install <a href="http://www.zsh.org/">zsh</a>, an <a href="https://github.com/robbyrussell/oh-my-zsh">Oh My Zsh!</a> prompt theme that supports it, and a <a href="https://nerdfonts.com/">NerdFont</a> for your terminal that supports icons. I may make this the subject of another post. I mention it only to denote that we need to push our changes to our remote. We’ll do so with this command: git push</p><p>And now your remote branches are all caught up! Of course, this over-simplifies the process… in practice, you’ll want to create a branch off of your develop branch for each new feature or bug-fix, in order to keep your working code clean while you’re writing new code. When working with others, when you’re ready for your code to be merged into your base branch, you’ll issue a pull-request and get your colleagues to review prior to the merge. All feature and bug branches should be merged to the develop branch, which in turn should be merged to your master branch after reaching a pre-determined release milestone (professionally, this would happen after you’ve submitted your work to be tested by your QA — these releases tend to contain many new features and/or bug fixes at a time).</p><p>Finally, you can view a neat-looking graph of your branch history with this command: `git log --all --decorate --oneline --graph , which will give you an output that looks something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XY0FJjwrFUmpY0MMOONYYQ.png" /><figcaption>I had done some changes to my README.md file online through Github’s interface, and so had to pull `origin/master` before I could push, that’s why my history looks the way it does here.</figcaption></figure><p>Properly utilized, Git branches are a powerful tool to keep your work-in-progress on various features segregated from code that may currently be in use. Branches enable you to develop and test new features and bug-fixes independent of code that may already be in use in a production environment, which will help to prevent you from introducing regressions or new bugs into your codebase.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0aa98bea330" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vets-who-code/git-branching-for-beginners-a0aa98bea330">Git Branching for beginners</a> was originally published in <a href="https://medium.com/vets-who-code">The SitRep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Not Just for Neck-Beards, or How I learned to stop worrying and love the terminal]]></title>
            <link>https://medium.com/vets-who-code/not-just-forneck-beards-or-how-i-learned-to-stop-worrying-and-love-the-terminal-ea938e1538ba?source=rss-804320492465------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea938e1538ba</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[terminal]]></category>
            <dc:creator><![CDATA[Eddie Prislac]]></dc:creator>
            <pubDate>Fri, 25 Jan 2019 17:42:34 GMT</pubDate>
            <atom:updated>2019-01-25T22:36:26.566Z</atom:updated>
            <content:encoded><![CDATA[<h3>Not Just for Neck-Beards, or: How I learned to stop worrying and love the terminal</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hjnx2X4GyI1aReucwt4_qQ.png" /><figcaption>Just homebrew running in my terminal, as I’m writing this.</figcaption></figure><p>When I first started out as a developer, I was ignant with a capital “IG”. The internet was just catching on as a thing, with those little silver <a href="https://en.wikipedia.org/wiki/AOL">AOL</a> disks arriving in everybody’s mail what seemed every other day, and computing power getting cheaper and cheaper. I bought my first PC from <a href="https://en.wikipedia.org/wiki/EMachines">eMachines</a> while still in the Marines, and wowed my barracks-mate when I showed him how we could link up our computers on a local LAN to play <a href="https://en.wikipedia.org/wiki/Quake_II">Quake 2</a> against each other. It was soon after that, I started taking programming courses at <a href="https://www.cmccd.edu/">Copper Mountain Community College</a> in Joshua Tree, California.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*bnlQDEHszuXLbhH4-YdH6g.jpeg" /><figcaption>Some Joshua Trees. Most of the area around CMCC in Joshua Tree, and Twentynine Palms, where I was stationed. looks exactly like this. (Photo by By Bernard Gagnon — Own work, CC BY-SA 3.0, <a href="https://commons.wikimedia.org/w/index.php?curid=25509669">https://commons.wikimedia.org/w/index.php?curid=25509669</a>)</figcaption></figure><p>The language they taught was <a href="https://en.wikipedia.org/wiki/Visual_Basic">Visual Basic</a>, and for me, it was a life-changing experience. As a kid, I’d watched on in awe as certain friends were able to write their own games or hack the local phone companies (at least one friend landed some jail-time for this), but always found it inaccessible, as it involved delving into that most nebulous of tools, the command-line. To me, the command-line represented the old-guard of computing, as I remembered playing <a href="https://en.wikipedia.org/wiki/The_Oregon_Trail_(1985_video_game)">Oregon Trail</a> and <a href="https://en.wikipedia.org/wiki/Snake_(video_game_genre)">Snake</a>, and writing <a href="https://en.wikipedia.org/wiki/BASIC">BASIC</a> programs on the blinking green-and-black screens of the <a href="https://en.wikipedia.org/wiki/TRS-80">TRS-80</a>’s my middle-school had in their computer lab. It conjured visions of neck-bearded old hippie nerds, modern-day Gandalfs with esoteric knowledge of a computer’s inner workings that I thought I’d never understand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*IyT-zjYO1os-xZ3Hu3LkHw.jpeg" /><figcaption>Richard M. Stallman, Founder of GNU, Neck-Bearded Hippie Techno-Wizard (image by SuperMat). He uses EMACS, but we won’t hold that against him. This is what I used to think everyone who devoted most of their time to working in a terminal window was. Stallman’s a pioneer and we all owe him a big debt, but he’s also a bit of an old coot, and still insists that everyone refer to Linux as GNU-Linux, which nobody but him does.</figcaption></figure><p>When I discovered Visual Studio and its UI-building tools that let me put together a user interface as easily as playing with blocks, and write code behind the UI by clicking interface elements, I knew THIS MUST BE THE FUTURE. Not long after, when I had a reliable internet connection, I discovered <a href="https://en.wikipedia.org/wiki/Macromedia">Macromedia</a>’s WYSIWYG (What you see is what you get, pronounced ‘wiz-ee-wig’) editor, <a href="https://en.wikipedia.org/wiki/Adobe_Dreamweaver">Dreamweaver</a>, and immediately devoted all of my time to learning the ins and outs of the software. I discovered that these tools were known as <a href="https://en.wikipedia.org/wiki/Integrated_development_environment">IDEs… Integrated Development Environments…</a> alongside the visual tools, you also got features like code-completion, syntax-based color-schemes, and <a href="https://en.wikipedia.org/wiki/File_Transfer_Protocol">FTP</a> tools built right into the editor, and visually helped you out in setting up a server on your development machine. Feeling as if I’d just been handed Excalibur by some strange woman lying in a pond, I dove in head-first and began my journey into web development. No need to use the antiquated, text-based tools of yesteryear, I thought. Leave that shit to the neck-bearded intellectuals.</p><p>I couldn’t have been more wrong, but I wouldn’t truly discover how wrong until years later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*odPvUVSseroEcwwygVZurw.jpeg" /><figcaption>Way cooler than the Flash I actually learned. Macromedia, the company that made Flash and Dreamweaver, were eventually bought out by Adobe, maybe you’ve heard of them?</figcaption></figure><p>Professionally, I continued down my path. I learned to craft rich content with Macromedia’s other famous tool, <a href="https://www.adobe.com/products/flashplayer.html">Flash</a>, and learned <a href="https://en.wikipedia.org/wiki/ActionScript">ActionScript</a>… a language, like Javascript, that is now a superset of ECMAScript, but was originally based on <a href="https://en.wikipedia.org/wiki/HyperTalk">HyperTalk</a>. When CSS came out, I started designing bigger and better websites. When C# came out, I upgraded my Visual Studio and started writing applications in applications for <a href="https://en.wikipedia.org/wiki/Windows_Presentation_Foundation">WPF</a>. I learned vb.net as well, but in the end, it wasn’t enough for me… I’d done a lot of my learning in a vacuum, and found myself struggling to find jobs where I wasn’t ‘the tech guy in the office’, who was, in addition to writing applications, also expected to install software on everyone’s machine, manage (and design) the company’s websites, manage the network, and in some cases, repair my boss’ 10yr-old daughter’s computer, all for a wage that even fast-food workers turn their noses up at today. I was determined to learn all I could, and get ahead, and that’s when I decided to learn <a href="https://secure.php.net/">PHP</a>. PHP was, at the time, one of the most popular languages available for use on the web, and was the language backing a theme-able blogging engine called <a href="http://wordpress.org/">WordPress</a>, which was just starting to gain traction at the time. I found Wordpress to be an enticing shortcut, in theory… it was free, and allowed you to quickly spin up a website that could be tuned with plugins and themes to be whatever you needed it to be, and it was pretty easy to get everything you needed up and running on Windows. However, in learning more and more PHP, I began to despise it (for reasons too numerous to go into here, but mostly because it’s god-awful ugly), and started dabbling in <a href="https://www.ruby-lang.org/en/">Ruby</a>, instead. Ruby had this framework called <a href="https://rubyonrails.org/">Rails</a>, which had a lot of tooling that would allow you to spin up a new webapp and serve it, directly from the command-line. Its tooling would allow you to enter simple commands to generate boilerplate, ready-to-run code. It… didn’t play nicely with Windows. I’d learned enough <a href="https://en.wikipedia.org/wiki/Linux">Linux</a> skills to run <a href="https://en.wikipedia.org/wiki/Apache_HTTP_Server">Apache</a> hosting Wordpress sites on my company’s servers to have gotten over my initial fear of the command-line, but I hadn’t really embraced it yet, until my frustration over trying to get Ruby and Rails to run without issue on Windows. I decided to start working more and more in Linux <a href="https://en.wikipedia.org/wiki/Virtual_machine">VM</a>s, learning more and more about just how powerful a tool the command-line really can be. Moreover, I was amazed at how many people were still using what I’d previously scoffed at as being an antiquated tool to develop, build, and run modern software. As the wool of youthful arrogance was slowly pulled from my eyes, I learned that apps run from the command-line generally run faster, due to not having a performance-hogging visual UI to worry about. I learned that Ruby ran better on Linux because it took advantage of certain terminal &amp; system-based tools that are common on Linux distros, but which required a ton of hoops to be jumped through to make work on Windows. When <a href="https://nodejs.org/en/">Node</a> came out and I started playing with it, I discovered that the same thing held true for that, as well… while you could (and still can) get Node working on Windows, it was remarkably easier to do so on Linux, through the terminal, and that many tools readily available on Linux were just not there on Windows. <a href="https://en.wikipedia.org/wiki/Bash_(Unix_shell)">BASH</a> started calling to me, compelling me to learn more and more, and I obliged. Fast-forward a couple of years, and I was now rarely using the WYSIWYG features of my editors, preferring instead to always have a terminal window open, running my applications directly in the browser while I was working on them. The more I worked in Ruby, the more I came to rely on the command-line, not only to run my apps, but also to install, manage, and run software. I was delighted to learn, upon landing my first Pro Rails gig, that all of the tooling which ran so great on Linux, but not on Windows, also worked great on MacOS (this is due to MacOS being a UNIX variant, itself). Moreover, I relished the freedom that working in the command-line afforded me. I started to seek out ways in which I could improve my workflow, through judicious use of the terminal. So, at this point, I wan’t scared of the terminal, but I still had not fully embraced it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/306/1*FLupzFxA6bVqcG6y7fuEew.png" /><figcaption>The EmberJS mascot. Eventually, nearly all the hot new frameworks would steal their tooling, to the point where some of them were so blatant about it, you can still see references to ember-cli in their output. Of course, it’s open-source, so that’s a risk you take.</figcaption></figure><p>I was using <a href="https://www.jetbrains.com/ruby/">RubyMine</a> at the time; yet another IDE, (one specific to Ruby), which allowed me to run a terminal in a handy window at the bottom of the screen. I started at this time, to use <a href="https://emberjs.com/">EmberJS</a> as well, a JS Front-end framework that included a lot of the same type of scaffolding tools that Rails provided. I also started using the terminal to automate a lot of my workflow… I set up <a href="https://en.wikipedia.org/wiki/Cron">cron</a> jobs and started writing BASH scripts to install software and libraries that I’d need; I abandoned the UI-based version-control tools I’d used in the past in favor of exclusively using <a href="https://en.wikipedia.org/wiki/Git">Git</a> from the command-line, and wrote custom aliases for common commands I found useful. I thought I was really getting the most out of it, but despite this, I still clung to a lot of my old prejudices when it came to running software directly in the terminal. To me, that flashy UI-based stuff was still the way to go. It wasn’t until I reached my current job that my eyes were truly opened.</p><p>By the time I started working for NBC, through <a href="https://www.railroad19.com/">Railroad19</a>, I had parlayed the skills I’d acquired over the years into a decent career. I’d more than quadrupled what I was making since I started working in the industry, to the point where my salary was not only competitive with what others of my skillset were making, but actually ahead of it. I knew my way around the tooling and the languages I was using, and knew where to look to find the answers I didn’t have. Still, I wanted more… the craving for knowledge and a deeper understanding of my work and my tools never really went away, and the more I used my flashy UI-based IDEs, one shortcoming started to become glaringly apparent… namely, they felt bogged down and sluggish. I’d noticed some of my co-workers used <a href="https://www.vim.org/">Vim</a>… one of the antiquated (so I thought, but TBH, their website still looks awful) editors of yesteryear that I’d dismissed as being one of the tools of the neck-beards. I scoffed for a while, but soon realized while pair-programming with these guys that they were able to accomplish things at a blindingly fast speed that I, with my hunt-and-peck typing and reliance on the point-and-click mouse-driven workflow, just could not keep up with.</p><p>I increased my productivity by switching from the Java-based RubyMine to <a href="https://code.visualstudio.com/Download">VSCode</a>, and while I enjoyed working in that editor immensely, I still couldn’t quite match the speed of the guys who were using Vim (This is an unpopular POV for most at VWC, who still swear by VSCode… it’s a matter of personal preference, really). I started noticing others in the industry used it as well, and recommended it over any other. “Hipsters”, I thought, “man-bunned, indoor-scarf-wearing, into-everything-before-it-was-cool douchebags”, trying vainly to put it out of my head… but my jealousy over my co-workers productivity finally got the better of me (also, we all work remotely, so at the time, I really had no idea if any of them had a man-bun… and as it turns out, no, they didn’t). I fired up Vim, and got to work learning it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JV3KAxVbRrksXnCAt9moTw.png" /><figcaption>And this is what I saw, more or less.</figcaption></figure><p>The first thing I noticed was that my install looked a hell of a lot more sparse than those of my co-workers. Vim in and of itself is really no more than a simple terminal-based text-editor, and it takes a LOT of love and configuration to mould it into a full-fledged IDE. Things I’d taken for granted in other editors, such as line-length delimiters, file explorers, tabbing entire selections, code-completion, bracket-closing, syntax highlighting… all this needed to be added in as plugins and configuration options. I won’t lie… getting Vim to behave like a full-fledged IDE takes a great deal of effort, and the terminology is different, so tabs don’t work like you might think they should, if you’re coming from a UI-based editor. However, the payoff was immense. Combined with the <a href="https://en.wikipedia.org/wiki/Tmux">tmux</a> terminal multiplexer, I was able to give myself a completely customized development environment, one tailored specifically to my needs and tastes that did exactly what I told it I wanted to, and that sipped resources, as it had no graphical UI to render. I have, at any given time, 3–4 projects open in Vim that I can switch between with simple keyboard shortcuts, each able to hold open multiple files to such a level as would cause a system failure if trying to keep the same amount open in any other editor I’d previously used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9fFr_8XnpViciT_UcTTr1Q.png" /><figcaption>Like this. Notice the top bar filled with open files. I have 3 other projects open at the moment, and all of them have a ton of files open. Vim doesn’t even flinch.</figcaption></figure><p>Even more keystroke commands allowed me to quickly navigate and edit my code without ever taking my hands away from the keyboard… a time-saving hack that I really had not expected to do me much good, as I’m a notorious hunt-and-peck typist. Even that started changing… as I learned to rely less on the mouse, my typing actually improved. And then another odd thing happened… when I would switch back to VSCode, I found myself trying to use the keyboard shortcuts I’d learned for Vim, and getting annoyed when hitting yy on my keyboard just typed ’yy’ instead of copying a line. I’d become the thing I’d previously mocked… someone who was completely hooked on a piece of software I’d ignored because I thought it was too old to still be useful. The truth is, Vim has been a mainstay in the development community for so long because it is what you make of it… a tool that gives you the complete and utter freedom to make your own choices about how you want it to look, feel, and behave. I now have a terminal running permanently in full-screen, while I work, and rarely need to leave it to accomplish anything. My productivity has grown to the point where opening a UI-based IDE and waiting for it to start up fills me with a great deal of impatience, and watching it start to bog down as I leave more and more files open makes me cringe. I still have VSCode installed on my machine, but the truth is, I never use it, except to keep up to date with it’s capabilities for the folks I mentor. I’ve learned to truly love the terminal and all the freedom and power it provides, and I don’t think I can ever go back.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea938e1538ba" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vets-who-code/not-just-forneck-beards-or-how-i-learned-to-stop-worrying-and-love-the-terminal-ea938e1538ba">Not Just for Neck-Beards, or How I learned to stop worrying and love the terminal</a> was originally published in <a href="https://medium.com/vets-who-code">The SitRep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Github Templates to make your life easier]]></title>
            <link>https://medium.com/vets-who-code/github-templates-to-make-your-life-easier-757669f78731?source=rss-804320492465------2</link>
            <guid isPermaLink="false">https://medium.com/p/757669f78731</guid>
            <category><![CDATA[template]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Eddie Prislac]]></dc:creator>
            <pubDate>Thu, 24 Jan 2019 00:12:58 GMT</pubDate>
            <atom:updated>2019-01-24T00:12:58.385Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zHbCTjuKGM30Dp8maICi3w.png" /></figure><p>When Github started doing templates, I’d just started pushing to get some sanity and consistency for our Peer Review process at work, so, needless to say, it came as a welcome addition to their service. Utilizing the template system can help you establish rules for submissions to your own projects, and ensure that the appropriate contextual information is included when submitting an issue or pull-request, so you won’t be left scratching your head when someone posts ‘Such-and-such feature is broken’ to your issues list.</p><p>The first template we’ll be discussing is an issue template. The issues template should be installed in your project as a file named issue_template.md, and stored somewhere within your project. (I personally recommend .github/issue_template.md) As the extension of the filename suggests, this is a markdown document… markdown being the markup language used on Github when you edit your readme, issue/pull-request descriptions, and comments. If you’re going to be on GitHub a lot, you’d do well to get familiar with it.</p><p>The reason why you want this template in your project is self-evident… you want people who are submitting issues to:</p><p>1) Check to make sure their issue has not already been submitted by someone else</p><p>2) Ensure the user has been following the proper procedure to get your app up and running properly</p><p>3) Ensure the when/where/why/how and who of the error is explained in a way that you’re going to get the most out of when triaging those incoming bugs.</p><p>Instructions for creating your . own issue_template.md file can be found <a href="https://help.github.com/articles/manually-creating-a-single-issue-template-for-your-repository/">here</a>.</p><p>The second template, as with the first, is also a markdown document: pull_request_template.md, and can be stored in the same folder as issue_template.md. Instructions for creating this one are fairly similar to the last one we discussed, and a walkthrough to do so can be found <a href="https://help.github.com/articles/creating-a-pull-request-template-for-your-repository/">here</a>.</p><p>You’ll want a pull-request template to ensure contributors fully explain what’s going on, what’s been changed, and which issue this is intended to fix, or feature it’s intended to implement.</p><p>There are many ways you can go about wording your templates, depending on the level of detail you want contributors to include. For example, for the issue-template, you can include a checklist which users can fill out to tick off steps they need to fallow before submitting their issue. As for the PR template, here’s a gist of the one we use on our projects at my job:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39bdda6c3dc6c41358ad1d83e8a34d14/href">https://medium.com/media/39bdda6c3dc6c41358ad1d83e8a34d14/href</a></iframe><p>The eagle-eyed faithful among you, when viewing the source of this document, will notice some marked similarities to the <a href="https://medium.com/@semperfried76/better-git-commit-messages-4daacafc71db">.gitmessage template I posted earlier this week</a>. This is not by accident. When you utilize the .gitmessage template and combine it with a clean commit history (<a href="https://medium.com/@semperfried76/keeping-your-git-commit-history-straight-57a0037f6e24">more on that here</a>), Github will automatically populate the title and description of your PR with the text from your commit message (which is pretty cool, when you think about it… a nice touch on the part of Github’s developers). We don’t actually use an issue template on my projects at the moment, as our issues are tracked by Pivotal Tracker, rather than by GitHub’s own issue system; I’m ashamed to admit that I don’t have a gist to share with you for that one. However…</p><p><a href="https://github.com/devspace/awesome-github-templates">Some other great examples can be found here</a>, including a template generator that will walk you through creation of either of these templates in the framework of a <a href="https://www.talater.com/open-source-templates/#/">“choose-your-own-adventure” Lewis Carroll or H.P. Lovecraft-styled story</a>. Utilizing these resources, I’m sure you’ll be able to find something that best fits your own projects’ needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=757669f78731" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vets-who-code/github-templates-to-make-your-life-easier-757669f78731">Github Templates to make your life easier</a> was originally published in <a href="https://medium.com/vets-who-code">The SitRep</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>