Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Who wrote this crap?

44 views
Skip to first unread message
Message has been deleted
Message has been deleted
Message has been deleted

Seebs

unread,
Jun 9, 2010, 2:04:06 PM6/9/10
to
On 2010-06-09, Davide Bianchi <davidey...@onlyforfun.net> wrote:
>
> I'm looking at a "library" I should use to interact with some piece
> of equipment. The 'library' is written in perl. That's good. However
> it has been written by someone that was obviously more accustomed to
> write in PHP. And that's bad.

Have you considered supplying this to the daily WTF?

Lemme tell you, there is a sense of vindication from seeing some
godawful thing you got stuck messing with on the front page there.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet...@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

Graham Reed

unread,
Jun 9, 2010, 4:00:03 PM6/9/10
to
Davide Bianchi <davidey...@onlyforfun.net> writes:
> And the incredible thing is all this somehow kind-of does what it's
> supposed to do!

I've dealt with... code... like that. I don't know what language the
author thought she was writing in, but she didn't know Perl at all,
though had managed to find just enough of the weird stuff to be truly
dangerous.


sub some_sub {
# Arguments with spaces don't work, I don't know why
my(@args)=split(/\s/,"@_");
...


--
"I thought everyone in [TO] ... jumped off the Bloor Street Viaduct? Or
was your Mom a nonconformist?" -- adb about my mother in the Monastery.
"Well, of course she was. Just because everyone *else's* Mom was jumping
off the Bloor Street Viaduct, should *she*?" -- Jonathan's witty retort.

David Cameron Staples

unread,
Jun 9, 2010, 8:22:07 PM6/9/10
to
in Wed, 09 Jun 2010 09:55:49 +0200, Davide Bianchi in hic loco scripsit:

> I'm looking at a "library" I should use to interact with some piece of
> equipment. The 'library' is written in perl. That's good. However it has
> been written by someone that was obviously more accustomed to write in
> PHP. And that's bad.
>

> Some random bits I found in this thing:
>
> sub prompt_processing_crap()
> {
> my ( $prompt1,
> $prompt2,
> $self,
> );
>
> if ( 0 )
> {
> # lots of code
> }
>
> # return 0;
> return $prompt1;
> }

Well, it does say "prompt", and I have no doubt that it finishes promptly.

Why it is pretending to be an object, on the other hand, shall remain a
mystery.

>
> ...
>
> sub get_p
> {
> #this doesn't work
> return 0;
> }

Well, if it is supposed to return 1, then the comment is completely
correct!

>
> sub get_p_work
> {
> ...
> if( $i ) {
> return $i;
> } else {
> return $i;
> }
> }

When you absolutely, positively, have to return $i.

> ...


>
>
> And the incredible thing is all this somehow kind-of does what it's
> supposed to do!

Because half of the WTF code cancels out the WTF of the other half of the
code.

> I'm so glad I'd already decided to junk it and write my own...

Because if you were to try to correct the existing code, once you find a
WTF and fix it, you then have to hunt down and kill all the WTFs which
rely on the original WTF's behaviour to function. Then the WTFs which
rely on them, and so on to infinity.


--
David Cameron Staples | staples AT unimelb DOT edu DOT au
Melbourne University | School of Engineering | IT Support
mac is god compared to microsoft
and linux is the science that disproves god's existence -- bash.org/?47127

Peter Corlett

unread,
Jun 10, 2010, 5:55:28 AM6/10/10
to
Seebs <usenet...@seebs.net> wrote:
> On 2010-06-09, Davide Bianchi <davidey...@onlyforfun.net> wrote:
[...]

>> I'm looking at a "library" I should use to interact with some piece of
>> equipment. The 'library' is written in perl. That's good. However it has
>> been written by someone that was obviously more accustomed to write in
>> PHP. And that's bad.
> Have you considered supplying this to the daily WTF?

If I submitted every bit of Perl that made me shake my head and immediately
want to get drunk to numb the pain, I'd be on the front page every day.

> Lemme tell you, there is a sense of vindication from seeing some godawful
> thing you got stuck messing with on the front page there.

I've recently seen a trading platform written in Perl. All of a sudden, I've
started considering investing in guns and corned beef.

Ben A L Jemmett

unread,
Jun 10, 2010, 7:05:07 AM6/10/10
to
Graham Reed wrote:
> sub some_sub {
> # Arguments with spaces don't work, I don't know why
> my(@args)=split(/\s/,"@_");
> ...

Hmm. Five past noon. I think that's late enough in the day to be
hitting the whiskey, right?

--
Regards,
Ben A L Jemmett.
http://flatpack.microwavepizza.co.uk/

Message has been deleted

mikea

unread,
Jun 10, 2010, 9:03:14 AM6/10/10
to
Roger Burton West <roger+a...@nospam.firedrake.org> wrote in <20100610124423....@firedrake.org>:

> Ben A L Jemmett wrote:
>>Graham Reed wrote:
>>> sub some_sub {
>>> # Arguments with spaces don't work, I don't know why
>>> my(@args)=split(/\s/,"@_");
>>> ...
>>Hmm. Five past noon. I think that's late enough in the day to be
>>hitting the whiskey, right?
>
> The sun has just set in Beijing.

The sun's *always* over the yardarm _somewhere_.

--
" ... a language is just an dialect with an army and a navy."
-- written by someone very perceptive,
used by Paul Tomblin in a.s.r.

Brian Kantor

unread,
Jun 10, 2010, 12:46:05 PM6/10/10
to
>>Hmm. Five past noon. I think that's late enough in the day to be
>>hitting the whiskey, right?
>The sun has just set in Beijing.

The sun is always over the yardarm somewhere.
- Brian

"You can write Fortran in any language."

Seebs

unread,
Jun 10, 2010, 1:20:59 PM6/10/10
to
On 2010-06-10, Brian Kantor <br...@ucsd.edu> wrote:
> The sun is always over the yardarm somewhere.
> - Brian

And, as I believe someone in this august froup once remarked, if you
have a decommissioned sparc and a trebuchet, the Sun is over the yardarm
whenever you want it to be.

mikea

unread,
Jun 10, 2010, 1:28:00 PM6/10/10
to
Seebs <usenet...@seebs.net> wrote in <slrni127nr.5gm...@guild.seebs.net>:

> On 2010-06-10, Brian Kantor <br...@ucsd.edu> wrote:
>> The sun is always over the yardarm somewhere.
>> - Brian
>
> And, as I believe someone in this august froup once remarked, if you
> have a decommissioned sparc and a trebuchet, the Sun is over the yardarm
> whenever you want it to be.

Indeed.

And with a sufficiently large[1] trebuchet, just about _any_ Sun can be


over the yardarm whenever you want it to be.

[1] I remember an NPR piece on a Brit who builds trebs; he threw a
600-pound pig carcass some hundreds of yards, evoking from the
NPR reporter a comment that "the pig flies well". He also used his
biggest treb to toss pianos (decommissioned) and Morris Minors
(ditto).

--
It is a source of much embarassment to me that I was distracted
by a combination of Usenet, Western European history, and writing
instead of wine, women and song.
-- Matt McLeod, in the Monastery

Niklas Karlsson

unread,
Jun 10, 2010, 2:27:12 PM6/10/10
to
On 2010-06-10, mikea <mi...@mikea.ath.cx> wrote:
>
> And with a sufficiently large[1] trebuchet, just about _any_ Sun can be
> over the yardarm whenever you want it to be.

I seem to recall a company dropping a large Sun server (E10K, I think)
from a helicopter somewhere in .se 4-5 years ago, as a publicity stunt
when they decided to phase their Suns out (they'd had a lot of trouble
with them). Unfortunately I can't find any references to it now.

And of course the sigmonster picks out an even more deserving victim...

Niklas
--
We've got a SCO box which we've had no complaints over. No maintenance
hassles either.
We might get around to switching it on one day.
-- Peter Gutmann

SteveD

unread,
Jun 10, 2010, 3:25:59 PM6/10/10
to
On Thu, 10 Jun 2010 12:28:00 -0500, mikea <mi...@mikea.ath.cx> wrote:

>He also used his biggest treb to toss pianos (decommissioned) and
>Morris Minors (ditto).

If the former was tossed onto the latter, would it be A Flat Minor?

mikea

unread,
Jun 10, 2010, 3:29:09 PM6/10/10
to
SteveD <use...@vo.id.au> wrote in <mue2165h4k7t2fo93...@4ax.com>:

That's a pretty sharp comment.

--
1 Bryant (B) = 4577 books; 1 Ha'bryant = 2289 books
1 Sitter (or Room) = 1104 books; 1 Dinky = 161 books
1 Wallshelf = 23 books; 1 Bedside = 17 books
-- Robert Uhl, in asr

Message has been deleted

Ben A L Jemmett

unread,
Jun 10, 2010, 4:26:17 PM6/10/10
to
mikea wrote:
> SteveD <use...@vo.id.au> wrote in
> <mue2165h4k7t2fo93...@4ax.com>:
> > On Thu, 10 Jun 2010 12:28:00 -0500, mikea <mi...@mikea.ath.cx>
> > wrote:
> > > He also used his biggest treb to toss pianos (decommissioned) and
> > > Morris Minors (ditto).
>
> > If the former was tossed onto the latter, would it be A Flat Minor?
>
> That's a pretty sharp comment.

It could have been accidental...

Message has been deleted

Kenneth Brody

unread,
Jun 10, 2010, 4:58:59 PM6/10/10
to
On 6/10/2010 4:26 PM, Ben A L Jemmett wrote:
> mikea wrote:
>> SteveD<use...@vo.id.au> wrote in
>> <mue2165h4k7t2fo93...@4ax.com>:
>>> On Thu, 10 Jun 2010 12:28:00 -0500, mikea<mi...@mikea.ath.cx>
>>> wrote:
>>>> He also used his biggest treb to toss pianos (decommissioned) and
>>>> Morris Minors (ditto).
>>
>>> If the former was tossed onto the latter, would it be A Flat Minor?
>>
>> That's a pretty sharp comment.
>
> It could have been accidental...

Well, naturally!

We better stop this cascade before we get into treble.

--
Kenneth Brody

Message has been deleted

Graham Reed

unread,
Jun 10, 2010, 4:25:12 PM6/10/10
to
"Ben A L Jemmett" <bal.j...@ukonline.co.uk> writes:
> Hmm. Five past noon. I think that's late enough in the day to be
> hitting the whiskey, right?

What, you mean this bottle *glug* here that I picked up at the Duty
Free on the way back home?

It's never too soon....

--
"I'm not crazy! My mother had me tested!"
-- Sheldon Cooper

Seebs

unread,
Jun 10, 2010, 6:03:38 PM6/10/10
to
On 2010-06-10, Kenneth Brody <kenb...@spamcop.net> wrote:
> We better stop this cascade before we get into treble.

Considering how this group normally behaves, I think that accusation
is a bass libel.

Note: The spelling in the above was carefully measured, which bears
repeating. Anyway, it's only a small cascade; it's not as though there's
a problem of scale, and if there are any problems, surely someone can
beat the servers into submission. Or, at that point, we can give it
a rest. Perhaps we could come up with a variety of favorite whiskeys
and have a circle of fifths?

-s
p.s.: Anyway, no one would dare complain, because the flood of
responses of the form "The world's smallest violin plays" would
overload the servers.

Message has been deleted

Craig Miskell

unread,
Jun 11, 2010, 2:45:47 AM6/11/10
to
On 11/06/10 8:20 AM, Gallian wrote:

> ab...@mooli.org.uk (Peter Corlett) writes:
>
>>
>> I've recently seen a trading platform written in Perl. All of a sudden, I've
>> started considering investing in guns and corned beef.
>>
> I've recently seen what a colleague calls 'scripting'. Argh. It's 5.005
> style that's been deprecated since 2001, chockful of globals, strict and
> warnings turned off, and plain ugly constructs.

Oh, you've seen the legacy (but still depressingly in production) code
at my current employer then. No 'strict'? Check. No 'warning'?
Check. Untainting with /^(.*)$/? Check. Using the documented least
readable way to de-reference hash of hash references? Check.

<sigh>
Craig

Seebs

unread,
Jun 11, 2010, 3:08:53 AM6/11/10
to
On 2010-06-11, Craig Miskell <cr...@stroppykitten.com> wrote:
> Untainting with /^(.*)$/? Check.

I admire this.

I am not quite sure that's the right word, but it's surprisingly close.
It is a thing to be looked up to, but never achieved. That may even
beat the database with "password" and "encrypted_password" columns
(because he was told to store passwords encrypted...).

Maarten Wiltink

unread,
Jun 11, 2010, 3:22:43 AM6/11/10
to
"Seebs" <usenet...@seebs.net> wrote in message
news:slrni12o9q.odi...@guild.seebs.net...

> On 2010-06-10, Kenneth Brody <kenb...@spamcop.net> wrote:

>> We better stop this cascade before we get into treble.
>

> Considering how this group normally behaves, I think that accusation
> is a bass libel.
>
> Note: The spelling in the above was carefully measured, which bears
> repeating.

Da Capo wants to talk to you about that. Better resolve your case quickly.

Tebrgwrf,
Maarten Wiltink


E.P.Sporgersi

unread,
Jun 11, 2010, 3:26:08 AM6/11/10
to
On 2010-06-10, Gallian <gal...@linuxmail.org> wrote:
> And to think that I write even my quick-and-dirty scripts as if they
> were full on applications that others may have to maintain...

Who was it again, that said: "Always code as though the person who ends up
maintaining it will be a violent psychopath who knows where you live."

Maarten Wiltink

unread,
Jun 11, 2010, 3:28:00 AM6/11/10
to
"Gallian" <gal...@linuxmail.org> wrote in message
news:86ocfim...@gareth.avalon.lan...

> David Cameron Staples <sta...@cs.mu.oz.au.SPAM> writes:
>> in Wed, 09 Jun 2010 09:55:49 +0200, Davide Bianchi in hic loco scripsit:

>>> sub get_p


>>> {
>>> #this doesn't work
>>> return 0;
>>> }
>>
>> Well, if it is supposed to return 1, then the comment is completely
>> correct!
>

> Technically, that code is correct. Whatever calls get_p will get a
> return code that says that get_p failed.

Under one convention, at least.

If you reason that success is singular, but failure modes are legion,
it becomes a different matter.

Tebrgwrf,
Maarten Wiltink


E.P.Sporgersi

unread,
Jun 11, 2010, 3:31:06 AM6/11/10
to
On 2010-06-10, mikea <mi...@mikea.ath.cx> wrote:
>
> [1] I remember an NPR piece on a Brit who builds trebs; he threw a
> 600-pound pig carcass some hundreds of yards, evoking from the
> NPR reporter a comment that "the pig flies well". He also used his
> biggest treb to toss pianos (decommissioned) and Morris Minors
> (ditto).

If not before, then after.

David Cameron Staples

unread,
Jun 11, 2010, 4:54:52 AM6/11/10
to
in Fri, 11 Jun 2010 09:22:43 +0200, Maarten Wiltink in hic loco scripsit:

Take your tonic first, though. It's being carried by a diminished minor.

--
David Cameron Staples | staples AT unimelb DOT edu DOT au
Melbourne University | School of Engineering | IT Support

"what are you wearing?" "a kilt" "no man thats a skirt.." "its a kilt im
telling you..." "uhhh its pink, has flowers and shoulder straps"
"its a prety kilt" -- bash.org/?36828

Message has been deleted

Peter Corlett

unread,
Jun 11, 2010, 7:18:31 AM6/11/10
to
Gallian <gal...@linuxmail.org> wrote:
[...]

> I've recently seen what a colleague calls 'scripting'. Argh. It's 5.005
> style that's been deprecated since 2001, chockful of globals, strict and
> warnings turned off, and plain ugly constructs.

You're quite lucky there. One codebase I had the misfortune to try and fix
was very much Perl4 style with just enough Perl5 in it to add a few extra
exciting security holes and stop it compiling on Perl4.

> And to think that I write even my quick-and-dirty scripts as if they were
> full on applications that others may have to maintain...

Given that using strict/warn/etc pays back within about 50 lines, it's worth
doing it as a matter of course. The only "good" reason to omit them is when
playing golf.

Kenneth Brody

unread,
Jun 11, 2010, 10:29:47 AM6/11/10
to

In other words, yourself. :-)

--
Kenneth Brody

Message has been deleted

Alan J Rosenthal

unread,
Jun 11, 2010, 8:34:10 PM6/11/10
to
E.P.Sporgersi <fle...@xs4all.nl> writes:
>Who was it again, that said: "Always code as though the person who ends up
>maintaining it will be a violent psychopath who knows where you live."

You mean you should always put in comments claiming that a false home address
is yours? What a weird thing to do.

Craig Miskell

unread,
Jun 12, 2010, 1:04:09 AM6/12/10
to
On 11/06/10 7:08 PM, Seebs wrote:
> On 2010-06-11, Craig Miskell <cr...@stroppykitten.com> wrote:
>> Untainting with /^(.*)$/? Check.
>
> I admire this.
So do I, in the same way I admire the ability of the HIV virus to
subvert/destroy the very immune system that is tasked with destroying it.

Doesn't mean I want to come into close contact with it.

Craig

Richard Bos

unread,
Jun 13, 2010, 6:59:09 AM6/13/10
to
"Just zis Guy, you know?" <guy.c...@spamcop.net> wrote:

> On Wed, 9 Jun 2010 09:34:11 +0000 (UTC), Roger Burton West
>
> >In my life, the usual answer to the titular question is "oh bugger, I
> >did".
>
> I guess the story about the crap code in BASIC is an urban legend, but
> I'm not going to look because I so want it to be true.

If it's about me writing a load of shite on the Speccy when I was
14-ish, it's true.

Richard

Just zis Guy, you know?

unread,
Jun 13, 2010, 2:03:25 PM6/13/10
to
On Sun, 13 Jun 2010 10:59:09 GMT, ral...@xs4all.nl (Richard Bos)
wrote:

>> I guess the story about the crap code in BASIC is an urban legend, but
>> I'm not going to look because I so want it to be true.
>
>If it's about me writing a load of shite on the Speccy when I was
>14-ish, it's true.

The only person I knew who was a prolific writer of code for the early
micros (TRS-80, BBC and so on) did make something of a name for
himself when he and a friend at Cambridge wrote a game called Elite.

Guy
--
http://www.chapmancentral.co.uk/
The usenet price promise: all opinions offered in newsgroups are guaranteed
to be worth the price paid.

Shmuel Metz

unread,
Jun 13, 2010, 10:19:26 PM6/13/10
to
In <huqcqg$11q$1...@mooli.org.uk>, on 06/10/2010
at 09:55 AM, ab...@mooli.org.uk (Peter Corlett) said:

>If I submitted every bit of Perl that made me shake my head and
>immediately want to get drunk to numb the pain, I'd be on the front
>page every day.

Do you believe that it is any different with Ada, Algol 60, C, C#,
C++, COBOL, FORTH, FORTRAN, HLASM, Pascal, Python, Rexx, Ruby or
SNOBOL 4? Some people can write FORTRAN in any language.

--
Shmuel (Seymour J.) Metz <http://patriot.net/~shmuel> ISO position
Reply to domain Patriot dot net user shmuel+bspfh to contact me.
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

Peter Corlett

unread,
Jun 14, 2010, 5:22:40 AM6/14/10
to
Shmuel (Seymour J.) Metz <spam...@library.lspace.org.invalid> wrote:
> ab...@mooli.org.uk (Peter Corlett) said:
[...]

>> If I submitted every bit of Perl that made me shake my head and
>> immediately want to get drunk to numb the pain, I'd be on the front page
>> every day.
> Do you believe that it is any different with Ada, Algol 60, C, C#, C++,
> COBOL, FORTH, FORTRAN, HLASM, Pascal, Python, Rexx, Ruby or SNOBOL 4? Some
> people can write FORTRAN in any language.

Perl is one of those languages where any idiot can write a reasonably large
program[0] and it will run and appear to work. A program written in C by a
similarly-incompetent programmer will usually to crash and burn in an
obvious manner and not get as far as deployment.


[0] I initially tyoped "problem" here.

Seth

unread,
Jun 14, 2010, 6:13:38 PM6/14/10
to
In article <2010Jun11....@jarvis.cs.toronto.edu>,

Especially since, given that he _knows_ where you live, the lie will
only anger him.

Seth

Shmuel Metz

unread,
Jun 15, 2010, 5:38:33 AM6/15/10
to
In <hv4sd0$7ti$1...@mooli.org.uk>, on 06/14/2010

at 09:22 AM, ab...@mooli.org.uk (Peter Corlett) said:

>Perl is one of those languages where any idiot can write a reasonably
>large program[0] and it will run and appear to work. A program
>written in C by a similarly-incompetent programmer will usually to
>crash and burn in an obvious manner and not get as far as
>deployment.

Alas, my experience with software written in C is that it does get as
far as deployment. The incompetence manifests in such things as not
checking array bounds because that's what the users are for. The
language is Broken As Designed (BAD).

BTW, I have a simple criterion for judging the qualifications of an
&foo advocate: if he can't tell me of any flaws in his preferred
(?:language|operating system)[1] then he doesn't understand it.

[1] It scares me that I can type such constructs without a sense of
"That can't be right."

Peter Corlett

unread,
Jun 15, 2010, 7:19:48 AM6/15/10
to
Shmuel (Seymour J.) Metz <spam...@library.lspace.org.invalid> wrote:
[...]

> BTW, I have a simple criterion for judging the qualifications of an &foo
> advocate: if he can't tell me of any flaws in his preferred
> (?:language|operating system)[1] then he doesn't understand it.

Well, if you want me to list flaws in Perl, we'll be here all night.

Richard Bos

unread,
Jun 16, 2010, 3:45:34 PM6/16/10
to
ab...@mooli.org.uk (Peter Corlett) wrote:

Not really.

The flaws in Perl:

1. Perl

There, done.

Richard

Craig Miskell

unread,
Jun 17, 2010, 1:59:32 AM6/17/10
to
On 17/06/10 7:45 AM, Richard Bos wrote:

> ab...@mooli.org.uk (Peter Corlett) wrote:
>>
>> Well, if you want me to list flaws in Perl, we'll be here all night.
>
> Not really.
>
> The flaws in Perl:
>
> 1. Perl
Methinks the flaws are more subtle than that. As I described to a newb
programmer the other day, in Perl there's 10 ways to do any one thing.
1 of these is completely wrong and should never be used. 7 are
completely wrong 99% of the time. 2 are tolerable, if you really have
to write Perl.

Discerning which of the 10 ways are in either "wrong" category is left
as an exercise to the reader of the documentation, manpage or tutorial.
Most readers fail the exercise, producing code which is provably
wrong[0].

Identifying the 1% of the time when those wrong ways are actually right
is not to be attempted by mere mortals.

Craig "that is just *wrong*" Miskell

[0] in the "that is completely the wrong way to achieve that result.
<thwap>" sense, not the "the result of executing the code is wrong" sense.

Shmuel Metz

unread,
Jun 16, 2010, 10:03:19 PM6/16/10
to
In <hv7nkk$5nm$1...@mooli.org.uk>, on 06/15/2010

at 11:19 AM, ab...@mooli.org.uk (Peter Corlett) said:

>Well, if you want me to list flaws in Perl, we'll be here all night.

I consider it to be an ugly language, but it has too much expressive
power to ignore, and CPAN definitely is a plus.

Message has been deleted
Message has been deleted

mikea

unread,
Jun 17, 2010, 10:00:56 AM6/17/10
to
Michel <ab...@rubberchicken.nl> wrote in <bglpe7-...@rubberchicken.nocrap>:

> On Thu, 17 Jun 2010 21:52:54 +0900, Dave Brown wrote:
>> Peter Corlett <ab...@mooli.org.uk> wrote:
>>> Well, if you want me to list flaws in Perl, we'll be here all night.
>>
>> I find that it's easy to calm down discussions by finding a common
>> ground that everyone can cheerfully agree on: PHP.
>
> Well yes, but criticising PHP is a bit too much like lobbing
> a handgrenade in a goldfish bowl, even compared to perl.

Two .sigfiles apply, mutatis mutandis:

[S]tandard complaint. Fish, barrel, tacnuke.
-- Red Drag Diva, in alt.sysadmin.recovery

IMHO WinTelnet is one of those situations in which both fish and firearm
are firmly bracketed to the barrel itself, in perfect alignment, and
actually walking up and pulling the trigger starts to fall into the "Why
Bother?" category. -- A deB, in the Monastery

--
Unfortunately, users are in `unstable' so shouldn't be installed in a
production system.
-- David Richerby

Peter Corlett

unread,
Jun 17, 2010, 12:22:30 PM6/17/10
to
Richard Bos <rl...@xs4all.nl> wrote:
> ab...@mooli.org.uk (Peter Corlett) wrote:
[...]

>> Well, if you want me to list flaws in Perl, we'll be here all night.
> Not really.
> The flaws in Perl:
> 1. Perl
> There, done.

That's not entirely the whole story, mind.

Once you get beyond the code that's clearly cargo-culted with all of the
sanity checks turned off (i.e. most Perl written by sysadmins) you pretty
much get down to the same sort of crap code you find written by anybody who
doesn't really know what they're doing.

For example, today's swearing involves an over-engineered bit of code that
has inconsistent error-handling, all battling each other to hide problems
further. So an error occurs ten-deep inside the code (a hardcoded hostname
not existing in the DNS view presented to the test box, as it happens) which
is carefully handled by writing a diagnostic to stderr and then returning a
half-constructed object. Some other code gets confused by the
half-constructed object and returns zero to indicate error. Its calling code
tries to dereference this and throws an exception. Yay, action at a
distance, so easy to debug! This exception is then caught in a library
elsewhere which throws away the stack trace, prints a cryptic error and does
an exit() to make sure that the debugger doesn't get a crack at the stack
trace either.

That POS happens to be written in Perl, but could have just as easily been
ineptly-written in a variety of languages. The half-constructed object is a
Java favourite, for example, and randomly using 0 to indicate an error which
is then ignored is more C. Unhelpful exception handling is definitely Java
and C++'s strength.

So the real flaw in Perl is that one can write Perl in any language.

Seebs

unread,
Jun 17, 2010, 3:02:31 PM6/17/10
to
On 2010-06-17, Dave Brown <dagb...@LART.ca> wrote:
> I find that it's easy to calm down discussions by finding a common
> ground that everyone can cheerfully agree on: PHP.

PHP is perhaps unusual in that I am genuinely unable to figure out how it
became widely adopted. And this is coming from someone who thinks it is
probably pretty understandable how Windows got to be a monopoly.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet...@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

Steve VanDevender

unread,
Jun 17, 2010, 6:22:48 PM6/17/10
to
Shmuel (Seymour J.) Metz <spam...@library.lspace.org.invalid> writes:

> CPAN definitely is a plus.

<splutter> CPAN, under limited circumstances, may be a *convenience*,
but on the whole it's debatable whether it's actually a "plus".

--
Steve VanDevender "I ride the big iron" http://hexadecimal.uoregon.edu/
ste...@hexadecimal.uoregon.edu PGP keyprint 4AD7AF61F0B9DE87 522902969C0A7EE8
"bash awk grep perl sed df du, du-du du-du,
vi troff su fsck rm * halt LART LART LART!" -- the Swedish BOFH

Message has been deleted

Peter Corlett

unread,
Jun 18, 2010, 6:21:34 AM6/18/10
to
Seebs <usenet...@seebs.net> wrote:
[...]

> PHP is perhaps unusual in that I am genuinely unable to figure out how it
> became widely adopted. And this is coming from someone who thinks it is
> probably pretty understandable how Windows got to be a monopoly.

PHP had some quite compelling advantages over Perl at the time it was
developed, and thus gained traction that way. Perl's moved on, but PHP is
still rather akin to Perl4. (Sure, it's got a half-arsed object system these
days, but apart from that, it's still Perl4-like.)

I am continually spammed by pimps offering PHP roles for derisory salaries
in unsavoury locations. This might be another reason why PHP is popular:
they're apparently hiring PHP developers for half of what I charge to
unbugger Perl code.

(And it'd be a third of what they'd have to offer me to get me to unbugger
PHP code.)

Message has been deleted

Richard Bos

unread,
Jun 18, 2010, 7:26:12 AM6/18/10
to
ab...@mooli.org.uk (Peter Corlett) wrote:

> Richard Bos <rl...@xs4all.nl> wrote:
> > ab...@mooli.org.uk (Peter Corlett) wrote:
> [...]
> >> Well, if you want me to list flaws in Perl, we'll be here all night.
> > Not really.
> > The flaws in Perl:
> > 1. Perl
> > There, done.
>
> That's not entirely the whole story, mind.
>
> Once you get beyond the code that's clearly cargo-culted with all of the
> sanity checks turned off (i.e. most Perl written by sysadmins) you pretty
> much get down to the same sort of crap code you find written by anybody who
> doesn't really know what they're doing.

IOW, Perl is just as bad as all other languages, but worse.

> So the real flaw in Perl is that one can write Perl in any language.

No. The flaw in all other languages is that one can write Perl in them.
The flaw in Perl is than one can _only_ write Perl in it.

Richard

Peter Corlett

unread,
Jun 18, 2010, 7:48:38 AM6/18/10
to
Richard Bos <rl...@xs4all.nl> wrote:
[...]

> No. The flaw in all other languages is that one can write Perl in them.
> The flaw in Perl is than one can _only_ write Perl in it.

Nonsense. Many Perl idioms do not translate well into other languages. This
may be considered a feature. However, Perl is flexible enough that you can
cherry-pick the more exciting programming errors from other languages and
use them in your Perl scripts too.

Perl doesn't just give you the rope to hang yourself, it provides the
gallows and the baying crowd too. But you don't *have* to hang yourself with
it.

Message has been deleted
Message has been deleted

Seebs

unread,
Jun 18, 2010, 7:17:17 PM6/18/10
to
On 2010-06-18, Peter Corlett <ab...@mooli.org.uk> wrote:
> (And it'd be a third of what they'd have to offer me to get me to unbugger
> PHP code.)

I wrote a medium-sized project which ended up needing to be done in PHP
for horrible reasons.

Had I known in advance, I would have insisted on hazard pay.

Seth

unread,
Jun 18, 2010, 11:58:44 PM6/18/10
to
In article <odmpe7-...@mikea.ath.cx>, mikea <mi...@mikea.ath.cx> wrote:
>Michel <ab...@rubberchicken.nl> wrote in <bglpe7-...@rubberchicken.nocrap>:

>> Well yes, but criticising PHP is a bit too much like lobbing

>> a handgrenade in a goldfish bowl, even compared to perl.
>
>Two .sigfiles apply, mutatis mutandis:
>
> [S]tandard complaint. Fish, barrel, tacnuke.
> -- Red Drag Diva, in alt.sysadmin.recovery

"I don't dance. I don't sing. I write really crappy code very
quickly." -- Rasmus Lerdorf

Seth

Message has been deleted

Richard Bos

unread,
Jun 19, 2010, 8:37:37 AM6/19/10
to
ab...@mooli.org.uk (Peter Corlett) wrote:

> Richard Bos <rl...@xs4all.nl> wrote:
> [...]
> > No. The flaw in all other languages is that one can write Perl in them.
> > The flaw in Perl is than one can _only_ write Perl in it.
>
> Nonsense.

No. The complete truth. Because:

> Perl doesn't just give you the rope to hang yourself, it provides the
> gallows and the baying crowd too. But you don't *have* to hang yourself with
> it.

...but you _will_. Sooner or later, you will. And your successor, who
will have to maintain the code your dead, dead body left him, will hang
with you.

Perl: There's More Than One Way To Pain (and by God and Larry, we'll be
damned if we don't use them _all_).


You think I'm just trying to be confrontational, don't you? Think again.

Richard

Message has been deleted

Marc Haber

unread,
Jun 23, 2010, 12:13:54 PM6/23/10
to
Michel <ab...@rubberchicken.nl> wrote:
>On Thu, 10 Jun 2010 12:28:00 -0500, mikea wrote:
>> [1] I remember an NPR piece on a Brit who builds trebs; he threw a
>> 600-pound pig carcass some hundreds of yards, evoking from the
>> NPR reporter a comment that "the pig flies well". He also used his
>> biggest treb to toss pianos (decommissioned) and Morris Minors
>> (ditto).
>
>Burning pianos, even.

itym dueling banjos.

Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Mannheim, Germany | Beginning of Wisdom " | http://www.zugschlus.de/
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 621 72739834

Tai

unread,
Jul 8, 2010, 4:59:13 PM7/8/10
to
While pretending to be roadkill on the InfoBahn, <ab...@mooli.org.uk> scrawled:
> I've recently seen a trading platform written in Perl. All of a sudden, I've
> started considering investing in guns and corned beef.

It wasn't that many years ago when one of the monks here
muttered about .eu interbank nightly transfers or some such being a 200k
bash shell script... and how he rewrote it into a 5k perl script...

-Tai
--
http://www.vcnet.com/bms/features/serendipities.html
http://www.kenthamilton.net/humor/humor.html
http://www.despair.com/demotivators/cluelessness.html
"What we have done with PCs so far is not natural" - Craig Mundie, CTO Microsoft

0 new messages