Thursday, November 03, 2005

 

Explaining programming

It's fun and frustrating watching someone learn programming. My friend Bill, an excellent math student, is working on some projects involving VBScript at work. It's interesting seeing the order in which he gains knowledge. It seems to begin with blind trial and error - Google, MSDN and help files produce code which is copied and pasted without understanding. It seems that the mother of awareness is laziness. He noticed that there was a lot of repetition in the code he was putting out so he changed some string constants to variables to cut down on typing. Soon, subroutines (and a vague awareness of the stack). The subroutines resulted in a ton of sphagetti code. It seemed that half of his routines called another routine. Operator precedence was an issue until recently. Today he "got" functions. I think.

He's still a little bit unclear on statements vs. expressions and foreach loops. Confounding the problem is the test automation tool he is working in. Their objects that should be returning a collection (for instance, Window.Children) are returning arrays that aren't enumeratable. That means you have to setup a for loop. I spent about 30 minutes poking at a foreach. You know, I should email those guys.

Comments:
I recently learned VBscript myself. Collections rock. Your story about Bill reminds me of when I was first learning C and I couldn't grasp the concept of a "pointer" for literally weeks.
 
Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?