2015-07-01

How you should choose a programming language: don’t. Wait . . . what about the high paying tech jobs and flexible work schedules out there? Isn’t this the best time to learn how to code? It is, and you should.

Many people are curious about learning to code, and, naturally, people want to know where to start. This leads to the which programming language should I choose hurdle. Choosing a programming language is an obstacle, because you probably don’t have the information necessary to make a good decision. As someone who has never written a line of code, you are throwing a dart at the board and hoping for the best.

I encourage you to think a little bit more about what you want to accomplish with code. Be specific. Getting a good job isn’t precise enough. After all, is a job good if it pays well but you hate it? Code is everywhere, and that means you have a lot of options. Do you want to get a job building mobile apps? Did you read a bit about the Arduino and Raspberry Pi that sparked your interest? Are you a researcher who wants a little more command over your data? You can do a lot with code, and the opportunities continue to expand.

Once you take the time to think about what you want to do, build, study, etc. you can start thinking about which language to learn. Now, there are always options, and there will still be confusion—more on that later. However, languages have strengths or have been adopted more regularly in certain fields. This means that by picking a project or goal you have drastically reduced the number of targets on the dartboard.

To put it simply, you wouldn’t want to randomly spend months brushing up on Mandarin to discover that you’re moving to Germany. Sure, there may be a few people speaking Mandarin in parts of Germany, but you would have been better off practicing German. If you know the destination ahead of time, you’ll be working on the right stuff from the get-go.

But it isn’t that easy

I know I’m making it sound simple. It’s hard enough to decide what you want to do. Once you get a general idea, then it can become more confusing. Let’s say you want to work at building Web apps. Great, now you just Google the languages used to make Web apps, and then … you …  you find a forum post that … OK … PHP seems popular … but Ruby also … well, this person with a TON of Twitter followers says … AHHHHH … FORGET IT!

People will tell you to learn JavaScript or PHP first, then someone will tell you that Python’s syntax is simpler and you should start with it. Then you’ll hear about Java and all the available jobs, plus Java is used for Android apps. It goes on and on. Picking a project to build or a career track helps narrow the search, but there’s a lot of confusion left.

So what to do? You could keep refining. Maybe there’s a company you want to work for. What are they using? You might get a general idea from stackshare, which is a site that shows the tech stack (the different pieces that come together to make the service you use) of many companies.

Some other beneficial resources include Stack Overflow and Reddit. Unfortunately, those forums can lead to some of the confusing answers mentioned earlier.

I suggest asking someone you trust. Go find someone in person. Attend a Meetup and ask the people working in the field what they recommend. You’ll find that people are much more willing to engage meaningfully in person. You can also ask the all-important follow-up questions much easier when face-to-face.

I also recommend dropping into the Treehouse Forum where you may find the most friendly posts and people. Even before I worked for Treehouse, I found the forum to be a helpful place because the Treehouse teachers are active and the forum’s culture is beginner-friendly. The Internet can be a rough place, and we work to make sure the Treehouse Forum remains approachable and reduces intimidation.

So, yes, research is your friend, but I don’t want you to go away feeling like you’ve been told to get help elsewhere. So here is a list of some general guidelines and information about some of the languages you will likely find in the wild.

My Oversimplified General Guidelines to save you some Googling

HTML/CSS:

People often begin by learning HTML and CSS. Why? These two languages are the essentials for creating static Web pages. HTML (Hypertext Markup Language) makes up all the text, links, and other content you see on a Web site. HTML is the language that structures a Web page. CSS is the language that makes what you see on a Web page look the way it does—color, layout, other visual niceties.

Why not just tell you to start with HTML and CSS? You may not be interested in creating content for the Web. As I said earlier, you can do a lot with coding, and the Web is just part of it. However, if you are interested in coding for the Web, definitely start with HTML and CSS.

JavaScript

JavaScript is a first programming language for many people. This is because it is the logical next step after learning HTML and CSS. JavaScript provides the behavior on a Web site. For example, when you see a form field turn red to indicate that you haven’t filled it out properly, that’s probably JavaScript at work.

JavaScript has become increasingly popular, and it now lives outside of the Web browser. You will be in a good place by learning JavaScript as it continues to become more popular and multi-purpose over time.

Java

Despite its name, Java is not really related to JavaScript in any meaningful way. JavaScript was named when Java was becoming popular. Some marketing minds of the time decided to confuse us all in an attempt to make the LiveScript language more popular by changing its name to JavaScript. Just remember that Java is not JavaScript.

Java is a widely used language that can be used for anything from Web applications to desktop and mobile applications. Java is the language of choice for developing Android applications, so it might be the right choice if you want to start making mobile apps.

Objective-C

Like Java, Objective-C can be used to write desktop applications and mobile apps. However, Objective-C is essentially Apple territory. Until the recent release of the Swift programming language, Objective-C was the language for developing native iPhone and iPad apps. Many major apps are still written in Objective-C (and will continue to be for quite a while), and programmers for these apps are in high-demand. If you want to work on iPhone and iPad apps for a larger company, it’s a good idea to learn Objective-C.

Swift

Swift was released in June of 2014 by Apple as a modern language for developing Mac Desktop applications and iPad, iPhone, and Apple Watch applications. If you want to get into the world of iOS, Swift is the the language with which Apple intends to move forward. Yes, many apps are already written in Objective-C, but Swift is here to stay.

PHP

PHP is one of the most popular Web languages. It runs massive sites and is used by heavy hitters such as Facebook and Etsy. PHP is also the language used to write WordPress and Drupal. Because of its popularity, learning PHP will serve you well if you intend to code for the Web.

Python

Python is a general-purpose language used for everything from server automation to data science. Python is a great language for beginners, because it is easy to read and understand. You can also do so many things with Python that it’s easy to stick with the language for quite a while before needing something else. Python finds itself at home both creating Web apps like Instagram and assisting researchers in making sense of their data.

Ruby

Ruby is often associated with the Rails framework that helped popularize it. Used widely among Web startups and big companies alike, Ruby and Rails jobs are pretty easy to come by. Ruby and Rails makes it easy to get an idea into a working application, and it has been used to bring us Twitter, GitHub, and Treehouse.

Don’t Worry

Fret not, unless you make guitars. Then fret away (sorry, I couldn’t resist). Choosing a programming language may still seem overwhelming. It shouldn’t be, because you can’t go wrong. As long as you choose a language that is regularly used in tech today, you’ll be in a good place. When you are starting out, the goal is to become solid in the basics, and the basics are pretty similar across almost all modern programming languages.

The concept of a variable, loop, array, and function is the same no matter which language you choose. So, if you decide you want to get involved with front-end development, you might choose JavaScript. You may, after a time, get bored. You think building a phone app sounds fun. Now you need to learn Objective-C, Swift, or Java. Is all your JavaScript learning for nothing? Hardly. Everything you’ve taken the time to learn about JavaScript is applicable to the next language you tackle.

Part of learning to code is learning a language’s syntax. A much bigger part of learning to code, the part that takes longer and gives you more headaches, is learning to problem solve like a programmer. You can learn the grammatical structure of the English language pretty quickly; however, it is not until you put that grammatical structure to use in a conversation that you truly understand the language. The same is true in programming. You want to learn the core concepts in order to solve problems. Doing this in one language is similar to doing it in another.

Because the core concepts are so similar from language to language, I recommend that whatever language you pick, you stick with it for a while.

What I’ve Done

I am fascinated by just about anything and how that anything works. I like to play with electronics, I enjoy smashing a pick against guitar strings, I have fun making videos … you get the idea.

My predisposition to jump from one interest du jour to the next has been true of my efforts to code as well. I first learned HTML and CSS in college with a few books and some help from friends. I have never taken a formal coding class. I finally decided to learn JavaScript after some time building static sites. I was able to get a basic handle on JavaScript through books, but things got muddier.

Unfortunately, when I started learning to code Treehouse didn’t exist. There was no track or path to follow. I would just Google away until blinking felt like sandpaper grinding over hot rocks. I eventually started working with Drupal. Learning PHP became a necessity.

After some time with Drupal and PHP I became bored and got interested in Python. Then I thought phone apps looked cool, but I never pursued it.

In short, I drifted from one project and language to another based on whatever seemed interesting at the moment. The real downside to this approach was that it scattered my efforts. I never felt confident in certain core concepts in any language. I could hack together something simple to get the job done, but I certainly wouldn’t have called myself a developer (I still don’t).

What I wish I had done/What I eventually did

After being hired by Treehouse as a Video Pro, I wanted to continue my coding hobby (yep, I’m mostly a video guy). I made a choice. I was going to pick one language, Python, and give it as close to undivided attention as possible. I would build a few projects of different kinds using the language. I would seek out help in truly understanding things when I didn’t get it. Do I wish I had taken this approach sooner? You bet.

I never really felt comfortable with Object Oriented Programming before focusing on the concept in the context of a single language. I still have hangups, and I get lost constantly, but I feel confident in asking questions. I feel closer to the answer. I know what to look for.

The best part of this approach is that it has made my understanding of other languages clearer. Like I said, the basics are the same across most languages. When I go back to JavaScript for a project, I now feel better suited to tackle a problem in that language, because I’m better able to think like a programmer. Remember when I said that problem-solving like a programmer is the harder part.

There are still sticking points

No matter what you choose, it will be challenging at first. Stick with it. However, recognize when a sticking point is caused by the simple fact that you’re learning something new rather than the feeling that you aren’t interested in what you are creating. The benefits to picking a language and sticking with it for a bit have been true for me. But don’t forget the first point–do your best to pick a project or two that interests you.

The Takeaway

What works for me is focusing on something until I can use it to solve a problem—something I’m interested in tackling. Don’t stress. Great resources such as Treehouse exist today. You can sample quite a few coding languages right in your Web browser without really having to know anything. It’s a wonderful time to learn how to code. I have never been served poorly by trying to learn something. Don’t worry if you don’t like the language you picked. You haven’t wasted any time. Pick up, dust off, and on to the next one.

Good luck in your coding journey.

The post How to Choose a Programming Language appeared first on Treehouse Blog.

Show more