The Terror of Typing “git init”
By: Diana Giulietti
Tags: Git, Programming, Conda, Command Line

Photo by Engin Akyurt from Pexels

The act of programming isn’t typically thought of as “dangerous”, but the two scariest skills I’ve every learn are how to weld and how to work like a programmer… and maybe not in that order…

When I was learning how to weld, my welding guru explained that the first handful of welding sessions have nothing to do with learning how to weld, but rather getting accustomed to the action of welding. Welding is an energetic process, and that energy can be intimidating and mysterious. When you weld, you wear unfamiliar, bulky protective gloves and visually restrictive face-shield. You have to get the set up sequence just right, lining up your metal wire to the work piece and then flipping your face-shield down without moving any other muscle. Then you start the electric arc while blind, the filter of your face-shield blocking out normal light, and you just hope haven’t moved a muscle even though you’re trembling a little bit. First you see a flash, then you hear a zappy **tssssssz* of the arc and the air starts to smell like iron and electricity. All you can see then is a little orange glow of molten metal (if you’re lucky), shaking from your quivering hand.

Even if your head understands what’s going on, the physical action of welding the first few times is shocking to the body. And it’s the same way with programming and developing.

— — —

I recently started a data science boot camp. It’s already been enlightening for many reasons, but mostly because this is the first time I’ve really been in a group programming environment. A lot of students have enrolled in this program to become more comfortable with programming, so the instructor has design the course to go over Python basics and common-place programming tools. Since I started my programming journey about a year ago, I don’t really think twice about loops and conditional statements or about tools like git, GitHub, and Conda. But one of my classmates said something that instantly transported me back to the first couple months of taking HarvardX’s CS50:

“the most stressful moments of these classes for me are the first 5 when I have to open everything…”

This statement may be said following up with an “lol”, but back in a beginner headspace, opening a terminal and typing in a command elicited the same kind of fear I felt learning how to weld. I know rationally that I’m not nearly in as much danger as I might be if something goes wrong welding (yes, I shocked myself several times), but emotionally, the fear felt the same. What if I didn’t type the commands in the right order? Why do I need to write all these weird git commands anyways? What if I type something without really knowing what I’m typing and my computer explodes?

Unfamiliar tools. Intricate sequences. Intimidating and mysterious.

Looking back, I don’t think there was a massive turning point where suddenly I learned the last thing I needed to learn to grow comfortable with Command Line Environments (CLIs) or with git and GitHub. Instead, again like welding, I just needed to do it enough times, making a few silly mistakes along the way (at least it’s not a shock), and these tools / workflows became second nature…

Want to conquer your fear of programming tools? Use them as much as you can. We often think of programming and data science as a purely cerebral process, but in actuality, there is some type of muscle memory that is formed as you grow more comfortable with the tools of the trade. I’m here to let you know, you can do this. Expect to break things but do so on these smaller introductory projects so you don’t repeat those mistakes on big important projects. Be patient with yourself. At some point, using CLIs, git and other developer tools like Conda will become as trivial as writing in Word or Excel; two months from now, you’ll be looking back in amazement of how far you’ve come.

— — —

Looking for sources on learning developer tools?

All programmers work in the terminal. The blinking white cursor may be scary to you, but soon you’ll feel the power at your command. For general CLI commands, this Command-Line Basics article from alligator.io gives a thorough review of all the commands for navigating your file structure within a terminal. This is step one of getting comfortable with a CLI. After that, there is creating files and directories, working with files and with directories, and searching for files and directories.

You might not feel this way now, but git will save your butt someday. This guide on Everyday Git is perfect for distilling down to barebones git commands you’ll use as a solo developer (where most people start out). Seriously 80% of my git command flow looks like this:

git init

git status

git add .

git status

git commit -m "COMMIT MESSAGE HERE"

git log

Not very intimidating when you see it listed out like that. When something goes wrong with you code, that’s when you’ll Google how to roll back to a previous commit or how to create a separate branch.

Now, as your code gets more complex (looking at you, aspiring data scientists and machine learning designers), you’re going to need tools that can manage packages and virtual environments for you. There are many way to do this, but Conda is an all-in-one tool which it widely use. I’m a visual learner, so here’s a great under-30 minute YouTube video which will get you up and running with Conda quickly. One word of advice: it really doesn’t matter if you install full Conda or miniconda. I remember getting stressed about making this decision when I was first installing Conda. Full Conda comes with some common packages pre-installed, but you’re super savvy and will be making a new environment with specific packages for any project you start, so it’s not necessary. If you’re not a visual learning, or if you just want more information, here’s Conda’s guide on getting started.