Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

A bad scripting section for teaching examples?

by Marza (Vicar)
on Jan 12, 2003 at 21:31 UTC ( #226335=monkdiscuss: print w/replies, xml ) Need Help??

I was tasked with re-writing a routine that managed the sendmail include file alias lists. The original routine was scary in what it did.

Stuff noticed:

33 loops to perform things ranging from reading/writing files, running a menu, to making sure an array was empty before using it.

Some of the logic was verify array was empty, load the file to an array, load the array to a variable, search the variable for an entry, add or delete something, load the variable back to an array, write to file. All of this with 6 loops

There is much more but then this post would be big! ;-)

What I was wondering is if there would be any worth publishing such messes for training purposes under the guise of say what not to do?

Just a random thought on a Sunday.

  • Comment on A bad scripting section for teaching examples?

Replies are listed 'Best First'.
Re: A bad scripting section for teaching examples?
by ajt (Prior) on Jan 12, 2003 at 22:06 UTC
Re: A bad scripting section for teaching examples?
by BUU (Prior) on Jan 12, 2003 at 22:02 UTC
Re: A bad scripting section for teaching examples?
by Anonymous Monk on Jan 13, 2003 at 02:15 UTC
    Perl logic dictates that bad programmers do not know that they are bad, they would not go looking for examples of what not to do - they will look for what to do do :-)

    You definitely have to bring the material to the people instead of waiting for them to come to the material...


Re: A bad scripting section for teaching examples?
by Bismark (Scribe) on Jan 13, 2003 at 15:07 UTC
    I think that something like this could be useful, but the errors would have to be categorized 
    in some fashion so that they could be searchable. Maybe listed by purpose of what the programmer wanted to achieve and why it did not work.
    Otherwise I do not know if anyone would want to read it just to see bad axamples. Kerry credo quia absurdum
Re: A bad scripting section for teaching examples?
by data64 (Chaplain) on Jan 17, 2003 at 23:04 UTC

    Ooooo, Anti-patterns. I like it.

    I have learned quite a bit from examples showing how not to write code, and what techniques to avoid.

    Just a tongue-tied, twisted, earth-bound misfit. -- Pink Floyd

      All right then! I think I will crack the knuckles and attempt to get something published! This will be interesting! Probably will have to put a couple of the subs up for code review as the article would lose its strength if I did something wierd as well.

      Thanks for the links all! I will review and start the work!

      Wow merlyn must be trembling now! ;-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: monkdiscuss [id://226335]
Approved by ajt
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2020-10-22 17:34 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (229 votes). Check out past polls.