Article

How to Get Started Writing Code

May 13, 2015  |  Pluralsight
Learn something new. Take control of your career.
Sign up

So, you’ve decided you want to start programming — you’re excited and ready to learn, and then you ask yourself, “Where do I begin, and which language do I start with?” The answer to that question is a little tough, and it’s certainly something I struggled with when I was starting out. That’s why today I want to dig into straightforward, useful advice you can work off immediately. And by the end of this, you’ll be wiser, braver, and hopefully a few steps closer to some cold, hard programming.

What is the best language?

This has got to be the number one thing I hear people worrying about when deciding to start programming. You might be concerned the language won’t be right for your chosen industry, that it won’t suit your projects, that it’s not fast enough, that it’s not powerful enough. And yes, some languages are powerful, some are fast, and some are industry standards, but the honest truth is none of this matters to you right now. What does matter is starting to think like a programmer. Programmers are problem solvers, and the language itself is simply the tool you use to solve the problem. There really is no right or wrong language to pick when you’re starting — what’s much more important is getting used to thinking differently, being open, and being ready to learn from your mistakes.

My main advice for anyone wanting to start is to do exactly that — just start. As soon as you get your hands dirty and actually write some code and get it running, you will already have gained an enormous amount of knowledge. Don’t be afraid to make mistakes — some of the most important things I’ve learned have come from breaking my own code. It can actually be an extremely fun experience changing numbers and deleting lines to see what explodes and why. One piece of advice I’ll offer here is to keep your first few programs relatively simple. That way you don’t get overwhelmed when you’re debugging your code.

In the next section I will show you some example snippets from a few common languages, which will clearly illustrate why the choice between languages really isn’t important when you are starting out.

Where to begin?

There are a few types of programming languages, including functional languages, that are more suited to manipulating large amounts of data and procedural languages. They’re better used to perform low-level system tasks, but for now I’m going to focus on the more commonly used object-oriented programming (OOP) languages. While all languages have their best uses, I’m going to make the bold statement that, for now, I think object-oriented languages are kinder to beginners. Why? Because the basic principle of almost all object-oriented languages are the same — you’re making objects and doing stuff with those objects.

Here’s a basic program written in a few different OOP languages — this example is the most basic program to write, called “Hello, World,” and it’s something programmers often use to get an idea of a language’s most basic features.

First, create a string and give it the value: “Hello, World”

Now, let’s do something with this value by writing it out onto the screen somewhere (note: this isn’t about understanding all of the code, it’s just to take notice of their similarity).

While they all have their own way of expressing the same thing, we can quite clearly see they all use very similar patterns. The main benefit to this is if you know one of these languages, looking at another one shouldn’t (normally) be too hard to figure out. With a little reading, you can probably figure out what’s happening, even in a language you haven’t seen or used before.

The first language you learn might not be the one you stick with forever, but it’s important to just choose something and begin your journey into programming. Thanks to their similarities, you’ll find it easier to transition between languages, where you will be free to explore and enjoy all the perks and quirks of each. Let me know which language you started with when beginning to code and why in the discussion section below!

Learn something new. Take control of your career.
Sign up

Pluralsight

Pluralsight is the technology learning platform. We enable individuals and teams to grow their skills, accelerate their careers and... See more