Perl: the Markov chain saw | |
PerlMonks |
Read Code Complete, young Grasshopperby dragonchild (Archbishop) |
on Nov 02, 2001 at 23:05 UTC ( [id://122888]=note: print w/replies, xml ) | Need Help?? |
Re-factoring hurts The basic idea is that you want to design interfaces to activities, not subroutines. You want to design a way to write using a bunch of "fire-and-forget" actions that map into your problemspace. For example, I'm assuming you're not going to run afoul of tilly/tye/merlyn and are using CGI. That is a way of mapping actions onto your problemspace, not onto code. That's what I'm talking about. Identify the actions you want to take, then write a subroutine for each action the problemspace you want to take. Now, to finish that top-level subroutine, you now have a new problemspace. Keep doing the same thing, over and over. This is factoring. Where do you stop?
------ Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
In Section
Seekers of Perl Wisdom
|
|