[perl] Propuesta de mensajes de error el Perl
Ing. Roberto Andrade Fonseca
randrade@abl.com.mx
Fri, 6 Oct 2000 10:12:03 -0500 (CDT)
Hola:
De un mensaje de Perl Monger:
In response to the news, a rogue group of Perl hackers have
presented a plan to add a "use really_goddamn_strict"
pragma to the language that would enforce readability and
unobfuscation. With this pragma in force, the Perl
compiler might say:
Warning: Program contains zero comments. You've probably
never seen or used one before; they begin with a #
symbol. Please start using them or else a representative
from the nearest Perl Mongers group will come to your
house and beat you over the head with a cluestick.
Warning: Program uses a cute trick at line 125 that might
make sense in C. But this isn't C!
Warning: Code at line 412 indicates that programmer is an
idiot. Please correct error between chair and monitor.
Warning: While There's More Than One Way To Do It, your
method at line 523 is particularly stupid. Please try
again.
Warning: Write-only code detected between lines 612 and
734. While this code is perfectly legal, you won't have
any clue what it does in two weeks. I recommend you start
over.
Warning: Code at line 1,024 is indistinguishable from line
noise or the output of /dev/random
Warning: Have you ever properly indented a piece of code
in your entire life? Evidently not.
Warning: I think you can come up with a more descriptive
variable name than "foo" at line 1,523.
Warning: Programmer attempting to re-invent the wheel at
line 2,231. There's a function that does the exact same
thing on CPAN -- and it actually works.
Warning: Perl tries to make the easy jobs easy without
making the hard jobs impossible -- but your code at line
5,123 is trying to make an easy job impossible.
Error: Programmer failed to include required string "All
hail Larry Wall" within program. Execution aborted due to
compilation errors.
Of course, convincing programmers to actually use that
pragma is another matter. "If somebody actually wanted to
write readable code, why would they use Perl? Let 'em use
Python!" exclaimed one Usenet regular. "So this pragma is
a waste of electrons, just like use strict and the -w
command line parameter."
Saludos,
Roberto Andrade Fonseca
randrade@abl.com.mx
--------- Pie de mensaje --------------------------------
Visite: http://tlali.iztacala.unam.mx/~randrade/perl.shtml
Cancelar inscripcion:
mail to: majordomo@tlali.iztacala.unam.mx
text : unsubscribe perl