Sunday, October 16, 2005

Programming

Ever have several days in a row that each have some freak coincidence? That's happening to me right now; the last incident was about 30 seconds ago when I read my brother John's blog. He and I had a conversation about a week ago concerning the exact same topic as his lastest post (the one titled "Old programs." It's not the fact that he wrote about the same thing we discussed; that's not a coincidence, but actually makes a good deal of sense. The incident was that in English class today my professor stated that writing is 80% thinking skills and 20% writing skills. She was referring to books and stuff, but I have held the same belief for computer programming for years. John's post reminded me about that and the conversation we had, and then my thoughts sped back in time about seven years to my high school Computer Science class, which was the reason that I started believing that computer programming is more of a thought process than knowledge of an actual programming language (my percentages were a bit off, I said 90% and 10%, respectively). The story goes like this:
Mr. Davidson, my computer teacher, asked me to help Beth Zehner(sp? who cares?), a fellow student, with her computer program. Reluctantly, I obeyed and walked over behind Beth as she sat at her computer. I looked at the Pascal code she had displayed on the screen and I felt like wretching (I probably would have, but I had great respect for that class and the teacher and, of course, the computers themselves). What I saw was probably the worst example of programming code that was actually intended for a purpose, not just gibberish (the kind that might be written by a person who doesn't know the language at all). Now, I've seen some horrible specimins of code and even worse style, but even Braddock doesn't compare to what I saw that day. (For a programmer's example: she was using a recursive function that could have just as easily been replaced with a while loop. That's one of the easier-to-accept errors. My brain almost immediately removed any memory of the real issues.) Then, as I sat there fixing whatever other problems there were, I learned that she wanted to be a computer programmer. "Aha!" I thought, "THIS is why programs crash." My next thought was that programming languages can be taught, programming can only be learned through experience. This led to my current 90%/10% belief.
So, yeah, that was kind of long, but I had to make a point, which was actually a sub-point of my main point, of which I still haven't given sufficient evidence. Well, maybe I'll give more later, but probably not. The freakish coincidences really don't seem as freakish in telling, so I'm just going to change the theme of this post to be that programming is 90% thinking and only 10% actual programming. I'd go back and rewrite it so that is the focus, but that requires effort, something which almost all programmers despise.

3 Comments:

Blogger phil said...

Yes, this is true. A consequence is that an experienced programmer can learn a new language in a matter of hours (minutes?). It's just a matter of learning a new syntax and (relatively simple) vocabulary. All the logic is the same

7:36 PM  
Blogger John said...

I agree with Philip. Mr. Engleka once gave me a testbook on fractals. All the programs were in some language I had never seen before. It took me about 5 minutes to figure out what they meant and translate them into Pascal.

As for bad programming styles, Mr. Engleka used to go on and on about "elegance." I still have no idea what he meant. If I can't come up with an efficient algorithm right away, I fall back on brute force. At least he managed to drill the concept of commenting into me.

Later,

7:09 PM  
Blogger Braddock said...

I feel it is best to write the whole program on one line. That why it saves paper when you print it out. Also excuse me but I coauthored Turkey Hunter (by playing starcraft and getting pizza for Tom)

6:20 PM  

Post a Comment

<< Home