Five Things To Know Before Learning a Programming Language

1. You can’t learn a programming language

Just so we’re clear, you can’t learn a programming language. This probably seems like the most backwards, faux-profound Yoda-esque piece of advice you’ll receive all day, but hear me out.

There is no specified limit to what’s in a programming language. Any random Jane or Joe on the internet could make a new module. One could memorize all the commands in the standard library (the language’s core commands) and call it good. However, there are many tasks that are quite difficult to accomplish with the standard library alone.

You can get good at a programming language. By memorizing the basic commands (math operations, string manipulation, and various types of data storage) and keeping a reference tab open on your computer, you can accomplish most anything.

However, I have yet to meet a programmer who could build a whole game without reference. I’m sure they could exist, naturally, but since I haven’t yet met one I will assume they do not.

2. Not all languages are created equal

Programming languages are wildly different. They have different uses, different difficulties, and different complexities.

A good analogy is writing utensils. Say you want to write a word in cursive, like in the below example that I totally didn’t get off Pixabay.

You could theoretically replicate this using only a charcoal stick fresh from the fire. However, this is a ton of work and you really don’t want to do this. Low-level languages like machine code are like this.

You’ll probably go to a pencil or pen. Both work similarly, and could probably emulate this with reasonable accuracy. Languages like Python and JavaScript are likely right around this difficulty level; they’re not perfect for the job, but you probably can figure it out quickly.

If you want to get this 110% right, you’ll go buy a gold-tipped calligraphy pen and spend three years learning how to use it so you can write Pixabay in fancy words. C++ is your gold calligraphy pen.

Long story short, if you’re a beginner, go for the all-purpose gets-the-job-done languages. Not all languages are equal, friends. And just because C++ is the right choice for what you want to accomplish, it doesn’t mean it’s the best choice.

3. There’s no shame in Googling

My experience with Python was—and continues to be—a cycle of coding, debugging, and Googling.

Disclaimer: If you use Bing, Firefox or any other search engine and feel slighted, I apologize. But you brought this upon yourself.

I usually have three or four tabs open on my computer at any time: the PyGame documentation, the Python documentation, and a few StackOverflow threads for good measure. Heck, ask your own questions. Get a StackOverflow account.

I tend to discourage cut-and-paste of code from these kinds of sites. You’ll feel more fulfilled if you type it out manually, and you’ll get more experience to boot. A good rule of thumb is if you find yourself changing variable names to fit those that were in the code you copied, stop.

4. Look at good code

Ah, anecdote time. Back in 2013, when I was still in middle school, somehow I didn’t know that multiplying any number by -1 inverted it. So, instead of a simple
result = input * -1
I wrote the following truly horrendous code, which either added a negative in front of the number or reconstructed the entire string to not include the negative:

if letter 1 of input = "-" then
counter = 2
repeat counter-1 times
result = (result) concatenated with (letter counter of input)
counter = counter +1
else
result = "-" concatenated with (input)
end

Luckily, I had a fellow coder who sent me a very confused and distressed email about the code in question. But moral of the story, get someone who knows what they’re doing to help.

5. The tools online are there to help you

You may think that you’ll be a Pythonic purist and use only IDLE, the command line that comes with Python, to code your MMORPG. That’s an excellent way to quit Python, by the way, or perhaps to bash your brains out on the keyboard. (Keyboards can be expensive. Do it on a desk, or a nice soundproof wall.)

Notepad++ is a great tool for coders, as it helps you keep your syntax neat and check for typos. Having grown up using Scratch and being used to the instant feedback of my changes, I also prefer to use a development environment that lets me test my changes live.

What are some tips you would give to beginning programmers? Funny anecdotes? Share, I’d love to hear it.

Edit: Fixed formatting

Advertisements