From my experience, traditional learning techniques get boring fast. A lot of learning on their own start by reading a how-to book. Books are excellent resources to get the ball rolling.
The trouble is, it just doesn’t stick.
I found books quickly demotivated me, my enthusiasm towards learning would quickly diminish. I’d still finish them, but with much reluctance.
Common tasks found in beginners books are to create things like Fahrenheit to Celsius converters. As you woefully tap away at your keyboard, copying the code letter for letter as the book tells you to, you begin to contemplate how the universe even came to be, and why it has lead you to this moment.
Well, maybe I’m exaggerating. Though, learning to create something so distinctly uncreative is a frustrating experience. No one enjoys making a program so simple that the solution could be reached much more efficiently using any of the many devices that surround us in our daily lives.
For me, programs are much more exciting to create when they are unique each time they are ran. It gives a real sense of excitement when you hit compile and you have only a vague idea of what to expect. Sometimes the output will be bad, not what you anticipated and less than exciting. Other times however, it will just piece together by chance and your own skill to create something wonderful.
Something fun to try could be to tell a story that is different every time based on user input, using arrays, a loop or two, and a randomiser. An awesome, humorous, advanced example of this can be seen here.
So, I suggest if you are struggling, take a break, think outside the box a little. Don’t worry if your code doesn’t work, just read some more and I’m sure you’ll figure it out.