Getting ahead of myself with the spreadsheet port

djberg96 on 2003-01-15T03:09:32

For the next minor release of my spreadsheet port, I've decided to add in the write_row and write_col methods, even though those methods weren't added until later in John's original code.

I work regularly with fetching rows out of a database and slapping the results into a spreadsheet. I imagine a hefty chunk of Spreadsheet::WriteExcel users do the same - witness Spreadsheet::WriteExcel::FromDB. The ability to simply insert a fetch'ed row is just too handy (versus writing your own code to iterate over a fetch'ed record). Based on John's comments in his CHANGES file, I'm guessing people will appreciate it.


Eat your own dog food

jmcnamara on 2003-01-15T17:43:21

For the next minor release of my spreadsheet port, I've decided to add in the write_row and write_col methods, even though those methods weren't added until later in John's original code.

The reason that I omitted write_row() and write_col() methods from Spreadsheet::WriteExcel for so long was because I thought that it was a relatively simple matter to create these functions externally.

Any time that I spend implementing, testing and documenting a feature like this means less time spent implementing a feature that the end user can't implement themselves.

However, after a lot of very similar emails I relented and implemented them and I have to admit that I actually find them very useful. For instance here is a very short idomatic program to convert a text file to an Excel file:

    #!/usr/bin/perl -w

    use strict;
    use Spreadsheet::WriteExcel;

    my $workbook  = Spreadsheet::WriteExcel->new('file.xls');
    my $worksheet = $workbook->addworksheet();

    open TXT, "file.txt" or die "Couldn't open file: $!";

    $worksheet->write($.-1, 0, [split]) while <TXT>;

There are some other features, such as support for "A1" notation, that I should have put in earlier. I think that I would have if I was still using Spreadsheet::WriteExcel or Excel on a daily basis. However, I'm not, despite the fact that I write the module on a daily basis.

In the end there is a lot to be said for eating your own dog food.

Re:Eat your own dog food

djberg96 on 2003-01-15T18:47:38

There are some other features, such as support for "A1" notation, that I should have put in earlier.

I thought about working on that sooner, but I never use it and never had a desire to. Frankly, I don't understand why anyone on the programmer's side of things would want to use that notation, unless it's some sort of conceptualization issue. Maybe I'm missing something.

In any case, I'll resist adding that feature until I receive a few requests, at least.