<commit_before>---
layout: post
title: Tips for Self-Learning Programming
date: 2016-12-10 15:51:53.000000000 -07:00
---
My friend who's learning programming asked me the other day: 'What do you recommend to learn programming quickly?'. I learned programming by myself when I was in college, and over the years I've realized how I went about it in the complicated hard way possible. There are many things I could have done to learn at a much faster rate. Hence, I thought I'd look back and write down some of the things I've learned over there years about learning how to program.

### 'Quickly'

I really like the question, but I don't know how I feel about 'quickly'. I think by following the advice below you'll learn programming fairly quickly (at least your growth/progression will be fast), but you shouldn't really try to hack your way around it. Trying to hack it or fake it will come to bite you in the ass later on. The only way to learn 'quickly' that is actually sustainable is perhaps taking the language immersion approach. Find a way to immerse yourself into programming for an extended period of time (months?). In order for this to work, you need to be constantly pushing yourself to learn new things and get unstuck quickly.(This is one advantage of coding bootcamps. You won't be an expert when you come out, but you'll learn much faster. This can be replicated through having a dedicated mentor or learning with a dedicated group of beginners).

### 1. Read > Write Code > Read > Write Code (on a daily basis)

The first piece of advice I would give to efficiently learn how to program is to go back and forth between reading about code and writing about code. Reading about code (books, blog posts, open-source code) will help you see solutions, understand best practices, and get a general understanding of a language or a system. But after you do that, you need to actually go and write code. It can be anything. It can be little coding exercises or side-projects, but make sure you put that into practice and somehow use what you've learning by making it your own. If you don't do that, then you will find yourself in front of an editor having no idea what to do.

The trick here is for it to feel uncomfortable. This is also rather painful. Coding follows the 80/20 rule. You spend 80% of your time on 20% of your code or 20% of what you're learning. Getting using to this uncomfortable feeling and overcoming it is key.

This should happen not on a week by week basis or on a month by month basis, but on a day to day basis. The more you wait to use those skills, the more they will dull out. The more you wait to learn something new, the more missed opportunities you'll have to incorporate that into your code.

Perhaps the best site to start reading about general programming topics is [lobste.rs](lobste.rs). They have a huge variety of articles on many programming topics. The other good site is [Hacker News](new.ycombinator.com), but sites tends to go off-topic fairly frequently.

### 2. Don't get stuck. Ask for help

My biggest mistake when learning how to program was this. I would spend so long getting stuck on something either silly or something that I fundamentally did not understand. It would sometimes take days for me to get over some of these and I could have done some much more with my time and learned so many more things if I had just found better ways to get unstuck. Basically, getting stuck for more than an hour on something is almost always a waste of time.

I recommend three things for getting unstuck. The first one is trying to always read more about the technology you're using and getting a general grasp of what's going on. Usually, when you're stuck it means you are making incorrect assumptions about something that need to clarified. Second is consulting the internet. This one is pretty obvious but worth saying. Looking up online for people who have this problem is a hugely important skill. [Stackoverflow](www.stackoverflow.com) is arguably the best site on the internet for this. Don't be afraid to actually ask your own questions in there. Often, just trying to correctly formulate your questions is extremely helpful. I wish I had done that a lot more in the past, but was always to afraid that my questions would be stupid. Third suggestions is just asking someone you know for help. Often, you might understand the technology and have a question, but you might not be going through the right path or might need higher-level context in order to really get unstuck. Always go ahead and do that.

When learning Docker, for example, I spent a RIDICULOUS amount of time re-building images from scratch. I fundamentally did not understand the docker cache and would spend 20 minutes waiting for a single change to a Dockerfile to come through. If I had just read up a bit more on Docker or asked someone who knew, I would have understood this and probably learned a lot more in a shorter amount of time.

### 3. Work on projects

In my experience, there is nothing as helpful to learning programming as working on your own projects. With some exceptions, all the really good programmers I've ever known have a habit of working on side projects (which can be part of your job too!). Having an idea and trying to implement it is incredibly challenging. It takes a lot of discipline to try to do it. But, by trying to actually make something, you learn how to break down a problem and apply technology to it. The sort of problems that you face and how you get around them is really what programming is all about. Knowing every quirky detail about a programming language will help you, but it'll only get you so far. Also, the drive to want to finish your project is what will give you the motivation to keep learning. The satisfaction you get from a side project is much more than the satisfaction you get out of learning about some abstract topic.

My advice for picking side projects to work on would be to pick something that interests you, but also something that you'd more or less have an idea about how to implement. Being able to articulate implementation before starting was always helpful in keeping me motivated. You'll definitely learn a lot along the way!
<commit_msg>Updating URLs<commit_after>---
layout: post
title: Tips for Self-Learning Programming
date: 2016-12-10 15:51:53.000000000 -07:00
---
My friend who's learning programming asked me the other day: 'What do you recommend to learn programming quickly?'. I learned programming by myself when I was in college, and over the years I've realized how I went about it in the complicated hard way possible. There are many things I could have done to learn at a much faster rate. Hence, I thought I'd look back and write down some of the things I've learned over there years about learning how to program.

### 'Quickly'

I really like the question, but I don't know how I feel about 'quickly'. I think by following the advice below you'll learn programming fairly quickly (at least your growth/progression will be fast), but you shouldn't really try to hack your way around it. Trying to hack it or fake it will come to bite you in the ass later on. The only way to learn 'quickly' that is actually sustainable is perhaps taking the language immersion approach. Find a way to immerse yourself into programming for an extended period of time (months?). In order for this to work, you need to be constantly pushing yourself to learn new things and get unstuck quickly.(This is one advantage of coding bootcamps. You won't be an expert when you come out, but you'll learn much faster. This can be replicated through having a dedicated mentor or learning with a dedicated group of beginners).

### 1. Read > Write Code > Read > Write Code (on a daily basis)

The first piece of advice I would give to efficiently learn how to program is to go back and forth between reading about code and writing about code. Reading about code (books, blog posts, open-source code) will help you see solutions, understand best practices, and get a general understanding of a language or a system. But after you do that, you need to actually go and write code. It can be anything. It can be little coding exercises or side-projects, but make sure you put that into practice and somehow use what you've learning by making it your own. If you don't do that, then you will find yourself in front of an editor having no idea what to do.

The trick here is for it to feel uncomfortable. This is also rather painful. Coding follows the 80/20 rule. You spend 80% of your time on 20% of your code or 20% of what you're learning. Getting using to this uncomfortable feeling and overcoming it is key.

This should happen not on a week by week basis or on a month by month basis, but on a day to day basis. The more you wait to use those skills, the more they will dull out. The more you wait to learn something new, the more missed opportunities you'll have to incorporate that into your code.

Perhaps the best site to start reading about general programming topics is [lobste.rs](https://lobste.rs). They have a huge variety of articles on many programming topics. The other good site is [Hacker News](http://news.ycombinator.com), but sites tends to go off-topic fairly frequently.

### 2. Don't get stuck. Ask for help

My biggest mistake when learning how to program was this. I would spend so long getting stuck on something either silly or something that I fundamentally did not understand. It would sometimes take days for me to get over some of these and I could have done some much more with my time and learned so many more things if I had just found better ways to get unstuck. Basically, getting stuck for more than an hour on something is almost always a waste of time.

I recommend three things for getting unstuck. The first one is trying to always read more about the technology you're using and getting a general grasp of what's going on. Usually, when you're stuck it means you are making incorrect assumptions about something that need to clarified. Second is consulting the internet. This one is pretty obvious but worth saying. Looking up online for people who have this problem is a hugely important skill. [Stackoverflow](https://www.stackoverflow.com) is arguably the best site on the internet for this. Don't be afraid to actually ask your own questions in there. Often, just trying to correctly formulate your questions is extremely helpful. I wish I had done that a lot more in the past, but was always to afraid that my questions would be stupid. Third suggestions is just asking someone you know for help. Often, you might understand the technology and have a question, but you might not be going through the right path or might need higher-level context in order to really get unstuck. Always go ahead and do that.

When learning Docker, for example, I spent a RIDICULOUS amount of time re-building images from scratch. I fundamentally did not understand the docker cache and would spend 20 minutes waiting for a single change to a Dockerfile to come through. If I had just read up a bit more on Docker or asked someone who knew, I would have understood this and probably learned a lot more in a shorter amount of time.

### 3. Work on projects

In my experience, there is nothing as helpful to learning programming as working on your own projects. With some exceptions, all the really good programmers I've ever known have a habit of working on side projects (which can be part of your job too!). Having an idea and trying to implement it is incredibly challenging. It takes a lot of discipline to try to do it. But, by trying to actually make something, you learn how to break down a problem and apply technology to it. The sort of problems that you face and how you get around them is really what programming is all about. Knowing every quirky detail about a programming language will help you, but it'll only get you so far. Also, the drive to want to finish your project is what will give you the motivation to keep learning. The satisfaction you get from a side project is much more than the satisfaction you get out of learning about some abstract topic.

My advice for picking side projects to work on would be to pick something that interests you, but also something that you'd more or less have an idea about how to implement. Being able to articulate implementation before starting was always helpful in keeping me motivated. You'll definitely learn a lot along the way!

{'fraction_non_alphanumeric': 0.03395653563438798, 'fraction_numerical': 0.006711409395973154, 'mean_word_length': 4.198089700996678, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3015753', 'n_tokens_mistral': 2912, 'n_tokens_neox': 2740, 'n_words': 2179}