|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re: *.pm vs. *::Simpleby jmcnamara (Monsignor) |
| on Oct 23, 2001 at 00:06 UTC ( [id://120663]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
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.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||