Hello World!
Language choice can be quite a hot topic amongst us geeks. In the preface Warren defends his choice of Python with a bullet list I'll summarize here.
- Python was created from the start to be easy to learn.
- Python is free.
- Python is open source software.
- Python is not just a 'toy' language.
- Python is multi-platform.
- Warren likes Python and thinks others will like it too.
I think the list is pretty solid. The only one I think may not be directly applicable to the case it hand is the FOSS angle. Warren explains that being open means that more can be done with the software and that there is a large set of corresponding code out there freely available. A case could be made that this is also true of more closed languages. The one thing I think that could make this important is if the teacher of the material is interested in not just teaching the technical side of programming but is also interested in communicating the philosophical values of freedom. In light of the amount of closed source software and ignorance in regards to FOSS options I've seen in the public school system where I live, I think this may be more important than some think.
The rest of the reasons though I think make Python an incredibly solid choice, and above all else is the simplicity. My daughter has been able to have fun typing code into IDLE without having to get hung up with a complicated environment. The syntax is clean and simple, there is no compiling, it's very easy to just jump in and start making things happen. I think this is important, the younger the student. I was concerned that nine might be just a touch too young for this undertaking. The book itself does not make any recommendations concerning age. The more I've thought about it, the more I agree with that choice. Children vary so greatly and any number chosen would be rather arbitrary. My nine your old has done well so far, but she is already quite a book worm and leans towards more academic pursuits. An older child may struggle and there may be some that are even younger that would be fine with the material in Hello World! So rather than focus on age I think a parent needs to come at this from a perspective of ability, proclivity and experience.
In the ability area, a child is going to know how to read, work with a mouse, and type things via the keyboard. Of course the mouse is optional strictly speaking but most will probably want to use it. Some math skill would be good as well as the ability to understand the use of variables. The book tackles the necessary material in a kid friendly way but it is not dumbed down. In fact the learning potential here is huge, as one may imagine. The book is formatted with lots of visuals and fly-outs that give information on how computers operate and how programming languages deal with information processing. My daughter and I have already had interesting discussions on subjects like integers and floats. An example that draws a sine wave lead to a great teachable moment about amplitude and wave length. Then there is the constant need for approaching problem solving in a structured manner using logic. I think that taking on programming brings a wide number of benefits.
One of the features, is a little caricature of Carter that is placed throughout the book with observations that the real Carter made as he learned with his dad. These are things that a real kid noticed, and so they are likely to stand out to a child working through this book. For instance in the chapter on "Print Formatting and Strings" Carter says, "I thought the % sign was used for the modulus operator!" The book explains that Python uses context to choose how the % sign is used. There are other little cartoon characters that appear throughout the book drawing attention to important points that need to be remembered. Learning is reinforced through quizzes at the end of the chapters. The chapters are not too long but I've found that my daughter and I have to break them into sections because of her typing speed. I've been tempted at times to move things along by typing for her but I know that she will not get the same benefit from the exercise if we do it that way. I will also let errors slide by at times to allow her the opportunity to look at error messages and find the problems.
As I mentioned the book is billed as being for kids and "other beginners." I'm going to say that the primary focus is rightly on kids, and probably kids who are in grade school or maybe junior high. This is not to say that the examples and information wouldn't be great for anyone brand new to programming. There are even some nuggets for someone who has written some code but is new to Python. I am going to guess though that the average high school student will not be as taken with the cartoons and puns. I'd have loved to have written my own lunar lander game at that age though, so maybe I'm selling this short, or maybe it would be something a teen would be happy to work on away from the eyes of others, so as not to appear childish. (I may take heat for this but even as a teenage geek I was immensely worried about the perceptions of my peer group.) I think an adult that was serious about learning to program, even if they had no prior experience, would do better with heavier material. All that said, I think for children they've really hit the sweet spot and as much as marketers would like it to be so, no book can be everything to everyone.
Things start simple with print statements and loops that took me back to good old days of watching messages scroll endlessly by on display computers at Sears when I was a kid. The move towards games starts even then with text and quickly moves on to leveraging Pygame for games that utilize graphics. I think this is important as it keeps things entertaining while teaching important concepts at the same time. I have to say it is quite a bit fun to sit with my child discussing nested loops and decision trees. By the end of the book examples will have included a simple virtual pet, a downhill skiing game and a lunar lander simulation.
I've discussed a child's ability a bit but I think the last two things I mentioned must be taken into account as well. They are proclivity and experience. I've let my daughter drive the time we spend working on this. Just like the parents who project their sports dreams on their kids, I think there is a possibility to do the same with my love for all things digital. It may even be easier to do so as I view the ability to do some amount of programming to be an important life skill. The thing is I don't want to push her too hard and have her back away from it completely. This fits in with the experience part. We take it as it goes, and if things stop being fun, we will back off. I don't do this with her core disciplines from school like reading and math, but for something that is extra right now I'm not going to push. It would transition from being a joy to being work. That brings up a last and unexpected benefit from Hello World! I'm rediscovering a lot of the fun and excitement that drew me into this industry in the first place.
You can purchase Hello World! from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Thanks for the review, you just gave me an idea for what I'm going to be getting my nephews for their respective birthdays. Awesome! :)
Going to be very disappointed if I get stuck. "This is so simple, even a child can do it! Someone get me a child, I can't make heads nor tails of it!"
Kwisatz Haderach
Sell the spice to CHOAM
This Mahdi took Shaddam's Throne
You went out of your way to praise your Dad for having the foresight to move beyond his comfort zone by bringing home a computer. Isn't computing simply your version of "sports and cars"? Shouldn't you be trying to emulate your father by moving beyond your comfort zone and bringing home something that will inspire your kids to pursue their own interests rather than yours?
Oh, I remember my first days of trying to get anything to work in C. (This was in the days of DOS, before Windows). Hopeless! I'd be trying to program Hello World or a very small addition to hello world like type in a character, and have to reboot the PC because I overwrote system memory :-)
There is a really nice, free alternative available in "How to think like a computer scientist". Despite the title, it's aimed regular school kids and is being used to teach a class on python programming. It's just come out in a second edition. http://openbookproject.net//thinkCSpy/
TCAP-Abort
Here's a question: If we teach our kids to program, do we start them on:
10 N=N+1
20 PRINT N
GOTO 10
or OnClick="doHelloWorld"
After learning to program on a TRS-80 and later GWBASIC but now doing ASP.NET, I find myself looking at code (ExecuteSacalar()) as if every step takes 1/100th of a second, thus slowing performance. When in actuality, it takes a microsecond. Are we better off teaching them how to write an algorithm (How much is 1 + 2 + 3 + ... + N?) or to start with finding what they need in a library? I've seen advantages and disadvantages to both my career.
Much of what I do now is finding the best canned operation (GridView) and toying with styles, rather than rolling my own Repeater. Seldom, but not never, does knowing how to step through a string get used. Although rolling my own DDL's is faster than letting .NET do it.
Should we teach our kids how to ride a motorcycle where pedaling isn't needed? Or do they need to learn to pedal before they ride a motorcycle?
Why, Lord, Oh why are blocks defined by indentation!
is that not only does it teach programming but as a side effect you're kids are guaranteed to be safe from pregnancy, STDs, or any form of social life.
The expectations of today's 9 - 14 year old is very different than for those of us learning BASIC on a Commodore or Atari in the early 80s. I tried Scratch and Kidsprogramminglanguage with my now-13 year old. As soon as he saw the creations we could make he said "at what point do I get to make a game like on Xbox or my computer?" He just wasn't satisfied making lines on the screen or adding numbers or helping to solve his math homework (when it would be easier to solve it in his head). So, yes it would be cool to make lunar lander and I would have also been soooo happy to have such a game in 1983.
Then again, his favorite games now are often on Kongregate - sometimes the simpler the better, like launching a stick figure out of a cannon and solving various puzzles of angle, thrust, bounce etc. So maybe it is possible, but it needs to be graphic, challenging and most of all fun.
This post brought to you by your friendly neighborhood MBA.
I'm not sure I agree with Python either, but popularity of the language shouldn't really enter into the equation at this stage. What you want is a language that will be easy enough for them to pick up without being overly frustrated but powerful enough to allow them to create programs that actually do something useful. The purpose is to try and spur interest in programming, not train them for a job.
The first language I did any programming in was Applesoft Basic, because the household computer happened to be an Apple IIgs, and it was included. After that, I was taught Pascal in high school. After that, I learned Fortran 77. Now, I do a fair amount of development work, but don't use any of those languages. And yet, learning them was not a waste of time, and in fact taught me a lot of concepts that made me a better programmer down the road with other languages.
Of course, my experience with Fortran also gave me a deep abiding hatred for languages that enforce indentation, which may be one of the reasons I never picked up Python.
Back then, if you wanted to play a game you often had to copy programs from source code listings. So you had things like line validators (checksum as you entered each line) and whole sections devoted to programming. The projects, I think, were also very different. I remember building a WeFax device to decode satellite weather facsimile images. There was also the Ciarcia articles that talked about everything from building a micro-computer to assembly programming.
Sure, there are still programming magazines, but we don't have to solve the same things we did then. Now it's just a matter of running CPAN, downloading a Flash or Java snippet, or just a #include.
That's why I'm super grateful for the availability of Linux, free software, and the suite of compilers. I remember saving up for weeks to purchase Megamax C and later GFA BASIC. I remember borrowing a Z80 card so that I could run Borland Turbo Pascal. Now it's a quick download and every language I want is available within moments.
The downside is that it's a lot more complex now. If I wanted to make a graphics program back then, for example on TI BASIC, it was a relatively simple matter to redefine a character set with a bunch of POKEs. Now we have to worry about initializing a window, internationalization, acceleration, etc.. Sometimes it's a bit daunting for non-professionals. Sure, there things like SDL and TCL/TK and a raft of IDEs, but still I don't think it is as easy as it was back then. (Of course, today's software does a lot more).
So you had things like line validators (checksum as you entered each line)
:)
Wow, now that brings back memories. I remember typing many, many lines of numbers (with the checksum at the end) and then finally having a stick-figure or something dodge falling balls...
Of course, the real fun began when I finally learned what those numbers meant
It seems to me if I had a child and wanted to teach them programming, I'd do it using these three techs in this order. You don't need any special software to write any of them, they are easy to learn, and there are millions of free examples available to you. The best thing is, no compiling, no need for a server. You can write a bit of code, open it with your browser and get instant gratification.
Taking guns away from the 99% gives the 1% 100% of the power.
Hand your kid a copy of The C Programming Language. If they can't handle that, they are not ready.
Why not just chase him around the yard with a baseball bat?
A lot more humane than your proposal.
What?
I love the Lament, it's incredible.
I'd guess (hope?) that you don't bring this book out until / unless your child shows an interest.
But at some point you have to show them SOMETHING though, right? If you don't show them, how will they know what there is to be interested in?
Actually, I would say it is more akin to teaching kids how to drive in an old beater with a sloppy transmission and bad alignment. Sure, once they figure out all of the little tricks that are needed to nurse it along, they will be better drivers, but it forces them to deal with a lot of extraneous issues while they are still trying to figure out how to handle traffic laws and keep the car on the road.
I got into computers because I could hack the BASIC games on an Apple ][+
Accessibility is king! But finding which thread to grab amidst the jumble of a modern GUI OS is tricky!!
I have just started playing with "Processing" and it seems to have a nice mix of understandable code and super powerful libraries to take advantage of: cross platform, modern hardware and complex meta-behaviours that we might expect.
As well, I am "sandboxing" with "Parallels" on top of OSX and I have found it to be very stable. (It allows virtualization of Windows flavours, OS X & varieties of linuxen concurrently) The images can be booted Read Only or not. Creating a bulletproof, clean starting environment is what kids(and productions) need, and virtualization images might be part of this.
I'm new to virtualization, but it feels like the future to me. Since I have taught in hands-on Lab settings I think this is a better solution for a shared use lab than straight up disk imaging... It would allow week by week, class by class customization of the Boot Image, and changes could always be rolled back.
Python was created from the start to be easy to learn But I think BASIC on VIC-20 was even easier to learn then Python : no need to use colons or indenting! And what about the dreaded ==, impossible to understant for a kid! Mod me troll.
When I had my CBM64 I really wanted my dad to join in the fun of me learning to program - he seemed quite interested but this is how the conversation went...
ME: So, dad, we're going to print the phrase "Hello Dad" on the screen then print loads of them - it'll be fun
DAD: OK
ME: To print something we use the PRINT command so to print this phrase we type 10 PRINT "HELLO DAD" - 10 is the line number - like a number in an instruction book.
DAD: OK - But why PRINT?
ME: Errr, because that's the command...
DAD: Hmmmm, OK
ME: To print it loads we then type "20 GOTO 10", this means it will GOTO line 10 and print it again..
DAD: Why GOTO
ME: Errr, because that's the command...
DAD: OK
ME: now we can run it by typing RUN (Hello Dad scrolls up the screen)
DAD: Why RUN?
ME: Oh FUCK OFF - you're like a 3 year old!
That was the end of my dad's programming.
In fact, if you do this to C code, you can run it through "indent" and it will come out clearly indented for you. It sounds like such a program is impossible for python because it depends so much on how things are indented to start with.
Yes, it's impossible in Python. And also unneccessary.
Let's see how smart you are when you get someone's code that isn't so clean in the whitespace department, and won't run anymore once you've opened it and saved it...
The whitespace requirement of Python sucks. I don't like programs whose behaviors are dictated by characters that I can't see and that aren't standard across editors.
If you're so into white space, be a man and use Whitespace.
I'm a fan of perl, Ruby, and bash when it comes to scripting.
Long live the BSD license
In DOS, without a memory manager, if you use pointers / arrays you have unrestricted access to every byte of RAM on the computer. Completely raw. Think about every time you get a segfault or a "Program performed an illegal operation" - that could easily be a dead system right there.
-- All your booze are belong to us.
If any parents are reading this, just wanted to mention I've (+other's help) written an article on wikipedia covering the educational programming language domain:
http://en.wikipedia.org/wiki/Educational_programming_language