How to Learn Programming Online

Learn to Code - Or Else WARNING: This “Learn to Code” article is a work in progress…

Edit – 7/8/13: I must be slower than I imagined. This thread on Quora implies that you can learn some of these skills in one day. Good luck with that. I think I’m on the ten year track.

Introduction

I built my first website when I was eleven years old using a book called “Learn HTML in a Weekend”. Fifteen years later I’m teaching myself programming using (mostly free) online resources.

I’m going to use this blog to outline my experience and hopefully inspire you to learn how to code. This guide will be updated frequently as I gain experience and figure out the best way to learn all these subjects. If you want to dig right in feel free to jump ahead to the table of contents.

Why Should I Learn How To Program?

1. You have an idea for an app, digital product, or custom software but can’t afford a programmer.

2. You will be replaced by a computer—eventually. Why not learn how to replace yourself?

3. You work in social media, but don’t know what an API is…

4. You’re in digital marketing/digital media and you don’t know basic programming. You’re a sitting duck.

5. Programming is a highly marketable and in-demand skill.

6. Software is “eating the world.” Is your industry next? Are you hungry?

7. Your a project manager, or product manager and you work with developers. How the hell do you effectively manage developers if you know nothing about code or programming. Learn the basics.

8. You’re a knowledge worker. You spend 90% of your working hours on a computer. While learning programming you’ll improve your understanding of the machine you rely on to get your job done. You either run the machine or it runs you.

9. You’re an entrepreneur and programming skills are your secret weapon when applied outside the tech / digital industries. There are prime opportunities for innovation in old, un-sexy industries (think insurance, real estate, trades, etc.).

10. You own a small business and want to automate mundane tasks or improve your processes.

11. You have a mostly worthless business degree (or liberal arts /etc) and now you need a job. Software development is growing at a tremendous rate. Check out some stats from the Bureau of Labor Statistics.

I like building things. I like making something from nothing, with my hands or my mind. I’m creative. Building a business or a product is a creative pursuit. I want to learn programming so I can bring my ideas to life.

A Marketing Guy Gets Technical

I’m a marketing guy.

I know how to drive traffic. I know how to convert traffic. I know how to write copy. I love analyzing data in excel. I’m working on an article on how to learn marketing without going to college for this blog.

I live and breathe acronyms like CPL, CPA, MRR, CLTV, and ROI. I’ve designed landing pages in HTML and CSS. I know CRO and analytics.

I’ve developed custom Joomla and WordPress websites (like this one), Shopify E-commerce sites, static sites on frontpage/dreamweaver (a long time ago), etc.  I’m pretty good at copying and pasting jQuery snippets. But I don’t have a concrete understanding of programming languages or the underlying infrastructure of the internet…And I want to. I have an insatiable drive to understand “how did they do that?”

About 6 months ago I read Andrew Chen’s Growth Hacker article. I knew I wanted to sharpen my internet swiss army knife. Sure I can build websites, manage PPC campaigns, buy media, drive traffic with SEO and content marketing, and increase revenue with social media…But I want more. More knowledge, more flexibility, more understanding, more skills. My ideas almost always outpace my ability. So I either need to find someone more able, or learn it myself.

Hence, my desire to step up my game and learn programming to pull all of these disciplines together.

The Best Free Ways To Learn Code Are Not Free

Stop right now if you think there is one best free way to learn code online. Tuck away your keyboard, shut down that laptop, and turn on the tv if you think this is going to be easy.

It’s not easy, and it’s certainly not free.

You’re going to spend a lot of time staring at a computer screen. You’re going to have to cancel plans with friends, family, and your girlfriend or boyfriend. You’re going to have to skip that concert, not watch the football game, and lock yourself indoors during the beautiful summer months.

Unless you’re a genius. And you are probably not, or you’d already know how to code. So get ready to dig in and I hope you’re in it for the long haul.

Good luck.


How to Learn Programming Online – My Curriculum

TABLE OF CONTENTS

How to Learn Programming Online – Intro

Section I. Programming Foundation

1. Basic Computing Principles

1.1 Command Line Basics / Shell

1.2 Linux Basics

1.3 SSH / FTP

1.4 Shared Hosting Environments

1.5 Virtual Private Servers

1.6 DevOps / Continuous Integration

1.7 Licenses & Legal Issues

1.8 DNS Basics

Section II. Local Development Environments

2. MAMP / XAMP

2.1 Virtual Host X

2.2 Vagrant

2.3 Oracle VirtualBox

2.4 Chef

2.5 Packer

2.6 Capistrano

III. Tools

3. Vim

3.1 Sublime Text 2

3.2 Codekit with Compass

3.3 Yeoman

3.4 Git

Dev Ops / Sys Admin

Databases & SQL

MySQL

Semantic Web / Microformats

Microdata
Microformats
RDFa
Rich Snippets / Schema
Regex

Front End Development

HTML5
CSS3
SASS
Javascript
Mobile First / Responsive Design

Back End Development

Python
JSON
PHP
Ruby
Liquid
APIs

Web App Frameworks

Ruby Frameworks
PHP Frameworks
Python Frameworks
Javascript Frameworks
CSS Frameworks

Web App Platforms

Heroku
Amazon Web Services
Google Apps Engine

CMS Platforms

WordPress
Joomla
Ecommerce (Spree / Shopify / Magento)
Expression Engine
Refinery CMS

Appendix / Resources

Appendix I. – Free Sites For Learning to Code

Appendix II. – Paid Sites for Learning to Code

Appendix III. – Code Cheat Sheets


Learn Basic Computing Principles

When I first started I thought I understood how my computer worked.

After all I was the go-to guy for tech problems. I could re-flash the firmware on a router, I could setup a home or office network, I could network printers and reformat a hard drive etc.

It turns out I didn’t know much.

And now I’m backtracking and hoping that the concepts in the course below will pull a lot of the things I learned together. I wish I took this course a long time ago. The creators of the course taught it as a CS101 at Harvard.

But I didn’t know how little I knew until someone asked me what the processor in their computer does and why its important. I couldn’t explain it in simple terms. I couldn’t help them make a decision on which processor would be best for them and their unique needs.

I had no understanding of how the computer actually works. No background in hardware or architecture.

That’s why I decided to take the “Elements of Computing Systems” course, also known as From NAND to Tetris. I’m still waiting to receive the book and will outline my experience in the next few weeks. After reading the introductory chapters available on the website it looks like you have to know a programming language to make it through some of the course projects. They recommend java or python.

It just so happens that I’m concurrently learning python…though struggling to grasp the basic concepts as I find myself having to learn other things to solve high priority problems and put out fires.

1.1 Learn the Command Line

When I was about 11 or 12 I knew how to use Microsoft DOS. I don’t remember what I used it for, but I used it. Somewhere between then and now I lost those skills. So when I set out to learn programming I didn’t realize I needed to learn the command line (AKA shell), which seemed similar to my childhood DOS days.

The command line is where the magic happens.

It’s where productive coders spend their time. It strips away all the unnecessary fluff your accustomed to and just gives you “the shit you need.”

I like that.

So I like the command line. But I didn’t use it until I started learning GIT. So I missed out on a lot of fun, and a lot of things didn’t make any freakin’ sense…Like linux. Linux made no sense. After poking around on the command line for the last six months or so I’m starting to get it. And you will too. I promise.

Just don’t give up.

Make yourself use the command line. It will be hard. It will make some projects take three times as long as you estimated. You will delete things by accident, and screw up your GIT repo. It’s part of the process. Just enjoy it, and keep forcing yourself to use the command line.

One note: I didn’t really study the command line. I just made myself used it. When I needed to do something I googled and learned the command. After a few months I started to put the commands into Anki and created a set of flash cards. I didn’t study them often. I used the command line to navigate directories instead of Finder, I used it to SSH into my servers and abandoned my comfortable FTP apps, I used it to deleted, open, and move files. I’m trying to make a point here:

JUST USE THE FUCKING COMMAND LINE MOTHERFUCKER.

That’s the only way to learn it. Just do it, and use these resources as a reference.

Here are the resources I used to learn the command line:

iTerminal If you have a Mac go download iTerminal. Don’t think about it. Just do it.

Learn CLI the Hard Way A classic shell primer.

This article by Team Treehouse was helpful.

A Practical Guide to Linux… I rented this book from the library. It clarified some things for me. You’ve really gotta learn linux and shell at the same time to understand them.

Fish Once you get going, install this tool. Why? One word: autocomplete. It remembers you most frequently typed commands and reads your mind. Awesome.

 

1.2 Linux Operating System Basics

Introduction
The Kernel
Distributions
Users and Groups
Networking

Linux is a free and open source operating system. It’s widely used by technology enthusiasts as their go-to operating system for personal computing. Linux also runs many of the internet’s web apps, web sites and popular web services. Among other things, linux is the base operating system for android and its cousin Unix is the base for the Apple’s OSX.

Only 15 years ago linux was a fringe OS. Windows was the dominate player. With the rapid rise of mobile computing and the concomitant downfall of the desktop, Linux has no outpaced Microsoft Windows. This is mostly due to the fact that Google’s Android OS runs on a linux kernel.

1.7 Licenses and Legal Issues

Here’s something not frequently mentioned in the “learn to code” propaganda: licenses. Code is intellectual property.

1.8 DNS Basics

DNS stands for domain name system. When I first started building websites the complexities of the DNS were abstracted away by my domain registrar and website hosting company. Things were easy. When I needed to host a new domain I simply purchased it, entered the domain name server information provided by my host and that was it. My hosting company had their own name servers and everything just worked.

After some time I realized that DNS is important, especially for performance. Visitors come to your website from all over the world. To minimize latency its important that their request is directed to the name server that’s closest to their location. That’s why some websites use DNS providers like Dyn, CloudFlare, or DNS Made Easy. This website uses CloudFlare. Cloudflare has a global network of domain name servers that intelligently routes traffic to your web server. They also provide best in class filters to block malicious traffic, protecting your website from spammers, hackers, and others with bad intentions. The lesson here is: if you want to optimize for speed, performance, and safety, use a DNS provider like Cloudflare.

The Domain Ecosystem

Domain Registry
The domain registry is the master list of all domains and their corresponding owners. Domain registries are handled by IANA (Internet Assigned Numbers Authority). IANA delegates authority to registry operators like Verisign to handle different TLDs. Most people never interact with registry operators, instead they purchase their domains from a domain registrar.

Domain Registrar

A domain registrar, like GoDaddy, is a place where anyone can purchase a domain. The domain registrar handles the transaction with one of the domain registry operators on your behalf and charges you a fee for this service. The domain registrar’s interface is where you go to tell the registrar what domain name servers you’ll be using. Many registrars like GoDaddy and Namecheap have their own DNS hosting. Just be aware that domain registration and DNS hosting are two unique services. Choosing a quality DNS hosting provider is important if you want to achieve peak performance for your website or application so don’t leave this up to your hosting provider.

Root Name Servers
A root name server for the DNS system’s root zone. There are 13 root servers located all over the globe that keep track of root zones. The root servers are maintained by ICAAN. For more information about root servers click here to visit ICANN’s website or read the wikipedia page on root name servers. Root servers are a vital part of the internets infrastructure because they are the first step in resolving a domains (or hostnames’s) IP address.

Name Servers

Types of Top Level Domains (TLDs)

There are three types of top level domains:
1. country code domains like .ca, or .uk.com
2. generic TLDs like .com or .net
3. infrastructure TLDs

A domain name is made up of three parts:
1. subdomain
2. domain
3. TLD

For example the URL www.facebook.com
www = subdomain
facebook = domain
.com = TLD

All three of these parts combine to make up the Fully Qualified Domain. It is a common convention that FQDs are terminated by a full stop character (aka the “.” symbol). However, modern DNS software does not require the period when the FQD is entered into your browser.

TTL – Time to Live

DNS records are cached for a period of time after a request is received to increase the speed of response to a given request. The amount of time the DNS records remain in the cache is determined by the TTL. TTL and DNS in general are very complex subjects. If you’d like more information please visit wikipedia’s article on TTL. For our application is useful to know that when your relocating a website (changing its domain), changing name servers or IPs you should set the TTL to the lowest possible value. After your development or move is complete and your site is in production, its a good idea to increase the TTL so that DNS records are served from the cache.

DNS Resource Record Types

A Records
A records map hostnames to an ip address. If you manage your own virtual private server you’ve probably adjusted an A record before to point your domain at your servers IP. A records are also useful for creating sub domains or wild card records.

MX Record
An MX record, or mail exchange record manages the routing of email by allowing you to specify a mail server for sending email messages and priorities for receiving email messages. Many DNS hosts and even domain registrars have templates MX records that work with popular email services like google apps. My advice is to use google apps and keep it simple.

TXT Record

The TXT record provides text information to resources outside of your domain and is used for many purposes.

One of the most common application is a SPF record, or Sender Policy Framework. SPF is a type of email validation used by mail servers to combat spam and email spoofing by verifying the sender’s IP address. If your using Google Apps or an email marketing service like Mailchimp that sends email on your behalf you will want to make sure you have an updated SPF record. For more information on email marketing best practices see my guide to email marketing here.

Another type of TXT record is the DKIM record or domain keys identify mail record. DKIM provides a method for authenticating the identity of a domain name that is associated with an email message. Again, setting up a DKIM record is a good practice is your outsourcing email or doing email marketing. You may see improvements in delivery rates when utilizing SPF and DKIM records.

 

CNAME Record

The canonical name record is used to create aliases for domain names and can be used to point multiple sub domains at your web server instead of using A records.


PTR Record

A pointer record helps determine that a domain name is associated with a given IP address. PTR records are also called reverse DNS records as provide a mirror to the A record. In other words, a PTR record resolves an IP address to a FQDN, where an A record resolves a FQDN to a IP address.

PTR records are mainly used confirm  that the server name is actually associated with the IP where the connection was initiated from. PTR records are important for email validation and delivery.  A PTR record follows this syntax:  [reversed IP Address].in-addr.arpa. So if your servers IP is 4.3.2.1, your record would be 1.2.3.4.in-addr.arpa.
You can check your PTR records with a tool like MxTools.


SOA Record

The start of authority record is the first entry in the DNS zone file. SOA records are used to determine how your zone propagates to the secondary nameservers. They also contain metadata about your domain.

For a complete list of DNS record types you can view this wikipedia article.

Setting Up Sublime Text 2

There’s a number of text editors available for Mac and PC, and everyone has their favorite. I started out with TextMate because I have a mac. Actually, I started out on Microsoft Frontpage in 1997, made my way to Adobe’s Dreamweaver, tried out BBedit, TextMate, and others.

Finally I’ve settled on Sublime Text 2. And now I’m going to show you how to setup Sublime Text 2, how to use package control, how to customize the colors, highlighting, linting, and more.

I can’t yet think of a good metaphor for your text editor, but just know this—it’s pretty freakin important. You’re going to spend a lot of time using it. It’s essential that you have an environment you’re comfortable with and that you take to time to learn all of the keyboard shortcuts to maximize your productivity.

HTML5

Read this book right now.

CSS3, Responsive & Mobile First Design

Ahh what can I say about responsive and mobile first design that hasn’t already been said. Before I did the CodeSchool and Treehouse courses I had already designed and developed 4 responsive projects. They were all very painful, lots of debugging CSS for browser compatibility and using CSS hacks to make my layout look good across a variety of devices. I’m going to list a few tricks and tools I learned about here, so that I remember them. Maybe it will help you too.

Notes on responsive and mobile first design:
Online Tools & Scripts:
CSS3 Linear Gradient Tool
Devoth’s HEX to RGBA Tool
FitVids
Fittext
Styletil.es
QuirkTools Screen Fly
Adobe Edge Inspect
PictureFill.js
Lettering.js,
Adaptive-image.com
Responsive Maps Embeds – CSS Method
Brad Frost’s Resources for responsive design

Try these Chrome Extensions: 
Window Resizer
ColorPick Eyedropper
OSX REsizer
Web Developer
Chrome Develop Tools (you should master this tool)
Tools for your Mac:
iOS Simulator w/ Xcode
Safari’s developer tools (they integrate with the ios simulator allowing you to debug in ipad / iphone emulators)

Learning Javascript Online

Ok it turns out I need to learn Javascript. I’m back tracking once again. This happens. It usually happens because I need to solve a problem or implement a feature and I just don’t understand how to get it done. The other option is opening up my wallet and paying someone to do it (delegation is often the better choice as a business owner, but it doesn’t help me meet my long term goals). ‘m working on an ecommerce store and need to build some custom filters, a product customization feature, and a few other little things that require JS.

Here’s my resources so far:

Treehouse has a good javascript course.
CodeSchool does too.

I’m adding these to my punch list:

http://d3js.org/

Along with this tutorial: http://alignedleft.com/tutorials/d3/

More on this later.

Learning Regex Online

I’ve used regex before but only the copy-and-paste variety. It’s time to get dirty, as I need to do some segmentation and goal setup in google analytics. Here’s a good primer on learning regex in that context…It’s a good place to start.
Annielytics

Learning Python Online

When I first started looking at what programming language to learn everyone said “Python!” And they said it was soooo easy to learn.

Liars.

It’s really not that easy. I thought it might be, and its not. Here’s a few of the resources I used for learning Python:

http://www.diveintopython.net/

 Appendix I. – Free Sites for Learning Code

Here is a comprehensive list of free websites to help you learn how to program online.

I took at least one class from each of the following. I found that each course presented code concepts in a different manner. Some were very effective for me. Some were not. Your mileage may vary. It turns out I’m a painfully slow learner (Edit 8/6/2013 – My learning has accelerated as I get past the beginners hump). I’ve had to take a few courses on each subject before the concepts made sense.

I just keep going, even when its ungodly frustrating. Hopefully you will too. I suggest you give a few different platforms a try and see which one works best for you. Or, you could follow along the path I used for this course.

Just keep in mind I’m frequently reflecting, reorganizing, and updating this guide. It’s a work in progress. It more like my personal programming journal.

Sometime I wish I’d understood a certain concept or learned things in a different order. When that happens I simply update the page. If you’d like me to add your site, or know of a good resource just write a comment below.

Khan Academy – I tried their course on Python and it was OK. They get into the nitty gritty stuff pretty quickly so if you have no experience programming I wouldn’t recommend starting here.

Udacity – Their Python course (Computer Science 101 and 200) are excellent. I’m currently working my way through this course. The course walks you through a step by step process of building a search engine and teaches you the required skills along the way. I highly recommend this course as it was interesting and well structured.

Learn Code the Hard Way  Learn Code the Hard Way is a 100% free resource to get you started. Take the CLI (command line interface) course and then pick a language and get going.  

Become a Programmer – MotherF*cker –  Here’s a huge list of free books that will teach you anything you want to know. Get started.

Cousera – Yup you can take college courses for free. Save yourself $200k and sit in your pajamas and learn.

Google Code University

EdX

Hackety Hack – Learn Ruby

Codecademy

Hack Design

Devalot

Learn to Program by Chris Pine

Learning Vim from the Inside

Rails Girls - A ruby on rails smorgasbord

Learn How To ProgramEpicodus Course Curriculum


Appendix II. – Premium Platforms for Learning How to Code

The following resources are pay-per-view content. Some sites offer monthly memberships, some are education marketplaces that allow you to purchase one specific course at a time from an independent teacher. Other options include code bootcamps, code schools, and remote code bootcamps.

I suggest you take a look at the Flatiron School Prework and follow their track first. I happened to have a membership at SEOMOZ so I received special pricing at Treehouse. I found CodeSchool was pretty good too.

UPDATE: 8/12/13. I finished most of the courses at Treehouse, and a bunch of CodeSchool. The Treehouse CSS / HTML track was much more in depth, and CodeSchool will serve as a good wrap up or summary of everything you learned at Treehouse. Do them both.

Lynda.com

Treehouse

CodeSchool

UDEMY

BLOC

Flatiron School

General Assembly

Skillshare

The Starter League

ThoughtWorks University (a job)

AppAcademy

DevBootcamp

Learnable - Learn Web Development

RefactorU – Colorado web developer school

Appendix III. – Code Cheat Sheets

When I first started I decided to put all the info from these cheat sheets in Anki.

That hasn’t worked that well for me, though I’m still trying.

Maybe you use index cards or maybe you don’t try to memorize anything, I’m still not sure of the best approach and I’ll update you as I go. I know one thing for sure, when I use index cards to memorize anything part of the process is actually writing the index cards. When you write you’re triggering your Reticular Activating System (RAC) which sends a signal to the cerebral cortex to wake up and pay attention.

You may find that actually writing each term on an index card works better for you.

Edit 8/6/2013 – I’ve found my learning sweet spot, and surprise! its the same method that got me through the higher education system. It’s pretty simple: I watch the Videos (codeschool/ treehouse/ etc) and take notes. I frequently pause the videos to reflect. I complete the course challenges, then review my notes. Sometimes I’ll watch one hour of video, sometimes 4 hours. After every video segment I’ll review all my notes from all the previous segments. Then, I put the important stuff in Anki as index cards. Most importantly, I apply what I just learned to a project I’m working on. Then its just about reviewing and rewriting notes, studying Anki, and implementing the skills in a real life project. Again and again.

That’s it. There’s no secret. I’m not very smart, so you can do this.

Unix Cheat Sheet
Command Line Cheat Sheet
Liquid Cheat Sheet
CSS3 Cheat Sheet
HTML5 Cheat Sheet
jQuery Cheat Sheet
Git Cheat Sheet
Python Cheat Sheet

Other cool ways to practice your newly acquired skills:

Math stuff you can practice: http://projecteuler.net/problems
Practice reverse engineering here: http://www.crackmes.de/

  • knez

    Hey man, I stumbled upon your blog from your comment on

    http://thenextweb.com/dd/2012/10/21/so-you-want-to-be-a-programmer-huh-heres-25-ways-to-learn-online/

    I am in college now and I am just trying to figure out what my career
    path should be (having many second thoughts), but I think if I persist
    with programming that will be the most rewarding in the end. I usually
    get overwhelmed with all the various online options for learning code
    and by the enormous obstacle that is becoming a “programmer” so I wanted
    thank you for writing this blog. I feel better knowing that there are
    other slow learners out there and I can struggle along with others and
    not just by myself. I look forward to reading your further posts.

    • KJ

      Hey Knez, its not easy, and I’m still struggling.

      No matter what career path you decide on (and I’m sure you’ll change your mind more than once) programming will serve you well.

      Computers have taken over our world so keep at it and you’ll get there.

      On a side note I once read a recommendation from a 20+ year career programmer to learn it, but not make it your career. I’ll second that notion.

      You’re more valuable as a ________ (insert most anything here) that knows programming.

      Make it your secret weapon. Use it to innovate in ancient, behind-the-times industries. Good luck. I wish I started learning this in college.