Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Let's make a "type the code listings" book for kids. (github.com/napcs)
39 points by bphogan on April 19, 2010 | hide | past | favorite | 33 comments


I'm hoping to get lots of people interested in helping out. I think this could be a lot of fun and a great way to show how fun programming could be. I enjoy teaching my daughter how to write little games, and I imagine others do too. I miss these old books and I think we should bring them back.


Great idea; I can contribute some Python if that's any use.

What's your plan r.e. organizing chapters? By language or by example?


I was planning to work up a structure once I saw what we ended up with. I'll take whatever we can get for languages. If we end up with a bunch of ruby and a bunch of python, maybe we see if we can get one example of each. Or maybe we just split the book into parts.


I might add some Haskell.


I think that'd be neat. And even neater if you could explain why you chose Haskell for your example over other languages.

One advantage of us doing this as a multilanguage book is we get to show how different languages solve different problems.

One disadvantage of that is it's a lot to absorb.


Actually, that's precisely what this is for Python:

http://inventwithpython.com/chapters/

The programs in this book are actually modeled after such projects from magazines and books from the early 80's.


I personally love Ruby but as a beginner language, I have found people find it a lot harder to understand than say Python, C or Basic. Ruby has a lot of what looks like "magic" syntax to an unfamiliar user. I would probably go with a different language.

Otherwise, very cool idea.


We Rubyists tend to put on the wizards hat and wave the wand around. But Ruby can be procedural too, and a lot of times can look a bit like Basic. I like Chris Pine's book "Learn To Program" because it uses Ruby very simply to teach introductory programming.

I have much respect for Python, but don't know it well enough yet to be comfortable. Would kids be frustrated by the whitespace / indenting?


Yeah, that's a good point the whitespace thing would be very frustrating. I guess Ruby could definitely be written in an easy to understand way as long as it's kept to a strict definition of what should/shouldn't be used.


Why should the whitespace be frustrating? It was never an issue for me, or anyone I know who gave it a try.

The IDE that comes with Python (IDLE) is good enough to help you with the whitespace. And even in MS Notepad it should be fine. Closing parens without editor support is much more frustrating.


The only real time whitespace can get frustrating is if you happen to mix tabs and spaces in the same file. Unfortunately this is quite an easy mistake to make (depending on how your editor is set up) if you're new to programming and don't yet understand the difference between a bunch of whitespace character and a single tab character.


Why not an environment where you're just a click or two away from browsing (editing, changing, and running) the source code of everything?

http://www.squeak.org

Edit: To encourage kids to tweak and program, make the source easy to get to and a breeze to modify. Forcing them to type The whole program to do this strikes me as a bit indirect. We did it in the early 80's because we had to. Often, there was no other way to get your hands on that particular program. Today's environment is vastly different.


I think you learn something by typing it in that you don't by scanning code on the screen. I learned a lot by typing in Applesoft Basic programs when I was 10. It's like the difference between learning a language by actively trying to speak it, vs. just reading.


That's Not the point. It's not the reading, or the typing in that's the key. It was the tweaking! Typing in source code gives you the freedom to tweak because, dammit, you typed that in in the first place! But being able to instantly change source and see the results of it instantly in the running system -- this is a much more immediate way of encouraging tweaking.

I'm saying, so long as you want to encourage X, why not directly take the steps to encourage X?


I haven't thought about it for ages, but now looking back on those days, it seems the thing I really learnt was debugging. I basically never got those programs working on the first try and trying to work out exactly what mistake I made was probably at least as educational as modifying the code to make it do new things.

That being said, I'm not entirely convinced this is still a good way to teach coding.


I don't think you're wrong. But I think we need the examples before we can prove you're right. Nothing prevents anyone from taking this code and building a lab out of it as a secondary method of learning.

Of course, you're perfectly free to set up your own project using Squeak. I bet you'd get a lot of people onboard with that. Then you can prove me wrong :)


Again you're not quite understanding the point. Squeak already is a massive project of the kind you're referring to, but substituting instant source access/change/immediate feedback for having kids type in code.


Nothing wrong with that, and it could be a valuable project. With a book, we have more options. We have the code, we can send it out as a web page, we could have it printed as a textbook, we could even build some kind of interactive system to run it.

But first we need the code. Then we can figure out what to do with it :)


I think you missed the point. Squeak is an environment where the source code of everything is just a few clicks away. Everything is easily tweakable by design.

I think that's even more accessible and tweakable than a system where the source code is 100's of keypresses away.


I think looking at source code is passive. Having to type it in is not. There's something... different about typing it in, learning by doing. We all spend our days copying and pasting. What was neat about the code books was that you couldn't cheat. Typing each keypress to understand how a loop worked was very helpful. The reward for all of that was that you could play the game. That's why they're not supposed to be long, or overly complex in the beginning.

Of course, everyone learns differently. I could certainly be way off base. But I bet most people who actually did those code listings would agree that there's a certain value there that's very hard to reproduce with view source and cut+paste.


I think looking at source code is passive. Having to type it in is not. There's something... different about typing it in, learning by doing.

Yes, but instead of getting kids into doing by forcing them to type, I think it's much better to just make the source accessible and encourage them to tweak.

You may not know this about Smalltalk, but not only can you browse the source code of everything quickly, you can change it and have those changes active instantly on a key press. In fact, the whole thing was specifically designed as a digital Montessori toy for kids.

I think forcing today's kids to type in source code will just be seen as unnecessary drudgery. If doing is what we want to encourage, why not just make it easy to do and provide some guidance in that direction?


I agree — I like to learn new programming languages from books precisely because I have to type in any tutorial material by hand.

Thanks for starting this — all this talk of closed systems keeping kids from playing with programming, and whether video games/programming was art or not was distressing.


I know there are a bunch of books like this (by a bunch like 4), but saw this one yesterday:

http://msdn.microsoft.com/en-us/beginner/bb308756.aspx

Languages aside, it's worth checking out how other people teach kids.

I remember typing in hundreds of lines of poorly visible code in the backs of magazines for the c64 probably 25 years ago.

Sounds great though.


I have found memories of pages and pages of BASIC typed in.

And a very well remembered (and still relevant) lesson that once you've typed it all in, you should type 'SAVE' before you type 'RUN'

Finding typos that you've made is a great way of learning more about the programming language too.


I want to see what we can do though, as an open community. I think there are tons of passionate people that would love to throw something like this together. At least, I sure hope there are.


I will always regret having typed in pages and pages of DATA to end up with a really rubbish side-scroller.

Let's not inflict this on another generation :)


I used to read hex-dumps over the phone with my buddy, complete with checksum in the 'pre-affordable-modem' days.

DATA statements aside, typing in reams of code from hard copy certainly ingrained the ability to predict what the code did long before finishing the typing in, and I'm sure that is something that comes in handy even today when scanning other peoples' code.

I think it is harder today to get started programming than it ever was in the past, the 'bar for entry' is no longer some crappy little game you can write in three days but some three-d studio produced glitzy epic adventure. No way 'block shoots block' is going to live up to that, even if you did write all of it yourself, and the 'enterprise' being the red block isn't much of a winner either.

Computers are no longer 'knowable', and this is another matter that needs addressing if we really want to lower the bar for understanding what goes on under the hood.


BLock shoots block is just fine for a 4th grader - at least it is for my kid.

And I think computers are knowable. Some languages are not, but others are. Ruby has a REPL that's very good as a teaching tool. I've had a lot of luck teaching with that. C++ on the other hand, or even Java, not so much.

I know it's harder than it was, but we could change that as long as we don't decide to fail by defeating ourselves.


With knowable I mean that you could at some point in the past literally know each line of code present in the memory of your machine. That's no longer the case.


    No way 'block shoots block' is going to live up to that, even if you did write all of it yourself, and the 'enterprise' being the red block isn't much of a winner either.
I used to think like you do, but my little nieces and nephews proved me wrong.


I'm 32, does that count as a kid?


My brother-in-law started something along these lines a while back: http://cymonsgames.com/


Sounds like a great idea. A free rubyproblems.com for kids so to speak.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: