One of the most frequently asked questions I get from beginners in programming, is that of where to start. This is very common amongst beginners, that they are given the tools to do almost anything, but they lack the inspiration of what these tools can be used for. As with anything, practice makes perfect, and programming is no different, so anything you can think of is really good exercise.
Besides practicing the use of the tools you are given though, I recommend a gradual move into practicing techniques, rather than syntactical practice. I look at programming as problem-solving, and each time you solve a problem you learn a technique for a given task, with practice you learn more and more techniques — some even for the exact same problem, just more efficient than the last. So, I suggest setting yourself goals, modest goals to begin with, practice the goal until you have a thorough understanding of the problem and solution, even try different ways of accomplishing the same goal — this way you will not only have understood the problem, but also gain a deep knowledge of various techniques to solve it, which will come in handy later on.
From Beginner To Intermediate
These are a few suggestions for you to practice, that get increasingly difficult to solve. If you finish all, go back to the first project and try to solve it with any new technique learned as you progressed. And if you are learning an object oriented programming language, such as C++, make sure you make everything an object in the project, as it will ensure a very good understanding of how OOP (Object Oriented Programming) works. Once you get familiar with OOP and comfortable working with it, you will not be wanting to go back to procedural programming — and then you can call yourself an intermediate programmer.
- Hello World — Printing a string to the console.
- Guessing Game (eg. guess a number) — Generate a random number, have the player try to guess the number.
- Tic-Tac-Toe — Slightly more complicated game, will challenge you on several aspects of basic programming.
- Pong — Very simple game, but requires animation, which can be quite difficult at first. Will get you familiar with time-based programming, real-time input interpretation and event handling.
Anytime you feel like you don’t know exactly how to solve a problem, write it out in pseudo-code, as such:
create keyboardInputVariable generate aRandomNumber while keyboardInputVariable does not equal aRandomNumber ask user for input set keyboardInputVariable equal to keyboardInput // once outside this loop, the number has been guessed print game-over string
By writing out pseudo-code, things become much easier to solve, as you have the solution in —almost— plain english.
I hope this helped you get started on your first projects. If i neglected to mention something, that you as a beginner, would like to know on the subject of getting started, let me know by commenting and I’ll update the post accordingly.