So You Want To Learn To Code?

So You Want To Learn To Code?

December 12

“The thing about programming languages is that, once they get into programmers’ heads, you never really know where they’re going to end up.”  — Scott Rosenberg

My son placed an iPad on my lap and said, “Hit refresh”.

With Safari open, I hit refresh and watched his website come to life. The site was simplistic. He had created a banner logo with his name across it. Below that he’d written a few facts about himself such as, “Likes: baseball, Minecraft and Rubik’s Cubes.”

Of course I already knew that. What I didn’t know was that he’d been learning HTML, CSS, and even a little JavaScript in his 6th grade computer class. These are the first programming languages he’s becoming familiar with, and, like many kids his age, his goal is to create his own app next year. And he’s certainly not alone.

This past week I turned on CNN to watch President Obama tell the nation that Americans should learn to code: “Don’t just play on your phone. Program it.” That was before the President wrote a simple program that drew a square on the screen. His point was that anyone could learn to program with a little effort.

So kids are learning to code and even the President of the United States is getting in on the action, but what languages are they learning? What languages are in most demand? With so many new languages hitting the scene, it’s hard to keep track of them all. This week I want to dive into a few of the most popular languages and see what trends I can find.

C: The Grandfather

The power and influence of C is apparent when you speak with most programmers today. C is a machine-level language so you have to learn how the code interacts with the hardware. It requires an understanding in debugging and memory management that you don’t get with higher level languages such as Java. Joel Spolsky once compared learning to program in C to learning basic anatomy as a medical doctor.

What C arguably does better than any other language is that it prepares you to code more efficiently in other languages, which is one reason many people will tell you it’s the best first languages to learn. C is also the grandfather of many higher level languages such as Java, C#, and JavaScript.

Downsides to learning C are many. It’s a complex and strict language by design and comes with a steep learning curve. So you’ll learn to write concise disciplined code, but it might be a while before you’re able to create anything useful. But C is the most popular programming language for a reason, and one that will be around for a long time. It’s the Sopranos of languages.

Java: Practicality & Reach

Java has its share of fans. And they tend to be a vocal bunch! But they should be proud because Java is the second most popular programming language and has become the standard by which students learn object-oriented principles (OOP).

Java is often a springboard into learning another object-oriented language such as Perl, Python, or PHP. Its popularity has been helped by the surge in popularity of Android devices because most Android apps are written in Java. For a developer, that means your app has an instant audience in the billions.

Object C/Swift: Apple’s Kingdom

Java will help you reach those carrying Android devices, but it won’t do much for those using iOS devices like the iPad or iPhone. You’ll have to learn Object C or Swift in order to play in Apple’s large if controversial ecosystem.

Steve Jobs adopted Object C in the ‘80s while at Next, and it became the standard language tool for the Mac over the years. When iOS came along, Object C was there for the ride. But it showed its age on mobile, so Apple created a group, headed by Chris Lattner, to bring tools to today’s mobile developer who was raised on the web and accustomed to simple and flexible languages.

The result is Swift. But it’s not open source and it’s not cross-platform. As a developer you gain a lot in terms of tools, support, and a vibrant ecosystem in which to launch your work, but you also have to commit to a walled garden approach many are not willing to do.

Python: Simplicity at its Core

Many programmers will tell you that Python is the best beginner language to learn because it’s simple yet fully capable. Python code is easy to read and rewards good style without being overly strict about syntax.

Python often takes less time and fewer lines of codes to complete a task compared to other programming languages. Many will tell you that Python is actually fun to use and breeds confidence which makes it a great first language for students.

Python is popular among those who want get their feet wet with Linux. That popular websites such as Pinterest and Instagram have adopted Python as their language of choice certainly doesn’t hurt either.

JavaScript: Interactive by Design

One reason my son’s computer instructor likes JavaScript is because it doesn’t require much to get going since it’s built into every modern browser. It’s also carries a very forgiving syntax and allows students to immediately see the results of their code.

Many young programmers are interested in making interactive websites, and JavaScript is the go-to skill for making that happen.

So what programming language should you choose? It really depends what you need to accomplish. While there’s a lot of overlap, each language tends to focus on a few features it does best.

When selecting a career, it’s wise to research what skills will best prepare you for the type of job you’re after. Dev/Code/Hack breaks down the different job roles and skills you should pick up for them:

Back-end/Server-side Programmer: Usually uses one of the following: Python, Ruby, PHP, Java or .Net. Has database knowledge.

Front-end/Client-side Programmer: HTML, CSS, JavaScript.

Mobile Programmer: Objective-C or Java (for Android). HTML/CSS for mobile websites. Potentially has server-side knowledge.

3D Programmer/Game Programmer: C/C++, OpenGL, Animation.

High-Performance Programmer: C/C++, Java. May have background in mathematics or quantitative analysis.

It’s never too late to start writing code. I took my first programming course in my last year of high school. I wish I had been given the opportunity to learn to code earlier. But hey, if the President can learn to code, you probably can too.

Lifehacker has a great list of crowd-sourced resources for those wanting to learn more.

Photo credit: Michael Himbeault via Flickr