Programming was hard for me to learn because I couldn’t do anything useful with it. When I started learning to program, my book/tutorial would usually start off with the same old stuff–learning how to write functions, loops, variables, and maybe some way of outputting text to the screen.
Needless to say, when all you can do is calculate the number of prime numbers less than n, or play tic-tac-toe with a user, programming is not going to be very interesting. Thus, if you want to teach people who have never programmed before how to program…
You should offer immediately useful/interesting ways to use programming knowledge.
Now, not everyone needs immediate gratification. However, nowadays, there’s really no reason not to provide it. So here are 5 things I wish I had been given when starting programming that would’ve made things a lot easier:
5. Redistributables
I like to make programs for other people. This is one of the most valuable things you can do with a programming language. If you have to bundle a 30 MB interpreter/compiler with all your programs, it’s a huge disadvantage. (Java, for example, was really annoying in the beginning because I could never share a program with my friends without forcing them to download the runtime. I’m sure you’ve had this experience.)
4. System calls
This isn’t absolutely essential, but it is often useful for a beginning/advanced programmer to be able to call outside programs. I definitely wish someone had told me about Java’s Runtime.exec() earlier.
3. Manipulating files on your own system
This goes without saying. (In fact, beginning programming texts are most likely to include this.) In essence, if you can’t interact with the computer (or have any external effects), you can’t have any fun. Programming in a box is no fun. (Unless of course it’s Logo.)

2. Web browsing
Being able to pull text from a web site and parse it is extremely, extremely useful. This used to be less valuable, but since the web exploded, being able to parse text from websites, automatically execute searches, or have bots to visit sites for you is often quite handy.
1. Graphics

Graphics, graphics, graphics! This comes in two flavors, drawing lines and dots and stuff on the screen or drawing windows and buttons. Both make everyone (well, me at least) feel much more like a real programmer, and go a long way towards making me feel like my programming is worth something.
And more!
Programming teachers often ignore this kind of “useful programming”. For example, take the first hit on Google for “C++ tutorial”. (or “Java tutorial,” for that matter.) You don’t need to know class inheritance, generics, or packages to start being a useful programmer, so why require users to learn that before exposing them to any material they can use?
One programmer learning Lisp hit this nail on the head:
And of course, we need a standard and common set of libraries, available in the same way. For example, Debian stable has three Common Lisp regexp libraries. As someone new to Lisp I have no idea how to choose between them. Obviously I can do research but:
*People writing in Python or Perl or Ruby do not have to do research to choose between competing regexp libraries!*
To make CL attractive, it is essential that what other languages regard as trivial and obvious tasks are easily addressed without a great deal of background reading.
Response 1: One possibility is that online language tutorials are catering to people who already know where to look for those last 5 items. However, we should at least give a little help to really new new people–they need it the most! (In other words, distinguish between new and old programmers. Direct them to appropriate places.)
Response 2: I suggest that perhaps in programmer culture, we’re often very concerned with protecting new programmers from themselves. The number 4, system calls, for example, is easy to misuse.
But that’s all we’re usually doing; protecting programmers from themselves. It’s very much against the developer culture of empowerment (well, at least my culture of empowerment :P) to offer starting tutorials on a language and not give learners anything to do with it. (I learned the most from computers by breaking them.)
Response 3: There are, of course, tutorials that do give you something to do with your newfound knowledge, and practical applications are quickly becoming the rule instead of the norm. Some tutorials start you off on a practical direction; my Java book, for instance, introduced me to Swing and GUI building soon after the beginning. This link goes to a Java tutorial with immediate practical applications.
So why bother to write? Well, I wrote this primarily so I could enumerate five tangible things programming could offer, and so I could describe exactly what I needed to look for when learning a new language. I find that I learn a language much, much more quickly when I look for (and find) these sorts of things; perhaps you will too!