You've always wanted to learn how to build software yourself — or just whip up an occasional script — but never knew where to start. Luckily, the web is full of free resources that can turn you into a programmer in no time.
Since the invention of the internet, programmers have been using it to discuss software development techniques, publish tutorials, and share code samples for others to learn from and use online. If you're curious about how to become a programmer, you can get off to a running start using tons of great free web-based tutorials and resources.
First Things First: Don't Get Hung Up on Choosing a Language
A common pitfall for beginners is getting stuck figuring out which programming language is best to learn first. There are a lot of opinions out there, but there's no one "best" language. Here's the thing: In the end, language doesn't matter THAT much. Understanding data and control structures and design patterns does matter very much. Every language — even a simple scripting language — will have elements that you'll use in other languages as well and will help you learn. Even though I have a degree in Computer Science, I learned how to program in Pascal, Assembly and C — languages I never actually got paid to program in later. I taught myself every language I've used in my career, reusing concepts I already knew, and referring to documentation and books to learn its syntax. So don't get hung up on what language to learn first. Pick the kind of development you want to do, and just get started using one that works.
There are several different kinds of software development you can do for various platforms, from the web to your desktop to your smartphone to a command line. In this article, we'll outline some of our favourite starter tutorials and resources for teaching yourself how to program for each major platform. We're going to assume you're a savvy user, but a newb when it comes to wrangling code snippets, so we'll keep things at the beginner level. Even just following through a beginner programming tutorial, you'll be happy to see how far you can get.
The easiest way to try your hand at programming for your Windows or Mac desktop is to start with a scripting or macro program like AutoHotkey (for Windows) or Automator (for Mac). Right now hardcore coders throughout the Lifehacker readership are yelling at their monitors, saying that AHK or AppleScript are not "real" programming. That may be true — technically these types of tools just do high-level scripting. But for those new to programming who just want to get their feet wet automating actions on their desktop, these free tools are a fantastic way to start — and you'd be surprised at how much you can do with them.
This scripting language is capable of far more than just small-scale automation projects. To get started with AutoHotkey, check out Adam's tutorial on how to turn any action into a keyboard shortcut using AutoHotkey. (Then, check out the source code for Texter to see the innards of a full-fledged AHK-based Windows application.)
Instead of being bound to specific programming languages and the look and feel of a particular operating system, you can put your killer application in the browser and run it in the cloud, as a webapp. Welcome to the wonderful world of web development.
HTML and CSS: The first thing you need to know to build any website is HTML (the page markup that makes up web pages) and CSS (the style information that makes that markup look pretty). HTML and CSS are not true programming languages — they're just page structure and style information. However, you should be able to author simple HTML and CSS by hand before you begin building web applications, because a web page is the front-end to every web app. This HTML tutorial is a good place to start.
b>Server-side scripting: Once you're good at making things happen inside a web page, you're going to need to put some dynamic server action behind it — and for that, you'll need to move into a server-side scripting language, like PHP, Python, Perl or Ruby. For example, to make a web-based contact form that sends an email somewhere based on what a user entered, a server-side script is required. Scripting languages like PHP can talk to a database on your web server as well, so if you want to make a site where users can log in and store information, that's the way to go. Excellent web development site Webmonkey is full of tutorials for various web programming languages. See their PHP Tutorial for Beginners. When you're ready, check out how to use PHP to talk to a database in WebMonkey's PHP and MySQL tutorial. PHP's online documentation and function reference is the best on the web. Each entry (like this one on the strlen function) includes user comments at the bottom which are often as helpful as the documentation itself. (I happen to be partial to PHP but there are plenty of other server-side scripting languages you might decide to go with instead.)
Command Line Scripting
If you want to write a program that takes textual or file input and outputs something useful, the command line is the right place to do it. While the command line isn't as sexy or good-looking as a web app or desktop app, for rapid development of quick scripts that automate processes, you can't beat it.
Several scripting languages that also work on a Linux-based web server also work at the command line, like Perl, Python and PHP — so learning one of those baddies makes you conversant on two platforms. My path never took me too far down the Perl road, but I taught myself Python using the excellent and free book, Dive into Python.
If becoming a Unix ninja is one of your programmer goals, you absolutely must get good at shell scripting with bash. Bash is the command-line scripting language of a *nix environment, and it can do everything from help you set up automated backups of your database and files to building out a full-fledged application with user interaction. Without any experience writing bash scripts beyond a dozen lines, I wound up developing a full-on personal to-do list manager in bash: Todo.txt CLI.
Nowadays, modern web apps and browsers are extensible with with bits of software that bolt onto them and add features. Add-on development is gaining in popularity as more developers look at existing software — like Firefox or WordPress — and think "But if only it could do THIS..."
Web Development for the Desktop
The best part about getting started programming in one context is when you can take those skills and apply them elsewhere. Learning web development first is a great way to start because now there are ways to put those skills to work on desktop applications, too. For example, Adobe AIR is a cross-platform run-time environment that lets you build your app once and release it to run on the desktop of every operating system AIR runs on. AIR apps are written in HTML, Flash or Flex, so it lets you apply your web-development skills in a desktop context. AIR is a great option for deploying desktop apps like one of our top 10 apps worth installing Adobe AIR for.
Mobile App Development
Mobile applications like the ones you run on iPhone or Android smartphones are all the rage right now, so you may have dreams of striking it rich in the iTunes App Store with the next killer app. But for the new coder, diving headfirst into mobile development can be a rough learning curve, since they require comfort with advanced programming languages like Java and Objective C. However, it's worth checking out what iPhone and Android development looks like. Check out this simple iPhone application development example to get a taste of what iPhone developers do. Android apps are written in Java, and here's a friendly video tutorial of what building a "Hello Android" application workflow looks like.
Patience, Elbow Grease, Trial and Error
Good coders are a special breed of persistent problem-solvers who are addicted to the small victories along a long path of trial and error. Learning how to program can be a frustrating and solitary experience. If you can, get a buddy to work with you along the way. Getting really good at programming, like anything else, is a matter of sticking with it, trying things out and getting experience as you go.
This article is just one self-taught programmer's top-of-mind recommendations for beginners. Experienced programmers: What did I miss? No matter your skill level, add your thoughts and recommendations for beginners to the comments here.