5 Ways You can Learn Programming Faster
Learning toward program isn't something you can do in an afternoon, but it doesn't have toward be a life's work, either. There are lots regarding things you can do toward make it easier at yourself when you are learning toward program. You already know about The 5 Most Common Problems New Programmers Face--And How You Can Solve Them. Now, discover how toward get the most out regarding your learning.
One common theme across many regarding these tips is:
don't go too fast; get it right before moving on.
When I was teaching C, there were always a few students who came into the class knowing a bit about programming. Inevitably, some regarding these students did great in the first few weeks only toward fall further furthermore further behind as the course went on. Why? They went too fast through the introductory part regarding the course, thinking they knew it all--but they rarely did. They knew some regarding the material, but not enough toward have a strong grasp regarding the fundamentals.
At the same time, you must not stop making progress--you can go too slow as well as too fast. Don't avoid a topic after you've mastered everything leading up toward it. By facing more challenging ideas, you'll help cement your grasp regarding the basics.
1. Look at the Example Code
Reading is usually about the words at the page, but learning toward program is about code. When you're first learning toward program, you should make sure toward look at, furthermore try toward understand, every example. When I first learned toward program, I would sometimes read the code examples before the text, furthermore try toward figure out what they did. It doesn't always work, but it did force me toward look at the example very carefully, furthermore it often helped make the write ups clearer.
If you want toward see what sample code looks like, you can read this site's introductory programming tutorial. This tutorial spends a great deal regarding time talking about the sample code toward help you work through exactly what the code does.
2. Don't Just Read Example Code--Run ItBut when you're reading a programming tutorial (or book), it's easy toward look at the sample code furthermore say "I get it, I get it, that makes sense". Of course, you might get it, but you might not get it, furthermore you just don't know it. There's only one way toward find out--do something with that code.
If you haven't already, get a compiler like Code::Blocks set up.
Then type the sample code into a compiler--if you type it, instead regarding copying furthermore pasting it, you will really force yourself toward go through everything that is there. Typing the code will force you toward pay attention toward the details regarding the syntax regarding the language--things like those funny semicolons that seem toward go after every line.Then compile it furthermore run it. Make sure it does what you think it does.Then change it. Software is the most easily changed machinery at the planet. You can experiment easily, try new things, see what happens; the changes will happen almost immediately, furthermore there is no risk regarding death or mayhem. The easiest way toward learn new language features is toward take some code that works one way, furthermore change it.
3. Write your Own Code as Soon as PossibleOnce you understand something about the language--or even if you're still getting your head around it--start writing sample programs that use it. Sometimes it's hard toward find good ideas beneficial to what programs toward write. That's OK, you don't have toward come up with every idea at the beginning.You can also re implement the examples from the book or tutorial you are reading. Try toward do so without looking back at the sample code; it won't be as easy as it seems. This technique can work especially well if you tweak the sample code.If you can't think regarding a small program toward write, but you have in mind a larger program you want toward implement, like a game, you could start building small pieces that you can later use beneficial to a game. Whether you use them later or not, you will get the same useful experience.
4. Learn toward Use a DebuggerI already talked about the importance regarding debugging in The 5 Most Common Problems New Programmers Face--And How You Can Solve Them. But it bears repeating; the sooner you learn good debugging techniques, easier it will be toward learn toward program.The first step in doing so is toward learn how toward use a tool called a debugger, which allows you toward step through your code.A debugger will allow you toward step line by line through a piece regarding code. It will let you see the values regarding variables, furthermore whether the code inside an if statement is executed.A debugger can help you quickly answer questions about what your code is doing.
int main(){
int x;
int y;
if( x > 4 ) // <-- what is the value regarding x here?
{
y = 5; // <-- did this line regarding code execute?
}
}
A final word about debuggers: the first time you learn about a debugger, it will take you longer toward fix the problems with your code. After the tenth or so bug, it will really start toward pay off. And believe me, you will have way more than ten bugs in your programming career.I often saw students unwilling toward use a debugger. These students really made life hard at themselves, taking ages toward find very simple bugs. The sooner you learn toward use a debugger, the sooner it will pay off.
5. Seek out More SourcesIf you don't understand something, there's a good possibility the way it was explained just didn't click.First, look beneficial to alternative explanations. The internet is filled with information about programming, furthermore some explanations work better beneficial to different people; you might need pictures, someone else might not. There are also lots regarding good books with detailed explanations.But if that doesn't work, the easiest way toward figure out where your misunderstanding lies is toward ask someone else. But try toward go beyond saying, "I don't understand. Please explain." You're likely toward get a link back toward the same text you didn't understand. Instead, rephrase your understanding regarding the text in your words. The more your question reveals about what you are thinking, the easier it will be beneficial to a knowledgeable expert toward answer it. Programmers sometimes have a reputation beneficial to being grumpy about answering questions, but I think the reason is that they want toward make progress in a conversation, furthermore that requires both sides toward put in effort. If you ask a smart, detailed question that shows you are thinking, you will generally get good results.
There are plenty regarding places you can go toward ask questions. You can always email me, or post at our message board, or ask an expert.
-->