Learning to Code 1: Introductory Yak Shaving

There’s a lot of talk about how you need to learn to code. You’d have more job security, make more money, and be able to change the world with your ideas, or at least be slightly more prepared for when the robots take over. So you find an introductory programing course, free, paid, online, wherever.

Perhaps you’ve done this many times before, in all kinds of formats, and have learned a little bit here and there over a long time, but are still far from calling yourself a coder. Maybe you’ve been running into a similar obstacle to the one I’ve hit, so I’ll share what is working for me:

I’ve learned to love Yak Shaving.

picture of yak you must shave before you learn to code

There’s the Easy Way

How to Code courses can be broadly divided into two camps. In the first, you go to a cozy environment the course creators have made, and it makes it easy for you to focus on the concepts in the course. Great! This kind of course gives us an understanding of what a developer does to make things work. It helps us understand things better and communicate better when we are working with developers.

But we aren’t learning to be developers. Our code is stuck in this little bubble that made it easy for us to learn. If we are going to reap all the benefits of learning to code, we need to be able to get our code to where it can do more than go through an automatic marker. This leaves the second type of course, where you have to install all of the stuff a developer uses to work in that language. Instead of a cozy, ready to go environment, you have to make your own.

And the Better Way

Making things in an environment we make ourselves is great, because we are learning to do things with similar or identical tools to what professional developers use. We can study and test all kinds of things, and can get as good as we want, or as good as we need for the job we want, in countless areas of programming.

But it’s also like starting a vacation in the woods with cottage blueprints and a heap of lumber.

And the blueprints are for Mac, but your clearing in the woods is Windows. Then you get bit by a weird bug. You Google up something about a patch that requires more knowledge of your OS and of the language you are trying to learn than you’ll know at the end of the course, let alone the beginning.

Whatever help system is setup, from TA to volunteer forum respondent to the 1–800 number on the metaphorical blueprints, will probably say “Yeah we can’t do support on local environments, but if you run thingYouWantToLearn in Linux on a VM it will work just fine,” which is great if you already know how to set up an environment on a Virtual Machine.

Note that there is a third way, that’s comparatively new, that changes this paradigm. I’ll do a future blog post on it. For now, we’re going to do things the tried and true way.

Sometimes, Usually the 20th Time or So, You Catch A Break

At this point, you already put a lot of time into learning about running an environment on your main operating system, and you’re being asked to learn a new, different, and complicated sounding process. This will involve putting a second ton of time into learning something that is completely unrelated to your goal. And the first assignment is due, so you drop out before the impact on your marks/schedule/work/sanity gets any more significant.

I’d love to say I broke this pattern out of my increasing wisdom, maturity, or dedication, but it might be a lot simpler than that. The last time I was learning to program, I was enjoying the course a lot, and got pretty far in, before I found the crazy bug that stopped me in my tracks, I didn’t want to drop out, and was far enough ahead to look into this VM solution.

It also helped that, this time around, a friend and brilliant coder, Nick Kenyeres, https://www.knicklabs.com/ was the one that told me to go this route. Below, I share the resources he shared and some others I found helpful, in the order you’ll need them to make your own development environment on a Virtual Machine.

For now though, there is a much bigger step you can take, that will shift your whole mindset on learning to code.

Doing Stuff Unrelated To Coding So That You Can Code Is a Core Part of Coding

Instead of feeling like the time I put into the peripheral setup of taking coding courses is a waste, I now accept that this is in itself part of process, not just of learning to code, but being a developer. When we do this, we are joining real programmers in something so common that they have a name for it.

We are Yak Shaving.

I’d heard this thrown around and thought it meant doing any series of menial tasks, but I came across some similar meanings with important nuances.

In one meaning of the term, if you can’t code something until you do seemingly unrelated task A, and can’t do A (install the software you are trying to learn) until you are done seemingly unrelated task B (make the right development environment), until you are done C (choose the best version of Linux for your environment), and so on and so forth, you are Yak Shaving.

And for now, I say we should be proud to shave the yak.

Maybe down the road we can get frustrated about having to do all this other stuff instead of actual coding, but I’ve suddenly gotten very excited about upping my Yak Shaving game. For the time being, getting better at making an environment where I can create and test code, and managing, sharing, and implementing that code, are as important to me as getting better at any given language.

hedge trimmer for Yak Shaving

Tips & Resources for Introductory Yak Shaving

Here are some resources and tips that helped me overcome some of the first Yak Shaving humps.

Until you are reasonably confident in your VM creation and management skills, stick to self-paced courses. If you need to stop and redo something, or do something new, you can take all the time you need to get back on track.

Avoid analysis paralysis. A lot of course providers rightly want to be platform agnostic, so they’ll tell you to set up “a Virtual Machine” running “Linux” or, even more confusing, “any Unix-like operating system.” Deciding which Virtual Machine to use, and even worse, which Linux, are complicated questions that involve a lot of personal preference. If you have no idea where to start, try the latest Long Term Support (LTS) version of Ubuntu running in the latest version of VirtualBox.

You’ll also want to set up a Shared Folder if you want to move files between the VM and your physical computer. Newer versions of VirtualBox make this a point and click affair.

We can’t point and click forever though. You can’t make very much of your virtual Linux environment unless you are using the BASH prompt in the terminal. There are some solid tutorials about this on Youtube, but I found a course that covers it inadvertently.

Yak Shaving Your Github

Another practice peripheral to coding is using a version control system, so that you can work with other coders, without breaking each other’s work. Git is a popular one, and by using the online Github service, you can learn how to use it while backing up what you make on your virtual machine. As you have more impressives piece of code to put on there, you can use it as a portfolio of what you’ve learned, and eventually, what you’ve worked on.

I grabbed a Stack Skills Learn to Code bundle through the Boing Boing Store for $20, which includes “Git Complete Mastery with GitHub.” While I don’t feel that I’m a complete master by any means, I can do the basics, and I couldn’t before. Also, while learning Git(hub) stuff in this course, you learn a lot of basics about moving and copying files and directories in the terminal.

Looking for that course on it’s own, it’s on a variety of sites, at prices between $15 and $210, so grab the bundle, or shop around.

I hope that helps you get into, and take pride in, your Yak Shaving. Let me know in the comments if you run into any hurdles or have some advice to share about overcoming your learning to code challenges.

Originally published at Small Web Strategies.