Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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
[ambrus]: "different specialized employees in different rooms" => so, there's a cleaner guy who cleans up the vomit from the bathroom every morning?
[erix]: makes me think of MMM too (mythical man month): "adding more people to a project makes it slower"
[erix]: that should be "to an already-too-late- project" I think
[ambrus]: oh yes, we have a pretty good example of that when they reorganized the grill place in the restaurant nearby.
[ambrus]: it now has two more people working there, and they're serving slower and more expensive.
[ambrus]: It used to be just a master cook who takes the order and puts the meat and eggs on the open grill plate table, and an assistant who removes them to a plate, adds the side dish, and gives the plate to the people in the queue, plus a cashier.
[ambrus]: Now it has five people instead of three, some sort of call number ticket system where people wait a lot for their food to get ready (it's the same kinds of grilled meat and fish on the same equipment, it won't actually fry slower),
[ambrus]: it's slow as hell, and the food costs significantly more.
[ambrus]: We no longer eat there.
LanX Everybody quotes it, some people read it, and a few people go by it

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (13)
As of 2017-09-22 13:49 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (264 votes). Check out past polls.