I think that the authors of the
::Simple modules deserve some credit for identifying the core functionality of a module and concentrating on that. They deserve real credit if they manage to "keep it simple".
For example, over two years ago I was developing an Excel library in C when I came across a simple hack to generate minimal Excel binary files with very little code. At the time I was using Perl to generate CSV file for importation into Excel and thought that I could try to produce a binary file instead. To my surprise it worked out very well: mainly due to, my now beloved,
pack() function.
I posted the code to comp.lang.perl.modules in response to a question. It was about 200 lines of code and comments. After that I rolled it into a module and posted it to CPAN as
Spreadsheet::WriteExcel. It was about 600 lines including POD. And it was very simple: it wrote text and numbers to a single worksheet in an Excel workbook. This was all that I needed it to do and I was quite happy with it.
After a while people started to write to me and say that it would be nice to have multiple worksheets. From my past experience with the C library I knew that it would be difficult to create a cross-platform solution without the appropriate Windows libraries. However, I hacked away at it and after 3 months I had a solution.
After that I received a steady stream of requests to add formatting, hyperlinks, formulae, functions, page setup and images. So I included those as well and now, almost two years later,
Spreadsheet::WriteExcel is over 7000 lines of code, is comprised of 10 modules, uses
Parse::RecDescent, uses
pack() 300 times and has over 40 pages of documentation.
But what prompts me to write this is that recently a
Spreadsheet::WriteExcel::Simple
module was uploaded to CPAN. It subclasses
Spreadsheet::WriteExcel to provide more or less the functionality of the first version that I wrote. When I spoke to the author, Tony Bowden, about it he said that it was inspired by a client who just couldn't deal with
Spreadsheet::WriteExcel.
In many ways it would have been nice to have called it a day after the first 200 line version and lay claim to the clarity and resolve of the
::Simple authors. Because, even if peoples expectations aren't simple, code can be.
--
John.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.