Learning to Code - How to Get Started

Posted on the 03 April 2013 by Sandislin @ed_republc
Fifteen years ago, learning to code was pretty simple. The choices were C++, HTML, and maybe some Visual Basic. Nowadays, software has evolved to include many more languages, frameworks, and tools.
Even as someone working in tech, I found it nearly impossible to answer a simple question - what language should I learn? This post is an attempt to help others get started.
Disclaimer: I'm representing my own opinion as a product person attempting to learn just enough to hack my own stuff. I'm sure there are many inaccuracies and nuances of which I'm unaware, or have captured very inadequately.
Let's get started!

If you're new to programming

If you need a refresher with algebra or have never heard of an if/else statement, you'd probably benefit from an overview course that introduces programming concepts and fundamentals. Khan Academy has a gentle introduction to programming basics. For a much more rigorous experience, check out the introductory computer science classes offered by the University of Washington, MIT, and Stanford.

If you want to build mobile apps

For iPhone/iPad apps, you'll want to learn Objective C and Xcode. Note: you'll need a Mac computer to develop for the Apple operating system. For Android apps, you'll want to learn Java.
Treehouse has step-by-step videos and code challenges for both Apple and Android (requires $). Udemy also offers many individual courses - for example, Objective C for iPhone developers (requires $).

If you want to build websites - quick and dirty

There are many website frameworks that help you create live websites within just a few hours. The most popular are Ruby on Rails (based on the Ruby language) and Django (based on the Python language). These frameworks are great 'one stop shops' to help you move from writing code on your desktop to deploying a real, live web app. However, these courses don't really teach you how to write the code itself, so you should first have some grasp of the underlying programming languages.
Rails seems to be most popular for beginners due to an extensive number of plug-ins (known as 'gems'), a large and active community for help, super easy deployments in the cloud with Github and Heroku, and (relatively) easy installation for Macs. I've personally taken One Month Rails on Skillshare (requires $), and am working through Michael Hartl's excellent Ruby on Rails tutorial. Rails for Zombies is another short intro, though, it is based in the browser and doesn't walk you through installation and deployments. You should also have some understanding of HTML, CSS, JavaScript, and Ruby to really make use of Rails.
I'm not personally familiar with Django. So I will refer you to two articles here and here for how to get started.
If you are a more advanced user, you could look into ASP.net, Node.js, or CakePHP/CodeIgniter/Yii (these last 3 are based on the PHP language).

If you want to build websites - front-end

The 'front-end' of a website refers to the elements that the user can see and interact with, like the visual presentation, buttons, forms, etc. You might also see this called 'web development' or 'web fundamentals.'
The primary languages to learn are HTML and CSS. HTML stands for HyperText Markup Language and is the structure your web browser recognizes when rendering the content on a page. While you could theoretically write your front-end in HTML only, the introduction of CSS (or Cascading Style Sheets) makes it much easier to manage the styling (font, colors, layout, etc.) separately from the content on a page. Beginner HTML and CSS resources are available at Codecademy, CodeSchool (requires $), and Treehouse (requires $).
HTML and CSS will enable you to produce static pages. But to click a button or move things around, you'll need to learn JavaScript/jQuery. jQuery is a library on top of JavaScript that makes it easier to use for web development. Learn more about these languages at Codecademy, CodeSchool (requires $), and LearnStreet.

If you want to build websites - back-end

The 'back-end' of a website refers to the elements that the user doesn't see, like creating an account, placing an order, or searching a database. There are many languages to choose from, and as far as I can tell, your choice as a beginner should be based on if/how you use a web framework. For example, learn Ruby if you're going to be using Rails, and learn Python if you're going to be using Django. Two other common languages in this family are PHP and Perl.
Ruby resources at: Codecademy, LearnStreet, RubyMonk, Treehouse (requires $)
Python resources at: Codecademy, LearnStreet, Learn Python the Hard Way (also a Udemy class $)
PHP resources at: Codecademy, Treehouse (requires $)
Ruby, Python, PHP, and Perl are all what's known as 'interpreted' languages. There are a lot of nuances here, but in general this means that your program will be interpreted and executed on-the-fly whenever a user accesses your app. It's faster to develop using these languages, but slower and less efficient for the app to execute compared to 'compiled' languages like Java and C/C++ that are translated into machine code in advance. Since most start-ups are prioritizing development speed over site efficiency, many will start with Ruby or Python, and only switch over to a compiled back-end after they get big. The exception is for mobile apps, since Java is the underlying language for Android and Objective C (a variant of C) is the underlying language for the Apple operating system.

Wrap-up

If learning all of the above seems overwhelming, don't worry! Most developers specialize in either front-end or back-end, web or mobile, and have a preferred language and framework. The important thing is to understand programming fundamentals and how the different pieces all fit together. With that knowledge, you'll be able to translate from one language to another depending on your goals.