...or at least the way many people write it
Someone once stated that, "code should be more than write only," it should be READABLE. The author went on to suggest that style, like that outlined in the Chicago manual of style identifies document attributes to make material more easily absorbed by the reader.
(BTW if you know of the ref for that statement, please throw a ref...thx.)
Imagine no chapters, paragraphs, side bars, different size fonts, images (gee images in pod - no way huh!), one continuous monologue. Yeah Amazon, Borders, BarnesNoble would be less desirable by their stock holders!
Humans ! spend more time reading code than does the perl executable - so lets write for the most time consuming reader.
I am so tired of reading code in which my eyes, brain, and everything else has to parse the text to determine whether or not I'm looking at comments, code, pod, data, blah, blah, blah.
POD a curse (and a blessing). Pod helps compared with *roff, sgml, *tex, and all the others in being able to quickly generate accompanying documentation for a program or library. It makes it easy to have a single file contain both the code and the documentation. Compiled languages don't have this feature (hacks not included) nor do the early scripting languages.
However the ease of pod seems to be excuse to write textual elements in a file, interleaving code and documentation, in a willy nilly fashion. That is in a manner that is not quickly apparent to a human reader.
An astute reader may ask, "But why should I want to read the code - it has Pod?" That is often why I turn to the code, the Pod is a bolt-on, maybe just to pass some test, and is insufficient - at least for my poor brain.
Yep the curse of Pod, a module writer thinks, "Well if I don't get everything in the Pod, the user can always just read the code. Well for compiled languages, that was not the case, hence the docs had better be good. But now with scripted languages, gee you can always just read the code so embedded docs are simply gravy, right?
Oh and gee, what about images ! See my perlmonk writeup pod and images
If you're taking the time to read this diatribe and you have ref's to nice looking, easily readable perl code, please throw a reference.
Well as you might suppose I had a bad day, reading other people's code, because of poor documentation.
Its just so frustrating...
So I apologize if I offended anyone. Perl really is a nice language, I've used it for years, which makes it even more painful when it is butchered.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl code SUCKS
by atcroft (Abbot) on Apr 28, 2009 at 23:30 UTC | |
|
Re: Perl code - sometimes UGLY...
by perrin (Chancellor) on Apr 29, 2009 at 05:23 UTC | |
by pemungkah (Priest) on Apr 30, 2009 at 19:17 UTC | |
by perrin (Chancellor) on Apr 30, 2009 at 19:46 UTC | |
by pemungkah (Priest) on May 01, 2009 at 22:56 UTC | |
by DStaal (Chaplain) on Apr 30, 2009 at 20:10 UTC | |
|
Re: Perl code SUCKS
by codeacrobat (Chaplain) on Apr 28, 2009 at 20:19 UTC | |
|
Re: Perl code SUCKS
by JavaFan (Canon) on Apr 28, 2009 at 20:05 UTC | |
by DStaal (Chaplain) on Apr 30, 2009 at 20:12 UTC | |
by Your Mother (Archbishop) on Apr 30, 2009 at 21:17 UTC | |
by DStaal (Chaplain) on Apr 30, 2009 at 23:07 UTC | |
|
Re: Perl code SUCKS
by sasdrtx (Friar) on Apr 28, 2009 at 19:27 UTC | |
by otto (Beadle) on Apr 28, 2009 at 19:47 UTC | |
by Anonymous Monk on Apr 29, 2009 at 14:12 UTC | |
by codeacrobat (Chaplain) on Apr 30, 2009 at 22:09 UTC |