There are loads of websites / apps available for teaching kids coding. The most notable success story of late is Codecademy. Codecademy engages children through gaming culture; there are hundreds of coding exercises which the user can complete and earn points and badges along the way.
You just type the JavaScript right into the browser and it explains to you exactly what to do. This is pretty sweet, and definitely more engaging than just getting kids to read a book.
It's good, but it's a bit risky. After all, the average Computer Science degree will teach you how to think about code, not to write it, and it is pretty universally agreed that this is a good idea, and not at all a waste of time. By teaching kids how to code in tutorial form, they end up knowing how to write an if statement to solve a specific problem, but do they really understand how control flows through the program, or know when you need to put an if statement in your code?
It's just teaching you to fill in the blanks:
The fundamental problem is my two friends need me to teach them how to think in code, how to conceptualize the problem, how to understand that "i am taking this problem, i am working out a solution in my brain, in english, and then i will write this solution in code" They simply do not have the capacity to do that. And they are 5 months in through codecademy.
Just yesterday my friend had the idea that when using a for loop, the loop passed all values at the same time to the nested switch statement, upon which the switch statement would evaluate ALL the variables at the same time, using whatever the hell case was the best match. He couldn't pass the level because he did not visualize in his head that the for loop passes each value, one at time. Then it procedurely flows down, line-by-line into the switch statement... and so on. My friends do not have pictures in their head about how code works, why it works that way, and how to use those pictures to draw their own.
They don't know how to code.
And the worrying thing is, that I would imagine a proportion of new programmers taught in this way would give up, and the rest would read a book or ask a friend that could take a step back and explain what is actually going on within their program. That was before Stack Overflow.
Stack Overflow is a Q&A site for programming, and if you've never head of it before then I'm surprised you're reading this blog; it is incredibly successful. It is a great resource for new (and experienced) coders because if you're having a problem with some code, you post it up there and you're likely to receive several answers pointing you in the right direction. Suddenly if you’re not sure why your program isn't working due to a lack of understanding of the fundamentals, you can post your code up and get an answer along the lines of "change the third line to do this". The person that answered the question goes away happy that their program is now shiny and working, but they haven't really learned anything at all.
Of course, you'd hope that the person answering the question would give some guidance on why they need to change the third line of code, but this quite often consists of a link to some depressing MSDN documentation or API listing.
There is a lot of this going on. It's really easy to Google how to make a cool menu bar, or a dialog, or any other programming task. My fear is that once the tutorial-taught programmers get out into the real world, the approach will become "find some code that does something like what I want to do, and get someone to tell me what to change so that it also does X".
There is a lot of this going on; here are a couple of examples:
http://stackoverflow.com/questions/10523245/with-jquery-ui-dialog-i-want-to-know-ok-button-selected-or-cancel-button
http://stackoverflow.com/questions/10518913/trying-to-search-wunderground-locations-with-javascript-jquery-and-html
The excellent blog post by Matt Gemmel at www.whathaveyoutried.com, addresses the kind of question that crops up along the lines of "I need some code to display a slideshow of images, how do I do that?" Although that kind of question bothers me, the ones I linked above worry me more. These are the kind of programmers that, if we're not vigilant, may get employed to write software you will have to use someday.
Peter Norvig's "Teach Yourself Programming in Ten Years", really reflects my concerns well. We're selling the industry short if we start to act like learning to program is something that you can do in a week. I personally spent about five years learning programming at school / University, followed up by several years of industry experience.
What can we do about it? Let's slow down and emphasise the importance of understanding rather than achievement. Sites like Codecademy should try to back up their tutorials with a little extra explanation, and appreciation for the craft of writing code. And to all of the Stack Overflow users, when you tell someone to change line three of their code, please tell them why.
