<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: MurrayVarey</title>
    <description>The latest articles on DEV Community by MurrayVarey (@murrayvarey).</description>
    <link>https://dev.to/murrayvarey</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F257094%2F4c5f6794-47a6-442b-aa2c-0bf26a44c236.jpeg</url>
      <title>DEV Community: MurrayVarey</title>
      <link>https://dev.to/murrayvarey</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/murrayvarey"/>
    <language>en</language>
    <item>
      <title>Daily Good Times! The Easy Way To Keep A Gratitude Journal</title>
      <dc:creator>MurrayVarey</dc:creator>
      <pubDate>Fri, 28 Feb 2020 20:20:04 +0000</pubDate>
      <link>https://dev.to/murrayvarey/daily-good-times-the-easy-way-to-keep-a-gratitude-journal-1nkn</link>
      <guid>https://dev.to/murrayvarey/daily-good-times-the-easy-way-to-keep-a-gratitude-journal-1nkn</guid>
      <description>&lt;p&gt;Hands up, who’s tried to keep a gratitude journal?&lt;/p&gt;

&lt;p&gt;The powerful effects of a gratitude journal are well documented. By simply writing down what you’re grateful for, you’ll develop a more positive mindset. You’ll become happier. &lt;a href="https://www.goodnet.org/articles/5-reasons-keeping-gratitude-journal-will-change-your-life"&gt;Apparently, you'll even sleep better.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So why is it so difficult?&lt;/p&gt;

&lt;p&gt;I’ve tried -- and failed -- to keep a gratitude journal many times before. Each time would be the same: The first day, full of enthusiasm. After three days I would ‘forget’ to write something. After a week I would quit, much to my relief. Gratitude journaling  wasn’t for me. Or so I thought.&lt;/p&gt;

&lt;p&gt;That changed a couple of months ago, when I was persuaded to give it one last go. Two months later, and I’m still going strong. &lt;strong&gt;Now I love my gratitude journal.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In a second I’ll explain what’s changed. But first let’s take a quick look at the standard gratitude journal advice.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Typical Gratitude Journal
&lt;/h3&gt;

&lt;p&gt;The typical gratitude journal goes like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every day you open your (probably expensive) gratitude journal&lt;/li&gt;
&lt;li&gt;You write down 3-5 things that you’re grateful for&lt;/li&gt;
&lt;li&gt;You do this in the morning or evening, so that the positive feelings can power you through the day (or next day)&lt;/li&gt;
&lt;li&gt;All your 'gratitudes' should be precise, rather than general. Otherwise you end up going through the motions&lt;/li&gt;
&lt;li&gt;Oh, and you should reflect on each entry before you jot it down&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I found that &lt;em&gt;way&lt;/em&gt; too restrictive.&lt;/p&gt;

&lt;p&gt;The first problem was the whole morning/evening thing. I had little wriggle room at those times of day, so I struggled to make gratitude journaling a consistent habit.&lt;/p&gt;

&lt;p&gt;The next problem was not knowing what to write. Even when I did crack open the journal, I would sit there struggling, staring at an empty page. So I gave up ... until a book changed my mind.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Happiness Advantage
&lt;/h3&gt;

&lt;p&gt;Everything changed when I read &lt;a href="https://www.goodreads.com/book/show/9484114-the-happiness-advantage"&gt;The Happiness Advantage by Shawn Achor&lt;/a&gt;. Its central idea is that we have the relationship between happiness and success inverted: success doesn't lead to happiness, instead happiness leads to success. It's a persuasive book, and Achor repeatedly emphasises the power of gratitude journaling. &lt;/p&gt;

&lt;p&gt;Then he dishes out one piece of advice that goes against the typical gratitude journal tip. It was enough to get me rolling.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gratitude At Work
&lt;/h3&gt;

&lt;p&gt;The advice in The Happiness Advantage was this: &lt;strong&gt;write your gratitude journal at work.&lt;/strong&gt; Set a notification at 11am for doing this. That's it.&lt;/p&gt;

&lt;p&gt;This may seem obvious, but it was exactly the tip I needed. I couldn't squeeze journaling into my already-crammed morning/evening routine. I am able to make the time in the middle of the day.&lt;/p&gt;

&lt;p&gt;Now you might be thinking: I can’t stop work in the middle of the day to write a gratitude journal. I had the same concern, but actually it wasn’t a problem. After all, taking five-minute breaks is something that you probably do quite often (particularly if you’re timeblocking, like the Pomodoro technique).&lt;/p&gt;

&lt;p&gt;This worked well for about a week ... but then I noticed that gratitude journaling was becoming a struggle. Rather than making me feeling positive, it felt like a drag. Whenever that notification popped up, I would groan inside.&lt;/p&gt;

&lt;p&gt;That’s when I started to change things.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Rename: Daily Good Times!
&lt;/h3&gt;

&lt;p&gt;The first problem, I realised, was the name itself. ‘Gratitude Journal’ doesn’t click with my brain. It's too sincere, too cheesy. It felt like homework!&lt;/p&gt;

&lt;p&gt;The solution? A rename. I needed something that would light me up.&lt;/p&gt;

&lt;p&gt;After experimenting with a few names, I landed on &lt;em&gt;Daily Good Times!&lt;/em&gt; Now, when that notification pops up, I’m inspired to write things down and feel happy about life. I picture summer afternoons walking through a park, sun shining, people dancing, usually a group of drummers sat in a circle. (That might be some people’s idea of hell … but it works for me.)&lt;/p&gt;

&lt;p&gt;Find a name that lights you up. Your journal, your name.&lt;/p&gt;

&lt;h3&gt;
  
  
  Capture Awesome Moments
&lt;/h3&gt;

&lt;p&gt;So you've got your rename. The next question is: What the hell do I write?&lt;/p&gt;

&lt;p&gt;In the past, I would sit with my journal and ask "What am I grateful for?" For a cynic like me, this soon became a struggle. Any joy -- any gratitude -- was gone. This was a problem.&lt;/p&gt;

&lt;p&gt;Luckily, the answer was in the name Daily Good Times! I started capturing, well, good times. This was a game-changer.&lt;/p&gt;

&lt;p&gt;My advice for anyone starting a gratitude journal: &lt;strong&gt;simply jot down moments that made you happy&lt;/strong&gt;. They can be from this morning or from years ago. It doesn’t matter.&lt;/p&gt;

&lt;p&gt;Daily Good Times! is filled with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Awesome nights with friends&lt;/li&gt;
&lt;li&gt;Hilarious/dumbass conversations with my kids&lt;/li&gt;
&lt;li&gt;Great things that happen at work&lt;/li&gt;
&lt;li&gt;etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Focusing on moments brings so many advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Easy: Unlike some gratitude journal prompts, writing about moments doesn’t take a huge leap of imagination. If it happened and it brought you some joy, then it counts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Specific: One of the keys to a gratitude journal is being specific. By definition, writing about moments does this.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Moment Album: Over time, your journal becomes like a photo album, but for moments instead. It's there to revisit whenever you need.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Clock-able: I soon realised that I was clocking good moments as they happened -- partly so that I would have something to write. “Is this cheating?” I wondered. Of course not! The whole point is to look for positives. Far from cheating, it means that the journaling is working.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You might think “I don’t have any good moments to write about”. If so, great -- you will definitely benefit from this exercise. I guarantee that there have been some positive moments in your past, however small -- a friendly gesture or a fun conversation. It might take some effort to think of these, but it will get easier as you work out your positivity muscles. And then you’ll be flying.&lt;/p&gt;

&lt;h3&gt;
  
  
  Develop Other Prompts
&lt;/h3&gt;

&lt;p&gt;Once you've grown the journaling habit you can develop some more writing prompts. Here are some of mine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Bad Times (with a Positive Twist): Take a bad thing that’s happened, and try to look for a positive take on it. This is tricky at first -- it’s like the ultimate positivity workout. But you'll soon start to look for the good in everything. &lt;em&gt;Example: I recently fell over while running, badly scraping my knee. It was nasty -- there seemed to be no positive spin. After a bit of thought, I turned this into an Injury Comparison bonding session with my 5-year old.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Read about Others’ Lives: Reading about other people’s lives can be a source of inspiration. It can give you a direct contrast with your life, and make you reflect. &lt;em&gt;Example: I was reading read Trevor Noah’s fantastic autobiography, “Born A Crime”. In it, he talks about growing up without proper water. This gave me a lot to think about.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Repeating Ain’t Cheating: Are you allowed to talk about something twice (or more)? Damn right you are! Revisiting those good moments is a great thing. So long as it doesn't become rote.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sneaky Affirmations: Sneak in moments that remind you that you’re awesome. Boss said you're doing a great job? Write about it, and expand on what you've done well.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Quick Tips
&lt;/h3&gt;

&lt;p&gt;Here are a few other tips that I've found useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Write As If No One’s Reading: The saying goes “Dance as if no one’s watching.” The same is true for a gratitude journal. Don’t get bogged down with thoughts like “What if Ellen reads this?” (a) she won’t, and (b) you’re writing about good times, so she’ll probably appreciate it. Good times often involve other people, and so you should feel okay to write about that.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Be Relentlessly Positive: For me Daily Good Times! is a Positive Only zone. After all, it's like my optimism gym. There are plenty of places in my life to be balanced or considered -- this ain’t one of them. Sure, some of the things I write make me sound borderline hippy-dippy insane.  But remember: Thank as if no one's reading!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pick a Format that’s Convenient: Digital or paper? Don't get hung up on  it. Do whatever works for you.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It Doesn’t Have to be Daily: Don’t feel pressured to write in the journal every day. Doing so can add to the grind. Twice a week will still give you those benefits. (And you can keep the name Daily Good Times! … because it’s your damn journal.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fewer Items: You might find that 3-5 items is too many. In that case, start off with 1. The main thing -- particularly when starting -- is to make it easy for yourself.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reread Your Good Times: Soon, you'll have a collection of your awesome moments. Any time you need a pick-me-up, then it will be there to read over.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Have Fun!
&lt;/h3&gt;

&lt;p&gt;The main lesson is: Do whatever you can to make gratitude journaling fun. For example, decorate your journal. If images are your thing, then post them in there. It all counts!&lt;/p&gt;

&lt;h3&gt;
  
  
  Does It Work?
&lt;/h3&gt;

&lt;p&gt;So does gratitude journaling -- or Daily Good Times! -- work?&lt;/p&gt;

&lt;p&gt;Hell Yes!&lt;/p&gt;

&lt;p&gt;For me, the positive workout is almost life-changing.&lt;/p&gt;

&lt;p&gt;Let’s use an example: recently, my car died. Previously, that would have seemed a disaster. Juggling work and child care proved a challenge, not to mention the costs. However, through writing in Daily Good Times! I started to find positives -- friends who helped out, improved knowledge about cars (check your coolant level, folks!), the fact that it wasn’t that bad. Life moved on.&lt;/p&gt;

&lt;p&gt;This has been the general pattern. I feel more in control.&lt;/p&gt;

&lt;p&gt;(And if you’re cynical about that … then you definitely need to try gratitude journaling.)&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrap-up
&lt;/h3&gt;

&lt;p&gt;Gratitude journaling changed for me once I decided to make it fun. The key was &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Keeping a consistent time (this can be at work), and &lt;/li&gt;
&lt;li&gt;Focusing on Happy Moments&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you've struggled with gratitude journaling before, give it a try. And remember: have Good Times!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have you kept a gratitude journal? What worked for you?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;(Header Image from Pixabay Photos)&lt;/p&gt;

</description>
      <category>gratitude</category>
      <category>books</category>
      <category>psychology</category>
    </item>
    <item>
      <title>What The Heck Is Git? (A Rundown for New Programmers)</title>
      <dc:creator>MurrayVarey</dc:creator>
      <pubDate>Wed, 12 Feb 2020 22:32:50 +0000</pubDate>
      <link>https://dev.to/murrayvarey/what-the-heck-is-git-a-rundown-for-new-programmers-2o9n</link>
      <guid>https://dev.to/murrayvarey/what-the-heck-is-git-a-rundown-for-new-programmers-2o9n</guid>
      <description>&lt;p&gt;&lt;em&gt;TLDR; Git is an incredibly powerful tool for any developer. It will help you in many ways. Git can be complicated at times, but don't let that put you off.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you’re new to programming, you're probably wondering: What the heck is Git? Or -- based on people I've spoken to -- you've never even heard of Git. Both of these are completely understandable. After all, Git is rarely mentioned in most beginner tutorials. &lt;/p&gt;

&lt;p&gt;My aim for this post is to explain what Git is and why it is so useful. To keep things simple, the post will be light on Git commands. By the end, I hope you’ll have a feel for how Git can help you today and in the future.&lt;/p&gt;

&lt;p&gt;Let's get to it.&lt;/p&gt;

&lt;h4&gt;
  
  
  Contents
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;What is Git?&lt;/li&gt;
&lt;li&gt;The Problem: Files Everywhere&lt;/li&gt;
&lt;li&gt;The Solution: Version Control&lt;/li&gt;
&lt;li&gt;What Makes Git Special?&lt;/li&gt;
&lt;li&gt;The Down Sides Of Git&lt;/li&gt;
&lt;li&gt;Common Concerns&lt;/li&gt;
&lt;li&gt;Useful Links&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is Git?
&lt;/h2&gt;

&lt;p&gt;In short, Git is a version control system, used by millions of developers around the world. Git is an incredible tool -- many programmers (myself included) wouldn't work without it. &lt;/p&gt;

&lt;p&gt;But that is a terrible answer. For a new programmer, the term ‘version control’ is meaningless. &lt;/p&gt;

&lt;p&gt;So, before diving into Git, we should first look at version control and the core problem it tackles. This is a problem that you’ll likely have experienced already.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: Files Everywhere
&lt;/h2&gt;

&lt;p&gt;It’s a common scenario. You’re beavering away on a project and are happy with the code as it stands. It looks slick, and its features work nicely.&lt;/p&gt;

&lt;p&gt;But there’s a problem: you need to make a change. This change is a big one, and might break the code that you’ve worked so hard on. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fq1jrr7sutcepi6tc1fbz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fq1jrr7sutcepi6tc1fbz.jpg" alt="Computer On Fire"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So what do you do?&lt;/p&gt;

&lt;p&gt;If you’re anything like I was at first, you’ll make a copy of your file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;hatShop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;hatShop_v2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now, if your change &lt;em&gt;does&lt;/em&gt; break everything, you can go back to the original version. Great, right? &lt;/p&gt;

&lt;p&gt;Well yes … and no.&lt;/p&gt;

&lt;p&gt;This system -- we’ll call it manual versioning -- works up to a point. However (as I learned the hard way) you soon run into a world of pain. Pain such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You soon create another backup file. And another. And another. Before you know it, your directory is flooded with different versions of the same file.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;hatShop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;hatShop_v2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;hatShop_final&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;hatShop_actual_final&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Adding a file to the project is dangerous. With every new file, the complexity shoots through the roof. And how can you keep these files in sync?
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;capShop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;capShop_v2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;catShoop_&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;

&lt;span class="nx"&gt;hatShop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;hatShop_v2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;hatShop_final&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;hatShop_actual_final&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;&lt;p&gt;When your code breaks, it’s damn near impossible to identify which change did the damage. You end up making &lt;em&gt;extra&lt;/em&gt; backup files so you don’t break anything during your investigation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your files are littered with commented-out code, because you don’t want to forget anything that might prove useful. This becomes noise (and it never proves useful)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you're partway through a feature and need to suddenly work on, say, an urgent bug ... well that means even more version files&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Horror! You start working with another developer, and you both want to edit the same file. How do you avoid trampling on each other’s code?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Someone else has made a difficult-to-understand change in the code, and has gone on holiday. WHAT WAS THAT CHANGE SUPPOSED TO DO?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By the end, your folder looks something like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;capShop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;capShop_v2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;catShoop_&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;capShop_bug_hunt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;

&lt;span class="nx"&gt;hatShop&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;hatShop_v2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;hatShop_final&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;hatShop_final_with_button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;hatShop_actual_final&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;hatShop_actual_real_i_mean_it_this_time_final&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;hatShop_from_leah&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;span class="nx"&gt;hatShop_now_broken&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Fortunately for us, these are age-old problems which people have been working on for many years. Their solution? Version control.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Solution: Version Control
&lt;/h2&gt;

&lt;p&gt;Version control -- also referred to as source/revision/change control -- is software that manages changes to your code. In other words, &lt;strong&gt;version control takes your manual versioning system and does all the hard work for you&lt;/strong&gt;. Version control takes a load off your mind.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1v3394a8hw1sha96t4ze.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1v3394a8hw1sha96t4ze.jpg" alt="Success"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are different version control systems -- such as Git, SVN and Mercurial. Most of these work by holding a copy of your code in what's called a &lt;em&gt;repository&lt;/em&gt;. The system tracks changes to this.&lt;/p&gt;

&lt;p&gt;Whenever you’re happy with a change to your code, you &lt;em&gt;commit&lt;/em&gt; that change to the repository. Each commit -- called a revision -- often contains multiple files. These commits build up to let you see and restore any changes you’ve made.&lt;/p&gt;

&lt;p&gt;From this, version control gives you some awesome things:&lt;/p&gt;
&lt;h4&gt;
  
  
  Undo Your Mistakes
&lt;/h4&gt;

&lt;p&gt;This is the most immediate and obvious benefit: &lt;strong&gt;Version control is like an Undo for your code&lt;/strong&gt;. Except it’s better, because it doesn’t forget your changes anytime you reboot your machine. &lt;/p&gt;

&lt;p&gt;This is amazing -- it frees you up to experiment and have some fun. Screwed everything up? No worries, just rewind back to your last commit.&lt;/p&gt;
&lt;h4&gt;
  
  
  Small Commits
&lt;/h4&gt;

&lt;p&gt;The cost of storing a change is practically nothing. There are no backup files clogging up your directory. &lt;/p&gt;

&lt;p&gt;As a result you could -- and probably should -- commit tiny improvements at a time. Removed some nested if-statements? Commit. Renamed a temp variable to something more meaningful? Commit. Deleted some commented-out code? Commit commit commit. &lt;/p&gt;

&lt;p&gt;Once you get into the habit of making small commits, it becomes easy to pinpoint any specific change that breaks your code.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Version control systems only store changes. They &lt;em&gt;don't&lt;/em&gt; make a separate copy of the file with each commit. This means you can commit as many small changes as you like without quickly taking up space with duplicates.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  History of Changes
&lt;/h4&gt;

&lt;p&gt;Ever found a line of code and asked: What was this line trying to do? Version control solves this problem. &lt;/p&gt;

&lt;p&gt;Alongside every code commit, you include a message which describes the reasons for that change. This message is like a detailed code comment, with the advantage of not adding any noise to your actual code. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This means you can see who changed every line of code, when, and why.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This history builds up over time, so is something that you really appreciate as the project grows. Then -- like a kind of programming Indiana Jones -- you have a chance to rescue some code artifact from ancient times.&lt;/p&gt;

&lt;p&gt;(I can vouch for this one, having recently dealt with a bug introduced 11 years ago. Without this code history, I wouldn't have stood a chance.)&lt;/p&gt;
&lt;h4&gt;
  
  
  Shared Repositories
&lt;/h4&gt;

&lt;p&gt;Version control makes it easy for two or more developers to work on the same file without breaking each other’s work. This is done by &lt;em&gt;merging&lt;/em&gt; each developer’s changes -- on a first-come-first-merged basis -- to the version of the file in the repository. &lt;/p&gt;

&lt;p&gt;If those two changes are in different parts of the file, then this process is automatic. The same is true when developers are working on different files -- they can get other’s changes while barely lifting a finger.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Even with version control, things can get hairy. If two developers have changed the exact same part of the code, then this has to be sorted out by hand. This is the dreaded Merge Conflict, and it’s a painful fact of programming life. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  Powerful Tools
&lt;/h4&gt;

&lt;p&gt;Version control systems often come with ready-made tools, such as Jira, GitLab, BitBucket, and (of course) GitHub. These complement the version control system and/or act as a layer on top.&lt;/p&gt;

&lt;p&gt;What do these tools give you? For a start, there’s the Issue Tracker which lets you record and describe, well, issues. Each issue -- generally a bug or feature -- will have an issue number, which you then mention in the commit message. This lets you trace through from Code to Commit to Issue with ease.&lt;/p&gt;

&lt;p&gt;Add to that: task management tools, wikis, funky graphs, and whatever else you can dream up. The tools are there; version control lets you use them.&lt;/p&gt;
&lt;h4&gt;
  
  
  Easy Backups
&lt;/h4&gt;

&lt;p&gt;One advantage of having a repository is that &lt;strong&gt;it acts as a backup of your project&lt;/strong&gt;. If this is stored off-site, then you should be pretty safe from most worries.&lt;/p&gt;

&lt;p&gt;This also makes it easy to get new teammates up and running. Simply clone your project onto their machine and hey presto. (Usually with a small bit of jiggling around … though it sure beats copying by hand.)&lt;/p&gt;
&lt;h4&gt;
  
  
  Synchronised File Changes
&lt;/h4&gt;

&lt;p&gt;Because each commit often contains more than one file, those changes are grouped together. No more worrying about which change in file A goes with which change in file B.&lt;/p&gt;
&lt;h4&gt;
  
  
  Project Serenity
&lt;/h4&gt;

&lt;p&gt;Gone are the many backup files that flood your directory. Gone is the commented-out code that’s there “just in case”. It has no reason to stay*.&lt;/p&gt;

&lt;p&gt;(*Oh sure, someone can always find a reason … but it had better be good!)&lt;/p&gt;

&lt;p&gt;Hear that? Sweet, sweet silence in your codebase. Now you can program in peace. &lt;/p&gt;



&lt;p&gt;You get the picture. Version control is a wonderful thing. It removes a lot of the risk and stress from software development. &lt;strong&gt;Programming without version control is like skydiving without a parachute. Even if you survive, you’ll likely find yourself stuck up a tree.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In fact, my original plan for this article was to write about version control as a whole. After all, any version control -- be it Git, SVN, or Mercurial -- is better than no version control, right? &lt;/p&gt;

&lt;p&gt;Wrong. I’d be selling new programmers short. It’d be like writing about search engines and not mentioning Google. Without wishing to start a flame war, there’s one clear version control system to learn: Git. Let’s talk about why.&lt;/p&gt;
&lt;h2&gt;
  
  
  What Makes Git Special?
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;“I decided that I can write something better than anything out there in two weeks ... And I was right.” -- Linus Torvalds&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Git was created by Linus Torvalds -- the legendary sharp-tongued inventor of Linux -- in 2005, to help develop the Linux kernel. As the quote suggests, he set out (in his own way) to improve upon existing version control systems at that time. Many would argue that he succeeded.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkewpbp9jy5n2alllr4q8.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkewpbp9jy5n2alllr4q8.jpg" alt="Teamwork"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since then, Git has become the industry standard. The language of Git -- push, pull, fetch, fork, etc. -- has become everyday terminology. Git is so popular among developers that it would take a seismic shift to replace it. And that replacement would have to be something pretty special ...&lt;/p&gt;

&lt;p&gt;So what makes Git stand out? Here are just some reasons:&lt;/p&gt;
&lt;h4&gt;
  
  
  Distributed System
&lt;/h4&gt;

&lt;p&gt;Okay, this one sounds dull at first (particularly if you’re working solo) … but it is the core principle behind Git. &lt;/p&gt;

&lt;p&gt;Git is a ‘distributed’ version control system. In other words, &lt;strong&gt;every developer has a clone of the repository on their machine -- complete with change history, commit messages, etc.&lt;/strong&gt; This is their ‘local’ repository. &lt;/p&gt;

&lt;p&gt;This is very cool, because it means you can commit a change to your own repository without breaking anyone else's code. It also means you can work offline, which is important for some people, less so for others.&lt;/p&gt;

&lt;p&gt;(For the record SVN, which is 'centralised', doesn't let you do this. At least not without cheating. Mercurial, like Git, is distributed.)&lt;/p&gt;

&lt;p&gt;From this distributed architecture other features appear, including the next one. It might be my favourite feature of Git: its branches.&lt;/p&gt;
&lt;h4&gt;
  
  
  Lightweight Branches
&lt;/h4&gt;

&lt;p&gt;Branches in Git are mind blowing, especially having come from SVN. Git Branching was the feature that first won me over.&lt;/p&gt;

&lt;p&gt;You can think of a branch as a new instance of your project -- effectively another repository. This lets you work on different jobs at the same time, without fear of cross-pollination. &lt;/p&gt;

&lt;p&gt;Developing a new feature? That can be a branch. Some experimental R&amp;amp;D? Another branch. Need to patch up a bug? A third branch. &lt;strong&gt;These branches are entirely separate from each other.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Commit your changes to the relevant branch, giving you a complete history. Finally -- when you’re finished with one of them -- you merge it back to the main branch. &lt;/p&gt;

&lt;p&gt;And boy is this easy to do in Git. &lt;/p&gt;

&lt;p&gt;It has to be said, branches are not unique to Git. SVN has branches. The difference is in the effort involved. With SVN, branches are a chore to manage. They take an age to set up, and are a horror show to merge back. &lt;/p&gt;

&lt;p&gt;With Git, branches are a joy. Set up and merging both happen within a blink*. The result? You use branches as nature (and Linus) intended.&lt;/p&gt;

&lt;p&gt;(*Okay, busted. That isn't entirely true. Git still has merge conflicts -- you do have to get your hands dirty sometimes. Still, these moments are rare when compared to SVN.)&lt;/p&gt;
&lt;h4&gt;
  
  
  Speed
&lt;/h4&gt;

&lt;p&gt;Git is lightning fast. Having moved from SVN to Git, the speed is noticeable. Even cloning a repository seems to take no time by comparison. Throw in the ease of branches and merging, and you’re laughing.&lt;/p&gt;

&lt;p&gt;I have heard that Git struggles with huge projects with, say, millions of files. This may well be true -- I wouldn't like to be around to find out.&lt;/p&gt;
&lt;h4&gt;
  
  
  Project Changes
&lt;/h4&gt;

&lt;p&gt;Git views changes in terms of the whole project. As a result, moving a directory (or renaming a file) in Git is simple. By contrast, SVN thinks in terms of individual files. Moving a directory (or renaming a file) in SVN is knotty, and often means waving bye-bye to your history in the process. &lt;/p&gt;
&lt;h4&gt;
  
  
  Open Source Community
&lt;/h4&gt;

&lt;p&gt;Git is the version control of choice for the Open Source community. Its whole ethos revolves around open source.&lt;/p&gt;

&lt;p&gt;GitHub is by far the best example of this.  It is filled with awesome people doing awesome work, all for free and the genuine goodness of their own hearts.  You -- yes, you -- could go on it now, and contribute to any (public) project. That’s pretty awesome.&lt;/p&gt;

&lt;p&gt;( … And this is where I have to confess: I’m not an open source contributor. Sure I feel some guilt about it, but there is only so much you can do at a time.)&lt;/p&gt;

&lt;p&gt;Big corporates too -- such as Microsoft and Google -- have jumped aboard the GitHub bandwagon (to the extent that Microsoft bought it). Fancy peaking under the hood of Windows' Calculator? Well you can do that right now. Please, contain your excitement. (I'll admit, I let out a little squeal.)&lt;/p&gt;
&lt;h4&gt;
  
  
  Powerful Commands
&lt;/h4&gt;

&lt;p&gt;Git seems to have an endless supply of commands that can help a developer on a daily basis. For example, need to pinpoint which change introduced an error? Try the bisect command.&lt;/p&gt;
&lt;h4&gt;
  
  
  A Silly Name
&lt;/h4&gt;

&lt;p&gt;For those developers from the UK -- yes Git really is called &lt;em&gt;Git&lt;/em&gt;. You'll never get used to it. Just accept it and move on. As far as I know, there’s no version control yet called Prat or Plonker.&lt;/p&gt;



&lt;p&gt;Switching from SVN to Git was -- no joke -- life changing. I’ve experienced the difference it makes. Once you’ve used Git, it’s tough to go back. Fortunately, you won’t have to very often.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Down Sides of Git
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5mi8tupsfurs1vkq7c0b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5mi8tupsfurs1vkq7c0b.png" alt="Git by XKCD"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Git by &lt;a href="https://xkcd.com/1597/" rel="noopener noreferrer"&gt;XKCD&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let's cut to the chase: Git &lt;em&gt;can&lt;/em&gt; be complicated. In fact, it can be downright terrifying. Certain commands give you cause for prayer before using them. I'm looking at you, Rebase!&lt;/p&gt;

&lt;p&gt;Git can sometimes be too clever for its own good. For example, I've never been sold on its Staging Area. Why add a second step to the commit process? (Many would disagree with me here -- I've just not found a good &lt;em&gt;and safe&lt;/em&gt; use for it yet.)&lt;/p&gt;

&lt;p&gt;The good news? You can get by in Git with the basics, especially when you're just starting.&lt;/p&gt;

&lt;p&gt;Also, the tools can hide a lot of complexity. I suspect that improvements to Git will rely on changes to its tooling.&lt;/p&gt;

&lt;p&gt;Anything else? None that I’ve encountered yet. If you've experienced more, please do let me know.&lt;/p&gt;
&lt;h2&gt;
  
  
  Common Concerns
&lt;/h2&gt;

&lt;p&gt;Here are some common concerns about Git that I’ve come across, along with my thoughts:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I’ve only just started programming. Do I need to learn Git as well?&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;You got me! In this case, the answer might be no. Write code, play around and have fun. &lt;/p&gt;

&lt;p&gt;However, the moment you write some code that you want to keep, then Git will be your lifeline. &lt;/p&gt;

&lt;p&gt;Also, it’s worth signing up to GitHub now. There’s no harm in doing so. Have a look around. Commit a few files -- they don't even have to be code.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I’m working on a solo project. Git seems like overkill.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;This can be true ... but not often. Yes, Git can feel like overkill when you’re working alone. But a lot of its benefits apply to solo projects. &lt;/p&gt;

&lt;p&gt;If the code is &lt;em&gt;truly&lt;/em&gt; throwaway, then setting up a Git repository might be a step too far. That's a judgement call.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I’ve heard Git is complicated&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;Oh indeed! Git can be confusing as hell. However, you don’t have to use its advanced features from day one. Instead, start off slowly, and commit small changes. Once you become more confident, then you can explore what else Git gives you.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Git looks like a bunch of confusing command lines&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;Sure does. &lt;/p&gt;

&lt;p&gt;I’m going to admit something here: I rarely use the Git command line. Much to my shame, I cannot claim to be a Git master. And yet I still find it vital to my work. &lt;/p&gt;

&lt;p&gt;Most of the time, I’ll use a Git GUI which hides all of this from me, such as Sourcetree, GitKraken, or SmartGit. (That said, it’s worth knowing a bit about the command line -- it can get you out of a hole.)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Git sounds expensive&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;Git is free! Sure, there are ways to spend money. But that’s not a worry for now. Stick to GitHub, and you’ll be grand.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I’m partway through a CS degree, and Git hasn’t been mentioned. Can it be that important?&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;I’ve recently come across graduates whose degrees didn’t mention Git (or even version control). As far as I'm concerned, that degree has failed you. Start using Git now -- it will help.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;There must be other popular version control systems?!&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;There are: Mercurial and Fossil to name a couple. These might well be excellent systems (I've not used either). By all means explore them. At some point, though, you will probably need to learn Git.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I’ve been programming for years, and have never needed an old version of my code&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;Then you are a far better programmer than me. Please tell me your secret! &lt;/p&gt;
&lt;h2&gt;
  
  
  Useful Links
&lt;/h2&gt;

&lt;p&gt;Ok, so you're ready to get into Git. Here are some links to get you started:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.github.com" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; -- &lt;strong&gt;The&lt;/strong&gt; Git hosting site. Sign up now.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.codetriage.com" rel="noopener noreferrer"&gt;Code Triage&lt;/a&gt; -- Help find an open source project&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=4XpnKHJAok8" rel="noopener noreferrer"&gt;Linus's hilarious Git talk at Google&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And of course Dev.to has some excellent resources, including:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/duomly" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F191953%2Ffcebc3f7-f8ba-439f-927f-b1e2a7c77a4a.png" alt="duomly"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/duomly/git-cheatsheet-for-beginners-5apl" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Git cheatsheet for beginners&lt;/h2&gt;
      &lt;h3&gt;Duomly ・ Jan 8 '20&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#git&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#programming&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#codenewbie&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;




&lt;div class="ltag__link"&gt;
  &lt;a href="/chrisachard" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F212474%2F928651b2-e082-4350-aeb3-25a861a8aa76.png" alt="chrisachard"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/chrisachard/confused-by-git-here-s-a-git-crash-course-to-fix-that-4cmi" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Confused by git?  Here's a git crash course to fix that 🎉&lt;/h2&gt;
      &lt;h3&gt;Chris Achard ・ Sep 10 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#git&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;div class="ltag__link"&gt;
  &lt;a href="/jacobherrington" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F94240%2F17052784-f4b9-4bed-ae24-09146ed6a257.jpg" alt="jacobherrington"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/jacobherrington/10-git-tricks-to-save-your-time-and-sanity-289h" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;10 Git Tricks to Save Your Time and Sanity&lt;/h2&gt;
      &lt;h3&gt;Jacob Herrington (he/him) ・ Aug 7 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#git&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#productivity&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;
 




&lt;p&gt;Git is an incredible tool -- giving you the freedom to create, change and share code. Yes, it can be complicated. Just take it easy at first. You'll soon be glad that you took the time.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Banner Credits - &lt;a href="https://christopherkade.com/banner-generator/" rel="noopener noreferrer"&gt;Banner Generator by Christopher Kade&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Artwork Credits - &lt;a href="https://ls.graphics/" rel="noopener noreferrer"&gt;ls.graphics&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Building Habits: The One Technique That Worked For Me</title>
      <dc:creator>MurrayVarey</dc:creator>
      <pubDate>Tue, 07 Jan 2020 22:39:06 +0000</pubDate>
      <link>https://dev.to/murrayvarey/building-habits-the-one-technique-that-worked-for-me-2a05</link>
      <guid>https://dev.to/murrayvarey/building-habits-the-one-technique-that-worked-for-me-2a05</guid>
      <description>&lt;p&gt;Good habits are hard to build. Until recently, I had never successfully managed it. Replacing my fries with a salad? Not happening, no matter how much I tried.&lt;/p&gt;

&lt;p&gt;However, last year I discovered a habit-building technique that sounded like it might be effective. Upon reading about this -- in James Clear’s awesome book Atomic Habits -- I jumped on it straight away. Before long, I had developed habits that — shock — actually stuck around. &lt;/p&gt;

&lt;p&gt;What is this powerful technique? It’s called Habit Stacking.&lt;/p&gt;

&lt;h2&gt;
  
  
  Habit Stacking
&lt;/h2&gt;

&lt;p&gt;The idea behind Habit Stacking is simple. In order to develop a new habit, all you do is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Take an existing habit (or automatic activity) and then&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Perform that new habit afterwards&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In other words, your existing habit becomes a trigger for the new habit.&lt;/p&gt;

&lt;p&gt;For example, here are some habit stacks that I’ve built into my own life:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Bedroom &amp;gt; Charger Stack&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Aim: To stop reading my phone in bed&lt;/p&gt;

&lt;p&gt;Method: When I (a) walk into my bedroom, I (b) put my phone on charge in the other corner of the room.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Bowl &amp;gt; Bottle Stack&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Aim: To drink more water throughout the day&lt;/p&gt;

&lt;p&gt;Method: When I (a) wash my cereal bowl at work, I (b) fill a bottle with water.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Run &amp;gt; Healthy Lunch Stack&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Aim: To eat healthier food&lt;/p&gt;

&lt;p&gt;Method: After I (a) finish my lunchtime run, I (b) buy a relatively healthy lunch (rather than the turkey sandwich that I would buy otherwise)&lt;/p&gt;

&lt;p&gt;It’s easy to see why this technique is effective — each of us has any number of habits built into our daily activities. My trigger habits are so simple that you might not even call them habits at all. Still, I am guaranteed to do them on most days, which makes the habit stacking easy to do.&lt;/p&gt;

&lt;p&gt;(And for those of you thinking “That’s not a Stack” … I hear you! It’s more of a Habit Linked List. Not as catchy though.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Reverse Engineering a Habit Stack
&lt;/h2&gt;

&lt;p&gt;I admit, habit stacking sounds a little obvious. In fact, you likely do some form of it already. Maybe, once you (a) step into the shower, you (b) oil your viking beard while singing a Disney medley. We all have these little stacks built into our routines.&lt;/p&gt;

&lt;p&gt;So what’s the big deal? For a start, often the so-called obvious is worth highlighting. After all, I hadn’t figured out habit stacking for myself, obvious as it may be.&lt;/p&gt;

&lt;p&gt;More importantly, by giving habit stacking a name, the concept starts to solidify. It becomes a conscious thing. And that’s where the power lies: you begin to look for opportunities to create a stack. In other words, you can reverse engineer the habit you want to build. Now we’re talking my language!&lt;/p&gt;

&lt;p&gt;When you think about it, there are so many triggers to stack a habit onto:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Waking up&lt;/li&gt;
&lt;li&gt;Turning your light on&lt;/li&gt;
&lt;li&gt;Drinking your soothing morning tea&lt;/li&gt;
&lt;li&gt;Shouting abuse at your neighbour’s cat (not enough tea!)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The opportunities to build a habit stack are there. You just have to look for them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stacks Upon Stacks
&lt;/h2&gt;

&lt;p&gt;Here’s another great thing about habit stacking — once you have a stack, you can keep adding habits to it. Habit stacking has a kind of recursive quality. Because of this, you can link together a number of tiny habits. When performed in sequence, these can add up to something huge.&lt;/p&gt;

&lt;p&gt;Here’s a small habit that I recently added to my Bowl &amp;gt; Bottle stack. Once I’ve filled my bottle with water, I then go to my desk and — first thing — drink a glass of water. The stack has now become Bowl &amp;gt; Bottle &amp;gt; Drink. It’s a tiny addition, but it gets me started.&lt;/p&gt;

&lt;p&gt;But this comes with a warning: Don’t overstack. Once you have too many things going on, the stack can feel like a checklist. The ‘habit’ element has gone and it’ll no longer be automatic. Chances are you’ll not do it.&lt;/p&gt;

&lt;p&gt;Keep the stacks small, and they will flow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solid Foundation
&lt;/h2&gt;

&lt;p&gt;To be a success, each habit stack needs to be built on a solid foundation. In other words, that initial trigger habit has to be automatic. If not, the whole thing falls down. &lt;/p&gt;

&lt;p&gt;I learned this the hard way with my first attempt at creating a water drinking stack. The idea was to base my new water drinking habit on the Pomodoro technique. This is the timekeeping method I’ve been using which, in short, means working in 25 minute blocks. My plan was, after every other pomodoro — approximately once an hour — to get up and fill a glass of water.&lt;/p&gt;

&lt;p&gt;This sounded great, but there was a tiny problem: most days I forgot to use the Pomodoro technique. Remember how I said I was bad at habit building? Well, the Pomodoro technique is one such example. The rest of the stack was always going to fail. I was never going to drink that water.&lt;/p&gt;

&lt;p&gt;Washing my cereal bowl? Now that’s automatic, otherwise that bowl is staring me in the face all day, caking that cereal into cement. As a result, that water bottle is getting filled.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep The Habits Linked
&lt;/h2&gt;

&lt;p&gt;Here's another reason that my Pomodoro &amp;gt; Water stack failed: The Pomodoro did not link — in any way — to the Water. So, even when I did remember to turn on that Pomodoro timer, I still forgot to fill that glass.&lt;/p&gt;

&lt;p&gt;There should be a link between the two habits, such that the second habit practically jumps out of the first. These links can come in a variety of forms. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Visual link — “Hey, there’s my phone charger, let’s plug my phone in” (Bed &amp;gt; Charger stack)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Themed link — “I’m feeling healthy after that run, better keep that up” (Run &amp;gt; Healthy Lunch)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where multiple stacking can come in handy. If there is no link between habits (a) and (b), then you can build a linking habit. This could have saved my Pomodoro &amp;gt; Water stack, if I had developed the habit of walking around after every pomodoro. Then, occasionally, that walk could have ended up at the water cooler, making the water bottle is easy to fill. I would have a Pomodoro &amp;gt; Walk &amp;gt; Water stack.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Dark Side of Habit Stacking
&lt;/h2&gt;

&lt;p&gt;As with any force for good, habit stacking has a dark side. Again, most of us already do this without realising. How often do you check your phone and instantly open up Twitter (or even Dev.to)? If so, you have a Phone &amp;gt; Twitter stack. &lt;/p&gt;

&lt;p&gt;Ah ha — but there’s good news! Once you’re aware of it, you can change the stack. Perhaps you could flick to a photo of loved ones instead. Or someone you don’t like — then you’ll stop doing it!&lt;/p&gt;




&lt;p&gt;There we have it. Habit Stacking, the one habit-building technique that’s worked for me. &lt;/p&gt;

&lt;p&gt;If you’re looking to build a habit, give this a try. Just make sure the foundations are stable, and that the habits are linked. You’ll be a habit-building machine before you know it. &lt;/p&gt;

&lt;p&gt;Do you have a favourite habit-building technique? I’d love to hear about it. (And will it stop me from eating fries?)&lt;/p&gt;

&lt;h2&gt;
  
  
  Further Reading
&lt;/h2&gt;

&lt;p&gt;— &lt;a href="https://jamesclear.com/habit-stacking"&gt;Habit Stacking by James Clear&lt;/a&gt;&lt;br&gt;
— &lt;a href="https://www.developgoodhabits.com/building-habit-stacking-routine/"&gt;13 Steps for Building a Habit Stacking Routine&lt;/a&gt; (this article goes into great detail)&lt;/p&gt;

&lt;p&gt;Header Photo by Johnson Wang on Unsplash&lt;/p&gt;

</description>
      <category>career</category>
      <category>productivity</category>
      <category>learning</category>
      <category>habits</category>
    </item>
    <item>
      <title>Books I Loved in 2019</title>
      <dc:creator>MurrayVarey</dc:creator>
      <pubDate>Sun, 29 Dec 2019 23:13:30 +0000</pubDate>
      <link>https://dev.to/murrayvarey/books-i-loved-in-2019-49b7</link>
      <guid>https://dev.to/murrayvarey/books-i-loved-in-2019-49b7</guid>
      <description>&lt;p&gt;I love a good reading list … possibly even more than actual reading itself. With that in my mind, here's my list of the books that I most enjoyed in 2019. In no particular order:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Atomic Habits by James Clear&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I have recommended &lt;em&gt;Atomic Habits&lt;/em&gt; to just about every human — and the occasional tame animal — I’ve met this year. James Clear’s book is full of practical advice on how, and why, to change your daily habits. And by ‘practical’ I mean &lt;em&gt;I have actually used the advice in this book&lt;/em&gt; … which is so rare for this genre. Also rare for this genre: Atomic Habits is very well written.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Give and Take by Adam Grant&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Nice folk can finish first, and &lt;em&gt;Give And Take&lt;/em&gt; explains how. Crucially, author Adam Grant also explains how to avoid that all too common nice-person trap: becoming a doormat. After reading this book, I at least wanted to become more generous … even if my lazy nature seems to be winning out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hello World by Hannah Fry&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A pop tech book on algorithms. With jokes. Where &lt;em&gt;Hello World&lt;/em&gt; is light on technical details, it is strong on clearly describing how algorithms run our world. Hannah Fry's examples range from tragic to funny, all of which makes for an engaging read. Worth reading even if you’re an expert (which I’m not!), just to get ideas on how to express these concepts to the less informed (which I am!).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Show Your Work by Austin Kleon&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Show Your Work&lt;/em&gt; is a beautiful book, both in terms of its message and its contents. Filled with fantastic artwork by Kleon himself, this book encourages you to share the mess that is your creative process. Show Your Work will help anyone who is reluctant to put themselves out there. Put another way: Show Your Work is the reason I stopped hiding in the shadows and joined Dev.to.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Born To Run by Christopher McDougall&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Born To Run&lt;/em&gt; tells the story of the greatest long-distance race ever run, and the Mexican tribe that inspired it. The distances are mind-blowing — 100+ mile races — which makes you realise that we human beings aren’t quite the Wimpy Species that we’d been led to believe. Whether you’re a runner or not, Born To Run will make you want to grab for your sweat shirt and shorts and head outside. (And, yes, the Bruce Springsteen reference is intentional.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Spy and The Traitor by Ben Macintyre&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The riveting depiction of the real-life story of Oleg Gordievsky — a Russian agent who was secretly working for MI6 during the Cold War. The last third of &lt;em&gt;The Spy and The Traitor&lt;/em&gt; was the tensest reading experience I’ve ever had. I was shedding genuine stress tears by the end. Incredible stuff.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rocket Men by Robert Kurson&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Rocket Men&lt;/em&gt; tells the story of Apollo 8, the first crewed spacecraft to orbit the moon. What sets this book apart is the scene-setting. Two chapters in particular spring to mind: Kurson’s fantastic essay on the moon's significance throughout human history; and his review of the tumultuous year that was 1968. Ultimately, however, Rocket Men is about the astronauts — three men out for the adventure of all-time; three men with families who need them home.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hilda by Luke Pearson&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The only fiction on my list, and I’ve cheated a little — Hilda is a series of graphic novels, written primarily for kids. The eponymous Hilda is a courageous blue-haired girl who encounters all sorts of wonderful things on her adventures — teleporting gnomes, a sarcastic man made of wood, bureaucratic (and invisible) elves, etc. Hilda is wistful in the best kind of way. Particularly good for young children — our 5-year-old loves it.&lt;/p&gt;

&lt;h1&gt;
  
  
  2020 Reading Resolutions
&lt;/h1&gt;

&lt;p&gt;Looking at my list, I’m ashamed to note that there is only one female author -- unfortunately, that's probably a fair reflection on the male-to-female ratio I read this year. I’m slightly less ashamed (but still ashamed) to note that there are no real technical books. Both of these I intend to fix next year. Also for next year: more fiction. Because, hey, you’ve got to let your hair down once in a while.&lt;/p&gt;

&lt;h1&gt;
  
  
  Other Reading Lists
&lt;/h1&gt;

&lt;p&gt;As I say, I'm a big fan of reading lists. Here are some good ones I've found on Dev.to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://dev.to/vintharas/my-favorite-books-of-2019-3hen"&gt;My Favorite Books of 2019&lt;/a&gt; by &lt;a class="comment-mentioned-user" href="https://dev.to/vintharas"&gt;@vintharas&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/lbeul/your-favourite-non-technical-books-18g"&gt;Your Favourite Non-Technical Books?&lt;/a&gt; by &lt;a class="comment-mentioned-user" href="https://dev.to/lbeul"&gt;@lbeul&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/emma/my-2019-in-books-7ok"&gt;My 2019 in Books&lt;/a&gt; by &lt;a class="comment-mentioned-user" href="https://dev.to/emma"&gt;@emma&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/sandordargo/the-best-8-books-i-read-this-year-a03"&gt;The Best 8 Books I Read This Year&lt;/a&gt; by &lt;a class="comment-mentioned-user" href="https://dev.to/sandordargo"&gt;@sandordargo&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do you have a reading list of your own? If so, I'd love to hear it.&lt;/p&gt;

</description>
      <category>watercooler</category>
      <category>books</category>
      <category>reading</category>
      <category>hobby</category>
    </item>
    <item>
      <title>What's Been Your Biggest "Why Didn't Someone Tell Me" Discovery?</title>
      <dc:creator>MurrayVarey</dc:creator>
      <pubDate>Thu, 19 Dec 2019 23:21:11 +0000</pubDate>
      <link>https://dev.to/murrayvarey/what-s-been-your-biggest-why-didn-t-someone-tell-me-discovery-5gpg</link>
      <guid>https://dev.to/murrayvarey/what-s-been-your-biggest-why-didn-t-someone-tell-me-discovery-5gpg</guid>
      <description>&lt;p&gt;Have you ever made a discovery that blew your mind (in a good way)? Something that quickly solved a nagging problem, or perhaps something that you'd been doing wrong for years?&lt;/p&gt;

&lt;p&gt;Tech and/or non-tech answers are all good.&lt;/p&gt;

</description>
      <category>watercooler</category>
      <category>discuss</category>
      <category>learning</category>
    </item>
    <item>
      <title>Do You Volunteer?</title>
      <dc:creator>MurrayVarey</dc:creator>
      <pubDate>Thu, 12 Dec 2019 17:53:57 +0000</pubDate>
      <link>https://dev.to/murrayvarey/do-you-volunteer-2l6e</link>
      <guid>https://dev.to/murrayvarey/do-you-volunteer-2l6e</guid>
      <description>&lt;p&gt;I'm interested in giving back more. Do you volunteer in your free time at all -- either tech or non-tech related? If so, what do you do? Would you recommend it?&lt;/p&gt;

&lt;p&gt;*Open Source counts -- particularly if it's a noteworthy project.&lt;/p&gt;

</description>
      <category>watercooler</category>
      <category>discuss</category>
      <category>gratitude</category>
    </item>
    <item>
      <title>Can you Recommend a Good Pop-Tech Book?</title>
      <dc:creator>MurrayVarey</dc:creator>
      <pubDate>Thu, 05 Dec 2019 22:16:58 +0000</pubDate>
      <link>https://dev.to/murrayvarey/can-you-recommend-a-good-pop-tech-book-2og0</link>
      <guid>https://dev.to/murrayvarey/can-you-recommend-a-good-pop-tech-book-2og0</guid>
      <description>&lt;p&gt;I'm interested in tech books that are aimed at a more general, non-technical audience. Which book would you recommend to, say, a curious friend?&lt;/p&gt;

</description>
      <category>books</category>
      <category>watercooler</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Which Single Resource Has Most Affected How You Code?</title>
      <dc:creator>MurrayVarey</dc:creator>
      <pubDate>Wed, 20 Nov 2019 21:37:01 +0000</pubDate>
      <link>https://dev.to/murrayvarey/which-single-resource-has-most-affected-how-you-code-34la</link>
      <guid>https://dev.to/murrayvarey/which-single-resource-has-most-affected-how-you-code-34la</guid>
      <description>&lt;p&gt;There are so many programming resources available. With that said, is there a single one that had the biggest effect on your code?&lt;/p&gt;

&lt;p&gt;For me, it would be &lt;a href="https://www.youtube.com/watch?v=aWiwDdx_rdo"&gt;Practical Refactoring by Llewellyn Falco and Woody Zuill&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/aWiwDdx_rdo"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;On the face of it, this video should be extremely dry -- it's literally just a couple of guys refactoring code for two hours. In spite of that, those  two hours shook me to my legacy-coding core. Refactoring has since become vital to my work and (dare I say it) fun!&lt;/p&gt;

&lt;p&gt;So how about you? Be it book, blog, video, or whatever -- which single resource has most affected how you code?&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
  </channel>
</rss>
