This is primarily for any of our new Ranchers who are students wanting to complete their quota of posting to online forums. Anyone else is still welcome to contribute to the discussion.
We often say around here that programming is 10% typing and 90% thinking.
At dinner last night, I was asked "How should students be taught how to program?" when I started to gripe (again) about how students are taught computer programming these days. I gave the following analogy:
In your high school English classes, you were probably taught vocabulary, grammar, and composition, right? In my opinion, the most important part in writing is composition. Whether it's an essay for English or a program for a CS course, what makes your work "good" is really the composition part. The way students are taught programming at most places of higher education these days, however, it's basically all about vocabulary and grammar. That is, it's mostly about syntax and algorithms. When it comes to writing computer programs, "composition" is about design. Good composition and good design have at least one thing in common: a clear and coherent expression of ideas.
The coding horror of Arrow Code is very easy to recognize once you know what it is. People who don't know much about "composition", i.e. design, in programming are usually the ones who write horrific Arrow Code.
The Challenge Look at the code in the first post in this thread (see below also). It is an example of the Arrow Code antipattern (follow the other link and read about Arrow Code if you haven't already). That should be immediately apparent to you at first glance.
Discuss this: What can you do to make that code better and eliminate or reduce the amount of arrow code?
Please post your answers as replies in this thread.