Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Superficially it seems that you advocate the whirlpool model instead of the waterfall one. But really you advocate tripping blindly in the dark. As I will show, there is nothing wrong with the method of your teacher but you are getting the wrong lessons out ouf it!

1. fix the code so it compiled and ran

Most compilers run completely out of sync at the first syntactical error and produce a cascad of errors. So incremental fixing is a way to get a program to compile. That was probably the lesson the teacher wanted you to learn. I don't see any other interesting lessons to get from that. Getting a program to compile is no big deal!

2. modify it so it did something slightly different.

That's the way we do everything. Proceed from the known to the new. We never start anything from scratch but learn from previous experience. The good teacher is the one that impose in an new exercice a "slightly difference" so that the pupil can both build his confidence and exercice his own initiative.

But deducing from these exercices that programming is incremental fixing of bugs is dead wrong. Incremental improvment of programs, or Larry's whirlpool (as opposed to the waterfall model) is way more than that. Testing and fixing is just the inner loop or the whirlpoool. But what you propose is not even that, it is the blind fixing of visible bugs probably creating countless of bugs elsewhere. In the linux kernel mailing list,there are recurring threads about self-proclaimed the bastard Linus against getting a debugger in the kernel to fight this natural but wrong tendency: "just fix the next bug" and to encourage programmers to always get the larger view

I guess I could derive my mantra from Arthur Koestler notion of holon.

Every complex system is an holarchy where higher holons depends on lower ones. A program is such an holarchy and the first thing to know is at which stage of the holarchy you need to work. Fixing blindly bugs after bugs is working on lower holons and at best building scar tissues. In more pragmatic term, getting local optima (here fixing given bugs) are no guaranty of a global optimum. And we live in a society where every one is a specialist of some holon and is able and prone to get a local optimal there but is likely create a disaster at higher level. Example: "an optimal so-called liberalist american economy is likely to wreck the global ecosystem because it does not care about global warming". Pick up your favorite example.

So the mantra is Which holon needs working? or in term of Larry's whirlpool Which loop of the whirlpool needs work?

Certainly, these mantra, as any mantra, set the mind but, by themselves, do not define any course of action. The devil is in the details and we must go define in a given fields what an holarchy is and from which holon it is made. Different schools of programming have various ideas about that.

I like the concept of holon and holarchy but beware not to get in new-age drug induced illiterrate holistic dreams!!

-- stefp -- check out TeXmacs wiki


In reply to Re: Re: Re: Programming Mantras by stefp
in thread Programming Mantras by dws

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2024-03-28 19:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found