Users of more civilized languages (such as INTERCAL) have advanced into making the programer be a little more polite in order to counteract unnecessary hubris. The compiler will make sure you are polite in your source code, and give a fatal error if you don't. But don't try to fool the compiler by giving faux politeness everywhere, or it will still fail to compile.
Because of the barbaric orgins of Perl, it lacks a please() function in the basic language. I hope to help rectify this in a future version, but until then you can use the please() function in this module. May it help you find your new identity as a civilized coder!
package Acme::Polite; no strict; # Strict isn't very polite no warnings; # Neither is warnings use Filter::Util::Call; use constant CEILING => 10; # Must be at least this polite use constant FLOOR => 3; # But not too polite sub import { my $pkg = shift; my $ref = []; filter_add( bless $ref => $pkg ); } sub filter { my $self = shift; my $status; while( ($status = filter_read) > 0 ) { # noop } my $source = $_; my $semi_count = () = $source =~ /(;)/g; my $please_count = () = $source =~ /(please)/g; my $politeness_rating = $semi_count / $please_count; if( $politeness_rating < FLOOR ) { die "You were too polite!\n"; } elsif( $politeness_rating > CEILING ) { die "You weren't polite enough!\n"; } return $status; } sub please { return @_ } 1; __END__
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Be a More Polite Programmer
by diotalevi (Canon) on Oct 08, 2004 at 20:54 UTC | |
by hardburn (Abbot) on Oct 08, 2004 at 20:57 UTC | |
|
Re: Be a More Polite Programmer
by BrowserUk (Patriarch) on Oct 08, 2004 at 23:05 UTC |