Tuesday, February 26, 2013

Teaching Coding


I was directed today to this article (http://www.codinghorror.com/blog/2012/05/please-dont-learn-to-code.html) that is a response to the sometimes over-the-top calls to get everyone learning to code.  

As a programmer myself (some 15+ years of Windows programming, and 5 years on Mac and iOS), I've seen a lot of code and a lot of programmers.  The issue, as I see it, is I agree that people like Mayor Bloomberg (who said he'd learn to code) don't need to learn to code, but that equally doesn't mean all people should not.

One point that was missed in the article is this viewpoint:
Technology is something that we normally earn; As a kid, you learn to bang in shaped blocks into a sorting-box toy, then you learn to push and pull things, and bolt things together and next thing you know you understand mechanics.  With electronics, we saw an abrupt halt to this "earning an understanding" of the things around us during the 1980's, when all of a sudden we had things in the home like digital watches or VCR's that grandpa couldn't use properly.

The issue I take with this, is kids already are learning a lot of programming without knowing it.  The if-structure syntax is the same as they're already learning by age three:  

Example:
"If I'm a good boy and ask nicely, daddy will buy me an ice-cream".
if((Good==YES) && (AskedNicely==YES)){
//Get ice cream code goes here.
}

Schools say that we should be teaching reading, writing and math.  That example above is just writing the logic out.  If we're teaching them to read and write language, read and write music, read and write math and algebra, why exclude logic?  If you understand logic, you're a hop, skip and a jump from electronics, software, medicine, physics, etc. 

As I've always said to lay-people:  Programmers basically do what recipe writers once did.  We work out the ingredients, and the steps and if you follow the instructions, you'll get the same result each time on the computer as a cook does with their food.

Yes, the article was correct about writing less code (and preferably none), but the skills you pick up are useful elsewhere and being taught to read and write logic is really the goal, but that's not mentioned in the article.