Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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 reply to Re: *.pm vs. *::Simple by jmcnamara
in thread *.pm vs. *::Simple by Zecho

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-16 04:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found