Esteemed brethren,
I'm in the middle of writing a
Parse::RecDescent module to handle ABC music files - reading them in, converting to other formats etc. The question is, how far should I go in providing 'helper' functions?
For instance, a 'convert-to-MIDI' function is obviously useful, but should this be "$tune->write_midi_file($filename)" or "@mididata = $tune->get_as_midi()", or both?
It goes as far as inputs too. ABC files can contain multiple tunes, comments etc. - it took a long time to decide between throwing a complete file at P::RD, and splitting the file up beforehand and just passing individual tunes to the parser. (I opted for the latter, but only because it seemd easier at the time - or I was still scared of P::RD :)).
Again though, should I bother providing a complete "my @tunes = read_file()" routine (thus duplicating the ubiquitous while(<FILE>) or should I just leave it at "my $tune = ABC->new($datalines)"?
Eagerly wating opinions
Ben
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.