Friday, December 19, 2014

Hour of code, completed

My 10 year old grandson had grabbed me the other day to help with this "hour of code" thing.  He was pretty far along but was confused about the repeat block.  I didn't really get it either but in proper Grandpa mode just fooled around a bit until he figured it out himself.

So I tried it myself just now, I figured with more than 30 years of coding under my belt, I could probably learn something too.  Despite the annoying image of that Zuckerberg clown and information about how many billionaires donated to this project I dove in.  The idea is to put together by drag and drop some "blocks" to get the angry bird to his target through a short maze like path.  More annoyance was the declaration that JavaScript is the worlds most popular programming language.  And so what if it is?  It still sucks in so many ways.

I got the "move forward" block and then advanced to the "do until done" directive and then the "if path to left" conditional and graduated to the if/else logic.  It reminded me of the Logo language created in 1967.  I never could get my kids interested in that.  I think they were more involved in fighting over what to wear to school.  But is was nice to see Grandboy getting interested.

But it's a tough sell when compared to building forts and staging battles in "Clash of Clans".  That's much more exciting than "move forward" and crashing into walls if the number of steps is wrong.

The one thing that really bothered me about this hour of code programming was that after each exercise it reported something like "that's correct but you could have done it in fewer steps".  A program can always be done in less steps, but is that the only criteria?  NO.  It's probably the least important thing.  I learned long ago from Fred Carter (thanks, Fred) that the compiler optimizer is going to rearrange everything anyway so just write it clean and easy to understand then let the machine do it's job.  As I write this I get more angry about this attitude.  It's just a little boy "I can do it better" thing that doesn't belong in a production setting.  But that's why we have so many stupid bugs today isn't it?  That recent DNS problem was caused by a programmer clown thinking he understood the default path in some if/then/else code instead of writing it all out so it would be clear and correct. 

Enough for now, regards.


No comments: