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

Re: Why and how to re-use code to make better applications and you a better programmer. (discussion)

by bikeNomad (Priest)
on Jun 29, 2001 at 18:45 UTC ( [id://92645]=note: print w/replies, xml ) Need Help??


in reply to Why and how to re-use code to make better applications and you a better programmer. (discussion)

It gets even better after you've tried to apply your "general" solution a third time and found that it wasn't easy to re-apply. So you go back over the first two.

I've worked with several large OO frameworks. The most successful of these started out as successful applications, then gradually became frameworks as people copied the applications and re-used the code.

At some point (like after the first three applications), a re-factoring was done that expressed the common code into a simple framework. Capabilities were only added to the framework as it could be proven that they were needed, and only after considerable thought.

I've also seen cases where people tried to write general frameworks up front, and ended up writing lots and lots of code to support functionality that no one actually needed in practice. This is a waste of time and a source of bugs.

So I'd modify the recommendations given above to add step

6: iterate back over 4 and 5 with the next few new applications, refactoring as needed, and being willing to touch existing applications to bring them in line with the newest version of the module, library, or framework.

It's a lot better to have several working applications that use the same shared code. New users of the shared code can then look at the applications and see how to do it without being distracted by historical remnants.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-03-29 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found