[thelist] functionitis

Rob Smith rob.smith at THERMON.com
Thu Apr 3 11:49:45 CST 2003


<snip>
How do you make these kinds of decisions on whether or not to build a
new function?
</snip>

(My) Answer: 

1) Anytime you think you have to run a routine more than once. 
2) Anytime you think you can eliminate "spaghetti code" and reiterations by
using a function.
3) Anytime you think you can use that function again ... whenever.
4) Anytime you think you can benefit from modular design instead of linear
design.
i.e. I was working for Metrowerks(.com) as an Intern (Technical Writing
group). One of the guys impressed me in that one of the entire manuals for
CodeWarrior 6, I suppose, was completely modular. Each section was a
separate file and used SGML to do #include these sections. 
5) and so on...

Rob


More information about the thelist mailing list