• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

[ADDITIONAL STUDENT CHALLENGE] Exercise your critical thinking skills

 
Marshal
Posts: 16590
277
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
NOTE: See first two paragraphs in this post https://coderanch.com/t/689726/java/STUDENT-CHALLENGE-suggested-threads-reply to understand the context of this thread.

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.

The Premise

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.
 
Junilu Lacar
Marshal
Posts: 16590
277
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For convenience, this is the code you should discuss:
 
reply
    Bookmark Topic Watch Topic
  • New Topic