Question for the regulars

B

beartiger

What is the worst mistake you've ever seen in a Perl script?

And please don't cite one from the scripts I've posted here. ;-)


J
 
A

Anno Siegel

What is the worst mistake you've ever seen in a Perl script?

Your question makes little sense unless you specify a measure of
badness of a mistake. If one mistake crashes the program and another
makes it return incorrect results, which is worse? If one mistake
deviates from correct code by one character and another by two, is
the second one worse? If so, the worst mistake would be total gibberish.
Or is it severity of consequences? But that depends more on circumstantial
facts than on the nature of the error. It may be hard to come up with
a useful measure of badness.

In my view, the worst mistakes are the entirely unspectacular ones we
get to see daily. Failure to use strict or warnings, mixing up eq with
== and similar, unjustified expectancies with respect to references and
de-referencing are in that category. If the frequency with which these
turn up on clpm is an indication of their overall frequency in Perl
programming, they must be responsible for a large part of the time
spent in debugging Perl.

Anno
 
A

A. Sinan Unur

(e-mail address removed)-berlin.de (Anno Siegel) wrote in
....

In my view, the worst mistakes are the entirely unspectacular ones we
get to see daily. Failure to use strict or warnings, mixing up eq
with == and similar, unjustified expectancies with respect to
references and de-referencing are in that category. If the frequency
with which these turn up on clpm is an indication of their overall
frequency in Perl programming, they must be responsible for a large
part of the time spent in debugging Perl.

Agreed.

I recently bought Perl Best Practices

<URL: http://www.oreilly.com/catalog/perlbp/>

after it was mentioned here (see the thread at

<URL: http://groups.google.com/group/comp...read/thread/6700c4367c283639/0b1b6cf1c1f412b0>

or <URL: http://tinyurl.com/ey9dp>). I can see not everyone agreeing
with all the recommendations in the book. However, one major benefit
of reading the book has been to see the "not recommended" examples
before the recommendations, and reading the reasoning that led to the
recommendations.

So, if one's aim is to learn what not to do by example,
PBP is a great source.

Sinan
 
B

beartiger

Tad said:
I expect that many (most?) of the regulars do not see your
posts, because we are assholes.

Did you read Bill Segraves' post? Much like your above expression of
petty grudge keeping, it's like a hilarious parody of a humorless
asshole.


J
 
A

A. Sinan Unur

Using Stein's cgi.pm module.

Purl Gurl

In most cases that I have seen here, NOT using CGI.pm is a mistake often
made.

In fact, in most cases, not using a *core* module is a mistake.

Sinan
 
A

A. Sinan Unur

Your factual basis is?

I have demonstrated, factually, dozens of times Stein's module
is the number one worst written module.

Your factual basis is?

Anyone interested in your ramblings can search Google Groups, and read
them.

For more information, see:

perldoc -q "How do I decode a CGI form?"

Sinan
 
T

Tad McClellan

Did you read Bill Segraves' post?


I'm afraid he has made more than one post, so more information
would be required to determine which post you are referring to.
Got a Message-ID for it or something?

I did not see a post from him in the "assholes" thread.
 
M

Matt Garrish

Purl Gurl said:
Your factual basis is?

I have demonstrated, factually, dozens of times Stein's module
is the number one worst written module.

You have only factually demonstrated over the years that you know very
little about Perl, and less about the cgi environment. Please show us how
your code is better. Many in a technical group expect statements to enjoy a
factual basis, you know. You vague claims have no factual basis.

Matt
 
B

beartiger

Purl said:
You did not answer my question. My presumption, then, is you
have no factual basis for your statement.

So, what are readers to think?

As a reader, my thought is that there are a lot of assholes on this
group who enjoy posting smug and superior replies to legitimate
questions kindly asked or to positions such as yours that differ from
whatever the perldoc recommends. And I'm right.
Many expect statements in a
technical group to enjoy a factual basis.

I know I would appreciate hearing some facts to support his position,
rather than an automaton-like citation of the Perl faq, but I don't
think we're going to get any.


J
 
B

beartiger

Tad said:
I'm afraid he has made more than one post, so more information
would be required to determine which post you are referring to.

As of this writing, it's his only post in this thread.
Got a Message-ID for it or something?

Yes, here's a fragment of it:

Message-ID: <o9y4f.15838$QE1.3862@new...

You will get the rest of it if you can demonstrate that you know how to
view a brief thread and discover a single post on your own.
I did not see a post from him in the "assholes" thread.

I'm afraid there has been more than one "assholes" thread on this ng,
so more information would be required to determine which thread you are
referring to.


J
 
F

foo bar baz qux

Purl Gurl wrote:

You did not answer my question. My presumption, then, is you
have no factual basis for your statement.

So, what are readers to think? Many expect statements in a
technical group to enjoy a factual basis.

Since you asked: This reader thinks virtually all the assertions you
have made in this newsgroup, over many years, have no factual basis.

....


E.g. (ironically)
"You of the Perl Community, have successfully given the
Perl Community a reputation of being populated by
mentally disturbed people who are psychotically driven
to harass all peoples, children, women, men, the elderly,
all people, about whom you know nothing. " - PG

Or

"Both Elaine and Abigail have metaphorical balls,
as I do ... The three most harassed contributors to Perl programming,
all are female." - PG Jun 27 2004

"Abigail's are not metaphorical." Tad McLelland Jun 27 2004
"PG is a man" - Elaine Feb 9 2000


Or

"Use of "our" and "my" for globals serves no purpose. " - PG Oct 15
2005

#!perl
# Written by Purl Gurl - (e-mail address removed)
....
our %in;
- Ken Singleton Jul 7 2004
 
L

Lynn

As a reader, my thought is that there are a lot of assholes on this
group who enjoy posting smug and superior replies to legitimate
questions kindly asked or to positions such as yours that differ from
whatever the perldoc recommends. And I'm right.

No, you are not right. I happen to be a new Perl programmer
and have found the regulars here to be extremely helpful. I have
asked some "Newbie" questions here on this newsgroup and
never once had a reply that was smug or condescending.

(more snippage)
I know I would appreciate hearing some facts to support his position,
rather than an automaton-like citation of the Perl faq, but I don't
think we're going to get any.

OK, Here are some common reasons NOT to use alternatives to CGI.pm

Your version probably won't allow for file uploads.

Most alternatives don't properly handle multiple values for one parameter.

Typically, these alternatives do not allow for any delimeter besides the
ampersand.
Semi-colons are sometimes used to delimit name/value pairs.

The alternatives do not verify the length of data read from STDIN
matched $ENV{ CONTENT_LENGTH }If the browser screws up, you could have
corrupt data, but if you don't verify the content length, you'll never know.

These are just some of the reasons (I'm sure there are more) the regulars
recommend using CGI.pm


Lynn
 
B

beartiger

Tad said:
How do you know which posts have hit my news server?

Yes, I shouldn't expect someone like you to read news on a server that
would show you posts posted the day before.


J
 
U

usenet

What is the worst mistake you've ever seen in a Perl script?

If "worst" is defined as stupid and senseless, I sometimes return to my
roots programming in more primative languages and make this sort of
mistake:

if ($foo = $bar) {

when I really wanted to use "==" or "eq". It's perfectly valid code
(ie, it won't throw an error or a warning). I have stared at buggy code
for longer than I care to admit and have missed this mistake.

Every so often I will make this same mistake all over again, and it
might take me a while to figure out what I've done wrong. Stupid and
senseless (or, at least, careless).
 
B

beartiger

Lynn said:
No, you are not right.

No, I am right.

Your *personal* experience doesn't challenge what I said. I would be
happy to forward such replies as I describe (replies to all manner of
posters, not just me) to your email daily, if you are missing them.

Incidentally, I too have received quite helpful and courteous replies.
I didn't say all the regulars, or even the majority.


J
 
B

Brian Wakem

If "worst" is defined as stupid and senseless


Lately I have been doing this a lot:

sub subname {
my $abc = shift;
...
}


Then I decide I need to pass a second value to the sub and do this:


sub subname {
my ($abc,$def) = shift;
...
}


and then spending far too long wondering why $def in undef and then punching
myself in the nose when I realise I've 'done it again'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,017
Latest member
GreenAcreCBDGummiesReview

Latest Threads

Top