More on Hello World

By Brett McLaughlin

It's been interesting to see what a strong reaction I received to my recent post on Hello, World (you might want to read that post and then come back here if you didn't catch it the first time around). While I expected varied opinions, I worried that many of the comments indicate I didn't make my point clearly enough.


And, of course, as a writer, I'll happily continue to whittle away until I think the point has been made (yes, let's all sigh in sympathy for my poor wife!).

Lots of you commented on whether or not you liked Hello World; and most of the comments reflected a desire for a simple introductory example at the beginning of the book. I agree completely! I'm afraid that many of you took my post to indicate that in my view, a simple example like Hello World is bad. Not at all the case! Take a look at Head Rush Ajax, or Head First HTML with CSS and XHTML, or even Java and XML. All of these are books are books I've either written or been heavily involved with... and all have very simple opening examples.

However, none of the examples feel completely trivial. In Head Rush Ajax, we give a lot of boilerplate code, and the learner only does a very few things... but the end result is a working web site, albeit something only understood in part.

In HTML, the learner creates a website, mostly out of text pasted into Notepad or TextEdit... but again, the site looks nice. The HTML equivalent of Hello, World... but why did we opt to not simply wrap the text, "Hello World!" into a body tag?

Because, as I said earlier, the brain craves novelty. And changing the programming language is not novelty; that's cognitive overhead, things the brain doesn't want to remember (otherwise, you'd be spending your money on Assassin's Creed or Guitar Hero 3, not a book on programming).

I believe an example can be just as simple as Hello, World, but still engaging. Is that difficult? Absolutely! Authors agonize over Chapter 1 like you wouldn't believe. How can you make a very simple program that looks cool? That promises you'll be doing something unique in this book, something worth the effort it will take? It's work, but it's possible.

So make no mistake... you can have Hello World levels of complexity without resorting to a totally trite opening example. How do I know? Well, I'd argue that we've got the best learning series on the planet, 10 books now, and none of them have Hello World as their opening examples :-)

Learning, I'm all for. Reusing examples that were boring the first time they appeared... not so much!

AddThis Feed Button

 

 

Comments


I'm in complete agreement with both this post and the previous (I guess I'd better be, huh? ;-) ). At PyCon last spring I gave a talk entitled "Goodbye hello world" for exactly that reason. And I even have some homegrown research to back us up - after replacing the same old boring "hello world" and similar text based examples with simple graphics exercises, student response to the programming unit went from 90% saying "it's boring and pointless" to around 70% thinking it was "OK" to even "Cool".

How simple were the graphics exercises? The replacement for "hello world" was drawing red circle on the center of the screen. It doesn't sound like much, but the student reaction went from "oh, yeah" to "hey, that's kinda cool." And that's a BIG improvement.

I'm new to the Head First series, and even to Java programming so I had to google "Hello World" just to figure out what you were talking about. And now, I agree with your position: Death to "Hello World".

The relevancy of the examples in the three Head First titles I've used (it's only been six weeks, give me some TIME!), made ME an active participant in my learning process. That I learn something, appears to matter to the Head First crew. The alternative process has me going through the motions, with little if nothing to hook me back to my immediate experience.

The best testimonial I can come up with comes from my experience with my teenage son. I'd been trying to hook him up with HTML for over a year using Lynda.com, some free online lessons, etc. Nothing much moved, and I dropped the issue. I brought HTML w/CSS & XHTML with me on a trip with him over the Thanksgiving break. He didn't have anything to read on the plane so, I gave him what I had. Now, he's on the last chapter, hasn't let the book leave his sight, and pesters me to get off the computer so he can practice! It almost brings tears to my eyes...sniff!

I agree with Vern's comments. I'd hear my son in the next room, "YES!" "that's so COOL!". I wish I could put this in better context for you. I don't think it's overstating to say that it's been a life altering influence that has opened a world to him that he'd long been saying "no" to. I believe it comes from the Head First strategy of putting me, the reader, in the driver's seat in the learning process.

 

Post a comment:






RSS Feed

Get the latest Head First books here!

Head First Servlets & JSP Cover Head First JavaScript Cover
Head First Software Development Cover

Head First Servlets & JSP, Second Edition, Head First JavaScript, and Head First Software Development are now available.

Buy 2 Books, Get the 3rd FREE! Use the discount code OPC10 when you buy direct from O'Reilly.

Head First SQL
Head First PMP