Tag Archives: java

Can you teach me how to program?

12 Jun

Random Hackers by jpbader@flickr

Random Hackers by jpbader@flickr

There’s one short answer to this question, and one long. The short is: “No.” The long, well, that will take some elaboration. I was recently collecting some introductory material on programming for the new students who are arriving this fall and these are my top five ideas on how to learn how to program.

Work hard
Programming is highly practical. Your job is to transform words of English (or any other spoken language) into a language that the computer understands. The tricky part is that the computer has, compared to human beings, very limited interpretation skills. Surely, artificial intelligence is growing steadily, but it is far from ready to understand syntactical misspellings and so forth that you eventually will make as a programmer. Practicing, learning-by-doing, is the key to understand the wonders of programming. One awesome thing is that once you’ve passed the first barrier, the other is just next door and then there’s a world of possibilities.

Connect with reality
Find things around which you can relate to. While I was working as a Java supervisor I tried everything from apples to CD-racks. Those are tangible, things you have in your house, but most importantly things you already know. Ask someone for help if you have a hard time imagining what, for example, a heap looks like.

Love errors
I think the first thing we should teach people who are new to programming what a stack trace is. Irrespective of what programming language you’re using, there’s a huge chance the answer to what’s going wrong is in the stack trace, or error output. Be prepared to fail, and to learn from your mistakes.

Don’t read a book
Well, do that too, but there are few books to my knowledge that suits students with absolutely no programming knowledge. The best book I’ve found is called “How to think like a computer scientist” by Allen B. Downey as he starts at a more conceptual level and then slowly moves into the Java programming language. Most importantly, however, start filling out that blank white sheet with some code!

Learn from others
Work two and two. Find a friend who’s also new to programming and sit down together. Attack a problem, discuss, test, fail, discuss again, and change. Read other people’s code. There are plenty of open source projects out there where the code is freely available. Inevitably some of it will fly over your head, but study the details and you will soon see similarities. Once again, it will require hard work.

All of this may sound so simple when reading it. It is not. That is why I cannot teach you how to program.

Happy hacking!

The art of achieving programming skills

29 May

Learning to program is tricky if you lack the passion or interest for it. People who like it have no difficulty at all to focus for hours, since they don’t actually notice that they’re making an effort. Being able to just play around and find it fascinating is a great way of learning. But others might not feel this way. Subsequently, the effort needed to actually master programming is insurmountable.

Many students say that the only way to learn programming is by doing it, without minding books. Trial and error, learning by doing… you name it! Phrases like that have constantly been echoing in the corners of the university as well as in my brain. But being a newbie, it is frightening to stare at a blank page in Eclipse. The anxious feeling not knowing how or where to start just overwhelms you.

head-first-javaPersonally I think many beginners think it’s more complicated than it is. One reason might be the endless books with an endless number of pages that are just too serious. Although there is one book that I’ve found totally amazing. Head First Java -the funniest programming book on the market so far.

This is from the section Life and Death of an object:

…then he said “I can’t feel my legs!” and I said “Joe! Stay with me Joe!” But it was… too late. The garbage collector came and… he was gone. Best object I ever had.

Suddenly life seems a bit brighter. With this book I get the feeling that everyone can program. The weight of a little humor bends your brain into submission. Trust me.