perlmeditation
techcode
I've just been looking through my list of "favorites" url's. Among them, I put also sites that I intend to visit in the future.<br><br>
And just spotted something I previously saw quite some time ago: <a href="http://discuss.joelonsoftware.com/default.asp?joel.3.67545.30">The link to the thread</a><br><br>
EDIT: Being in favorites doesnt mean that I like it - just that I find it "interesting".
<br><br>
I quote:
<blockquote><i><p>Maybe I'm being too generous by calling them "programmers."
Take a look at this snippet from the C::Scan module:</p><code>
my($sym) = gensym;
my $cmd = "echo '\#include \"$filename\"' | $Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $Cpp->{cppminus} |";
#my $cmd = "$Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $Cpp->{cppminus} < $filename |";
#my $cmd = "echo '\#include <$filename>' | $Cpp->{cppstdin} $Defines $addincludes $Cpp->{cppflags} $Cpp->{cppminus} |";
(open($sym, $cmd) or die "Cannot open pipe from `$cmd': $!")
and bless $sym => $class;
</code><p>
Clearly, the idiot--I mean author--is trying to open up a pipe to some program for reading, but also wants to write something to it first. He achieves this by building up a command string in $cmd that will "echo" the stuff that needs to be written into the standard input of the program, and the "|" at the end of $cmd will cause open() to open a pipe to the whole thing for reading, which will be stored in $sym.
</p></i></blockquote>
<readmore>
<blockquote><i><p>
Why not just use IPC::Open2 to write/read from the program normally like any other file handle? Well, this way is so much more clever! And not only is it more clever, it doesn't work on Windows! And not only that, notice the author decided to short-circuit the open() statement with "or die," ensuring that execution will cease if the command fails, but also short-circuits the entire expression with "and," making the statement needlessly longer by combining what should really be two statements into one.
</p><p>
These fucking assholes infuriate me to no end. They are worse, in many ways, then the mindless Java/C#/C++ drones they deride, because they give the alternative such a bad name.
</p><p>
Perl is the most expressive programming language in common use today. Perl gives you statement modifiers, short-circuit operators, and anonymous functions. It gives you namespaces and import/export facilities. It gives you everything you need to write tight, manageable code, and what do these fools do with it?
</p><p>
They make mud pies out of dog shit, like this:
</p><code>
my $content =
($resp->content_encoding || '')
=~ /\b$SOAP::Transport::HTTP::Client::COMPRESS\b/o &&
$self->options->{is_compress} ?
Compress::Zlib::memGunzip($resp->content)
: ($resp->content_encoding || '') =~ /\S/
? die "Can't understand returned Content-Encoding (@{[$resp->content_encoding]})\n"
: $resp->content;
$resp->content_type =~ m!^multipart/!
? join("\n", $resp->headers_as_string, $content) : $content;
</code><p>
They could easily write the clearest and most beautiful code this side of Steve McConnell's ego and it would still be ten times shorter than the C equivalent. But you see, laziness, impatience, and hubris are not their only "virtues." Perl hackers are greedy. Shorter isn't good enough for them. They aren't satisfied unless they're typing as few keystrokes as humanly possible.
</p><p>
I am sick and tired of being associated with you hacks. I am sick and tired of the reaction I get when people find out I use and actually like Perl. You assholes are a disgrace to the entire field of software development, and it's high time one of your own started calling bullshit on you.
</p><p>
Lies of Society (LoS)
Friday, January 28, 2005
</p></i></blockquote>
</readmore>
I dont say that I like the way this guy wrote it - and the way he is insulting people. But there are few good points pointed out in that thread.<br><br>
The replies are also "interesting" so you might want to check out that thread.<br><br>
Anyone wants to make a comment on this?
<br><br>
EDIT : Updated possibly misleading title.