One way to write Ovid
's program is to ask yourself what you have to do with this code.
- Get the expense info.
- Munge the info; in this case, sort by department.
- Write a report.
Once you know what you have to do, you might be able to write the very beginning of the program. In this case, you can write the 3 lines which use the functions you will write later. And if you follow BrowserUK
, you can write 'functions' which print OK.
You've only written code that you need to write - the function names came right out of your task description. The functional nature lends a bit of maintainability. And it keeps you honest about what you're trying to do.
Perl programming and scheduling in the corporate world,
"Uhh ... that'll take me three weeks, broken down as follows: 1 day for coding, the rest for meetings to explain why I only need 1 day for coding."