Loading ...
Sorry, an error occurred while loading the content.

112088Re: [XP] KISS

Expand Messages
  • Steven J. Owens
    Sep 8 2:26 PM
      > Wednesday, June 29, 2005, 12:59:47 AM, Clark, David wrote:
      > > I teach an introductory programming subject to students [...]
      > > So what to use for the simplicity measure?

      As a quick aside, I prefer "clarity" to "simplicity." Clarity is
      something that is easier to point at than simplicty. Even if you can
      still disagree on whether something is clearer or not, you can at
      least discuss more usefully why or how it's clearer or not.

      My rationale is that the more clearly the programmer's intent is
      expressed in the code, the better the compiler can optimize. And
      generally the compiler's optimizations will be better than any that I
      have time/energy/smarts to add... until I measure and find that it's
      not good enough, in which case I'll do a more rigorous performance
      analysis. Add in here the usual arguments against early optimization
      and the usual advice on the right way to do optimization :-).

      On Wed, Jun 29, 2005 at 06:30:50AM -0500, Doug Swartz wrote:
      > [...]
      > Simplicity is truly in the eyes of the beholder. The only
      > reason simplicity is important, is because, unlike code written
      > for college courses, code written for industry is usually read
      > many more times than it is written. Thus it is dependent on
      > the experience, skill, and biases of the reader.
      > You could look at using some of the automated complexity
      > calculation algorithms: cyclomatic, essential, .... I'm not a
      > fan of these, but they're, perhaps, better than nothing.
      > Another approach is Steven's suggestion to have the students
      > rate each other's work for simplicity. It is subjective, but
      > it's a good approach because, as noted above, the goal of
      > simplicity is "in the eye of the beholder". I

      Does it have to be rated on each project? Maybe follow up each
      project with a review of a solution turned in for the previous class,
      and an examination of how the code could have been simplified and
      refactored. If you want to be brave, you could use a solution from a
      current student, but I'd be wary of the emotions & politics that could
      introduce :-).

      Or you could make it an extra credit assignment - given this
      solution to the project you last completed, what change would be the
      best way to improve the clarity of the code. Best suggestion gets
      five extra points.

      Steven J. Owens

      "I'm going to make broad, sweeping generalizations and strong,
      declarative statements, because otherwise I'll be here all night and
      this document will be four times longer and much less fun to read.
      Take it all with a grain of salt." - http://darksleep.com/notablog
    • Show all 17 messages in this topic