Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re-inventing the wheel is a 'Good Thing'

by Molt (Chaplain)
on Apr 29, 2002 at 11:15 UTC ( [id://162802]=note: print w/replies, xml ) Need Help??


in reply to Re-inventing the wheel is a 'Good Thing'

Okay, I admit it. I'm one of the people who tend to tell people not to reinvent the wheel, and yet whilst doing this I often have my incredibly crufty Inline::CPP self-built analogue of Data::Dumper sitting happily in an editor on my desktop.

Hypocritical? Maybe.

Pragmatic? Most certainly.

When I tell people to reuse existing wheels it's because it sounds like they're after something to use in a larger project, and the best way to get something that works reliably and quickly is to use the tried and tested solution. It should work well enough, and you probably won't end up with as many holes for people to poke at as if you'd just deployed the untested and unviewed by others code.

So, why am I redoing Data::Dumper? Does the original have problems? From what I gather the answer to this is 'Yes, but I don't think I'm yet up to the task of fixing them, or building a better version'. I'm doing it to develop my skills, my understanding, not to develop a product. When I do things requiring persistant data for production work I reach for the original, or another recognised varient upon the same basic theme.

Essentially I think there's three circumstances.. When you need the wheel to work properly and don't have the time or ability to build Wheel++ then go with the existing wheels; when you have time to learn new things try and develop your own version of existing things- you probably won't acheive the same quality, but you learn, and you can use the original versions more effectively when the time comes; and the final state is both having the time and ability to build the better wheel in which case go to it.

One favour though, please try and modify the existing wheels rather than creating a new one wholesale unless there's absolutely no way round it. We lesser mortals do not want to spend too long learning to build new axles!

Now, if you'll excuse me I have to hack some more at a wheel that's looking remarkably square at the moment. All part of the wheelwright's craft, I hope to get nice round wheels eventually though and when that comes I'll let others use my wheels.

  • Comment on Re: Re-inventing the wheel is a 'Good Thing'

Replies are listed 'Best First'.
Re: Re: Re-inventing the wheel is a 'Good Thing'
by demerphq (Chancellor) on May 16, 2002 at 11:41 UTC
    my incredibly crufty Inline::CPP self-built analogue of Data::Dumper

    Interesting. You and I should chat. :-)

    So, why am I redoing Data::Dumper? Does the original have problems? From what I gather the answer to this is 'Yes, but I don't think I'm yet up to the task of fixing them, or building a better version'. I'm doing it to develop my skills, my understanding, not to develop a product. When I do things requiring persistant data for production work I reach for the original, or another recognised varient upon the same basic theme.

    Bravo. I too have been reinventing this particular wheel. (See Reinventing the wheel: Dumper Difficulties). I can guarantee that you will learn cool stuff.

    Not to be egotistical but I know im up to the task of fixing them (at least at the perl level). If you or anyone else was interested in working with me to produce an XS version of my code then I would be happy indeed to have the collaboration.

    As for using Data::Dumper for persistancy purposes I strongly recommend that you dont if the data strcutres in question are self referential, and if they involve refernces to items contained in aggregate objects. These will be dumped very subtly and seriously wrong.

    Which brings me to my point. Anonny monk (Yillt?) said that wheels dont get to be standard unless many people have looked at them... True. But Data::Dumper is an example of where many many worked patched reviewd and analyzed (and they are some of the best) but did they notice the subtle bugs? No they didnt. In fact I didnt even notice the bug in my own code becuase I foolishly assumed that Data::Dumper couldnt get things that wrong. I completely agree with tadman when he says we would still be driving around on stone wheels mounted on wooden pegs.

    The moral for me is that reinventing wheels is fine and dandy, so long as you have studied the shit out of the subject first...

    ... Or are doing it for plain and simple self satisfation, either as a learning exercise or as mountain climbing. Why did I climb it? Hmm, good question. I suppose because it was there?

    Yves / DeMerphq
    ---
    Writing a good benchmark isnt as easy as it might look.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://162802]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-25 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found