So You Want to Learn to Code

I’ve been getting a lot of inquiries recently asking a lot of similar quesitions. Often these questions are broad and hard to answer in an email or a DM, so I’ve decided to use my free time no longer taken up by watching sports to write a series of blog posts to answer them as best I can.

One of the big ones I keep seeing over and over again is “What are the best resources to learn to code?” or “How can I get started coding?” Questions like these are very hard to answer because everyone learns differently and what some find easy others may find dificult. This post will focuse on resources I’ve found helpful in teaching myself to code. Will they work for you? Maybe, or maybe not but a lot of these are used/recommended by others so I’m hoping they work for you.

Getting Started

So the first step is to pick a programming language to learn. Which language should you pick? It really doesn’t matter, the key is to stick with it long enough to learn it well because once you do the same ideas will carry over from language to language. Most people asking me are wanting to learn a programming language in order to do some type of “analytics”. This post will generally tackle things from that view point, but I’m going to include some frontend resources (skills also very important in analytics though for different reasons) in case someone is interested.

Two of the most popular langauges in analytics is R and python. Which one should you choose? Again it doesn’t matter, just pick one and learn it! This part is going to take some time. You’ll be doing a lot of boring stuff just to learn the basics of the language before you can start working on the cool stuf. But don’t get discouraged and stick with it! The key to learning things isn’t smarts, but rather time, so keep chipping away at it every day.

Disclaimer here Python is my language of choice. It’s what I use for everything I do so I’m a bit biased in favor of it. However, that doesn’t it make it perfect by any means so if you decide its not for you don’t feel bad. In fact I started learning R, didn’t like it, and then switched to Python. So if you’re just starting and you don’t like it then don’t fall for a sunk cost fallacy. Switch things up and see if other languages are easier to grasp

One link I’ll start out with is Code Academy. It has a bunch of intro lessons for all sorts of languages. And its a site that if I need to learn a new language and they have a lesson on it I always go through that lesson. There is premium content but most of it is free and its enough to get you started with any language you want to learn.

Beginner Python Resources

One of my favorite beginner python books is Automate the Boring Stuff by Al Sweigart. Not only is it good for beginners, the problems it uses to teach you programming are problems you’ll need to solve as a programmer. Things like file manipulation, web scraping, and working with spreadsheets in python are all skills you will need in analytics and this book does a great job of breaking things down. If you make it through the entire book you’ll come out the other side with enough skills in python to do whatever you want next.

The next I recommend if you don’t like reading is a class on EdX taught by MIT called Intro to Computer Science and Programming using Python. It is a more broad course that focuses on important Computer Science ideas like loops, recursion, functions, and objects. These are all very important ideas to learn and know when learning programming as the translate to almost EVERY programming language and are a shared vocabulary. Even if I program in Java and you program in Python, I can say I did this by writing a for loop you’ll know what I mean and could replicate it in your own language as well.

Beginner R Resources

I’m not as familiar with R but I have learned it and can work in it, but others may have better resources than me. If you know something better for beginners then let me know [email protected] and I’ll add it to the post.

The course I used to mainly use R was this one from Udacity I took while working on my Data Analyst Nanodegree from them. Data Analysis with R is a free course you can go through all the lessons. I highly recommend it, and anything else from Udacity as well researched that will give you a good coverage of the basics to build on.

The next package I used is the Swirl Package. This is an interactive package that will allow you to learn R while running R. So its similar to the Code Academy courses I posted above just not on a website.

Lastly I found this site while researching this post. Disclaimer I haven’t worked through it but it seems free and the first three lessons I skimmed through are very informative. If you go through it and had a bad experience let me know and I’ll change my review on it. This site R Tutorial for Beginners even goes over the install process for R as well which could be very handy as well.

Other Resources

One other site I worked on when I was first starting out was Free Code Camp. Its focus is mainly frontend design using javascript, but that still contains a lot of good knowledge that has come in handy a lot of times for me. They also have a good blog that posts articles about learning to code, tutorials, and about coding in general. All of it is well done and they have a great community focused on learning and beginnings. Even if you don’t want to do Javascript some of their stuff on coding philosophies is worth the time to read.

As an example here’s an article that goes in depth on the broad concepts of what programming is that you might find interesting if you are first starting out.