Day 9: It’s like patching holes

Nick Ang
getting technical
Published in
5 min readJul 9, 2016
Image: Nick Schumacher

It’s been a while since a day has felt like a full day. Faced very few distractions today, and I feel on top of things. Could be the effect of a 3-day meditation streak of 11 minutes each morning, but I’m not sure.

Still, there were a few minor distractions. One of them came in the form of a heated debate with my friend Nick about Airbnb, which might have altered my state of being. At the end of our talk he made me realise how much I have let the issue — a growing disagreement among residents in the estate I live in about the place of Airbnb here — affect me, and from that moment at noon onwards I felt a visceral improvement in my ability to be above my thoughts. This isn’t the first time that recovering from anger helped me be more mindful for the remainder of the day, and it probably won’t be the last. I’ll say this though: it’s quite effective!

Repetition is for machines

Throughout the day I went through a few modules in the pre-course work given to me by General Assembly. Generally speaking, I’ve learned a bit here and there today.

The thing is, having spent the two months before starting this 30-day commitment to write on learning HTML/CSS/JavaScript on freecodecamp.com, I started the pre-work with a good but rough idea of how all of it worked. So going through the pre-work is like having a cloth with many holes of different sizes that I want to patch up, but the material to do it with are littered all over the place in small pieces. I had to constantly scan the headers and paragraphs in each module to make sure I didn’t skim through things I didn’t already fully understand. Going through the modules therefore felt a little bit strenuous at times, but nothing unbearable. I do wonder how good my stitching skills are, though.

Specifically, I learned these things that I didn’t already know.

Write in plain English first

‘Pseudo coding’ is a technique to plan out a program you want to create before writing the actual code. I had known this to be something that some programmers do, but I hadn’t known that it’s a thing. GA sums it up nicely:

As tempting as it may be to jump right into a problem and start writing code, you’ll find that taking a few minutes to focus on your approach will save you valuable time as you start writing actual code. Often during the planning process you’ll think of scenarios you hadn’t originally anticipated. As the old proverb goes, “Measure twice and cut once.”

Null is not undefined

I never knew the difference. I’d always thought that they are just values that a computer knows to indicate when something is wrong, like when there’s a missing step in the code. Instead, setting a variable’s value to null is kind of like resetting its value to nothing. Undefined is not nothing — undefined means the variable doesn’t even exist. Again, from GA:

Null values are values that you decide have no value.

Here’s an example. Suppose you have an application for keeping track of your things. You might have a string called locationOfKeys which indicates where your keys are. Then, one day, your keys get lost. What’s the value of locationOfKeys now? Well, it’s ‘nothing’ — they’re lost. If null didn’t exist, we would have to invent a special string value (perhaps “lost”) to signify that the keys are missing. null gives us a standard way of handling that kind of situation where we can simply say locationOfKeys = null;

Git and GitHub

My understanding of Git and GitHub is growing. First thing to note is that they’re different things. Git is open-source versioning software created by the legendary Linus Torvalds (creator and principal maintainer of the Linux kernel) together with a few other developers. It’s free, you download and install it to your computer, and start using it.

GitHub on the other hand is a company that runs the website of the same name. It’s also free and is now the largest host of source code. The relationship between the two is unclear to me at this point.

I learned what ‘git’ was only a day earlier even though I had heard of GitHub many times before. In reality, both are used in the daily life of a professional developer. The way it is used is quite mysterious, in the sense that I would never have guessed it. To use git, you first install the software once, and initiate any folder as a repository (“repo”). You initialise a folder with this command entered into the command line (called Terminal, if you’re using Mac):

$ git init

After that, for every file you create and modify in that folder (now recognised as the “master branch”), the breadcrumbs are collected automatically by git, and you can choose to either “commit” these changes into the official record of your repo, or discard them. You do that with the following commands, again at the command line:

$ git add <newly created or modified folder or file name>

$ git commit -m “message describing the changes”

Here, the last thing to do and also where GitHub comes into the picture is to push the changes to GitHub. GitHub is essentially your repo in the ‘cloud’ (ie. a portion of a remote database accessible through the internet):

$ git push origin master

And whooosh, just like that, your project source code, together with your every batch of addition/change to the code, are sent to some server you will probably never see in your life but will continue to have access to whenever you want. And if you use GitHub’s free account, it will all be available for other users to “fork” (ie. copy) and use with attribution. (Forking will copy over the commit history too, so people can see the contributors.)

I think that’s all factual information so far. There’s still many more features of both git and GitHub that I’m sure I don’t yet know of, but I’m really excited to pick some of them up soon. Using these software helps me see the organisational elegance that can exist in any project, code or not.

And if the recent uploading of the original Apollo 11 space program’s source code to GitHub is any indication of the future, it’s also going to help in recording history!

Other noteworthy things I’ve read today:

This post is part of my 30-day commitment to write daily about my journey learning something technical everyday. You can see my other posts at Getting Technical.

Enjoyed reading this? You can read my previous post here. Also, recommend this by hitting the ❤ button below so your friends and followers can read it. Thanks!

--

--

Nick Ang
getting technical

Software Engineer. Dad, rock climber, writer, something something. Big on learning everyday.