Programming is exciting, creative and empowering. Learning how to program however is a different story. Much like learning a natural language, it's a slow and tedious process that requires dedication, work and lots of time. It is relatively easy to acquire some rudimentary skills, but if you want to realize your dream project or even turn it into a career, you will have to keep studying and working diligently to make any headway. Naturally, this isn't always easy – there's bound to be quite a few bumps in the roads and oftentimes it will seem easier to just turn back than to press on forward. But that would be a shame, wouldn't it? So here are four pieces of advice to keep in mind when starting to learn how to program, to help you arrive safely at the end of your journey instead of stopping half-way.
Start with a graphical programming language
One of the biggest hurdle to overcome when starting to program is learning the syntax of the programming language of your choice. A cursory glance at a source file will show you that most of the words you'll use are plain English, such as if, while and for. But that won't relieve you from having to learn how exactly to put those words, not to mention numbers and symbols, together. You can certainly have long and stimulating conversations with another person even if neither of you has a perfect command of each others language. Persons will cut you slack. Computers however are far less lenient. If you don't tell it exactly what you want in exactly the right way, it will either flat-out refuse to do anything or it will do something that you didn't expect and – 99% of the time – didn't intend. Even forgetting a semicolon is enough to render your whole program useless in some programming languages.
So how to get around this initial hurdle? Well, if you just want to get a feel for programming and see if it's right for you, you can start out with a graphical programming language like Scratch. With Scratch you won't have to learn how to actually write code; instead, you create programs by dragging and dropping different puzzle pieces together, making it the perfect tool to mess around a bit and see if programming is for you. Obviously, graphical languages aren't as powerful as regular ones, but they will definitely flatten the learning curve a good deal.
Join a community
No textbook or online tutorial will ever answer all of your questions. That's why it's important to have someone that can help you out, either by providing the answers outright or by joining you in the quest to find them. Sharing information, ideas and techniques is very important in programming, not only because it'll help you to avoid mistakes but also because you will learn to think in ways you've never even considered before. If you don't have a teacher or classmates, don't fret - the Internet is always there! There are literally thousands of communities online dedicated to the art of programming in all its forms, so pick out a forum, IRC channel or even a Facebook group and start exchanging ideas. There is no shame in asking for help either, because remember: There are no stupid questions, just stupid programs that don't do what you tell them to do.
Read and understand code written by someone else
Apart from the classic learning-by-doing, you can also profit greatly from learning-by-having-done. While diving into a full program when you're just starting out will undoubtedly end up with you hitting your head on a rock, looking at other people's code can sometimes teach you more than a textbook ever could. There's always several ways to tackle a problem in programming and most of the time, there's no "right" or "wrong" way – if the program works, it works. However, by looking at how other, more experienced people have solved certain problems you can learn techniques that are easier and more efficient than what you have painstakingly pieced together. But even if your way is actually better, it never hurts to see a different approach to the same task. You can never tell whether it's going to come in handy somewhere down the line.
Take small steps and use what you learn
Learning to program can quickly become tedious and frustrating. It's very easy to get in over your head and throw in the towel because progress is too slow or you just feel completely overwhelmed by everything you still have to learn. That's why the two most important things to keep in mind when learning to program are: Stay motivated and take small steps. Textbooks will often have you create one or several projects step-by-step so you can see how different ideas and techniques build on top of each other. You're definitely encouraged to follow along, but chances are you've got your own idea for a project – so why not work on that as well? It's important that you learn how to use the techniques you've learned in different situations, hence having an alternate project to try new things on can make your studies up to 100% more efficient. Plus, solving problems that occur in your own personal project will give your motivation a much-needed boost. But once again, don't get in over your head: stick to the pace the books sets and gradually work your way up. And if you keep applying what you've learned, you'll never feel as if you're wasting your time.
With these four things in mind, the road to proficiency should be quite a lot smoother and (hopefully) more enjoyable. Of course, every person is different and will therefore approach the tasks at hand from different directions, so if one of these tips isn't working out for you that's perfectly fine. However, if you ever get stuck and feel like you're too frustrated to go on, sit down and think back on the most important things: Start small, study at your own pace, apply everything you learn and above all, have fun.