Question for the regulars

Discussion in 'Perl Misc' started by beartiger@gmail.com, Oct 16, 2005.

  1. Guest

    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
     
    , Oct 16, 2005
    #1
    1. Advertising

  2. Anno Siegel Guest

    <> wrote in comp.lang.perl.misc:
    > 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
    --
    If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers.
     
    Anno Siegel, Oct 16, 2005
    #2
    1. Advertising

  3. -berlin.de (Anno Siegel) wrote in
    news:diu2t5$ehb$-Berlin.DE:

    > <> wrote in comp.lang.perl.misc:
    >> What is the worst mistake you've ever seen in a Perl script?

    ....

    > 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.lang.perl.misc/browse_thread/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
    --
    A. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
     
    A. Sinan Unur, Oct 16, 2005
    #3
  4. <> wrote:

    > Subject: Question for the regulars



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


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Oct 16, 2005
    #4
  5. <> wrote:

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



    Not enabling warnings.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Oct 16, 2005
    #5
  6. Guest

    Tad McClellan wrote:
    > <> wrote:
    >
    > > Subject: Question for the regulars

    >
    >
    > 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
     
    , Oct 16, 2005
    #6
  7. Purl Gurl <> wrote in
    news::

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

    >
    > 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. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
     
    A. Sinan Unur, Oct 17, 2005
    #7
  8. Purl Gurl <> wrote in news:4352EA78.3070403
    @purlgurl.net:

    > A. Sinan Unur wrote:
    >> Purl Gurl wrote:
    >>> wrote:

    >
    > (snipped)
    >
    >>>>What is the worst mistake you've ever seen in a Perl script?

    >
    >>>Using Stein's cgi.pm module.

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

    >
    > 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
    --
    A. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
     
    A. Sinan Unur, Oct 17, 2005
    #8
  9. <> wrote:
    > Tad McClellan wrote:
    >> <> wrote:
    >>
    >> > Subject: Question for the regulars

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

    >
    > 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.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Oct 17, 2005
    #9
  10. Matt Garrish Guest

    "Purl Gurl" <> wrote in message
    news:...
    > A. Sinan Unur wrote:
    >> Purl Gurl wrote:
    >>> wrote:

    >
    > (snipped)
    >
    >>>>What is the worst mistake you've ever seen in a Perl script?

    >
    >>>Using Stein's cgi.pm module.

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

    >
    > 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
     
    Matt Garrish, Oct 17, 2005
    #10
  11. Guest

    Purl Gurl wrote:
    > A. Sinan Unur wrote:
    > > Purl Gurl wrote:
    > >>A. Sinan Unur wrote:
    > >>>Purl Gurl wrote:
    > >>>> wrote:

    >
    > (snipped)
    >
    > >>>In fact, in most cases, not using a *core* module is a mistake.

    >
    > >>Your factual basis is?

    >
    > > For more information, see:

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

    >
    >
    > 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
     
    , Oct 17, 2005
    #11
  12. Guest

    Tad McClellan wrote:
    > <> wrote:
    > > Tad McClellan wrote:
    > >> <> wrote:
    > >>
    > >> > Subject: Question for the regulars
    > >>
    > >>
    > >> I expect that many (most?) of the regulars do not see your
    > >> posts, because we are assholes.

    > >
    > > 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.


    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
     
    , Oct 17, 2005
    #12
  13. <> wrote:
    > Tad McClellan wrote:
    >> <> wrote:
    >> > Tad McClellan wrote:
    >> >> <> wrote:
    >> >>
    >> >> > Subject: Question for the regulars
    >> >>
    >> >>
    >> >> I expect that many (most?) of the regulars do not see your
    >> >> posts, because we are assholes.
    >> >
    >> > Did you read Bill Segraves' post?


    > As of this writing, it's his only post in this thread.



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


    >> 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.



    Message-ID: <>


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Oct 17, 2005
    #13
  14. Purl Gurl wrote:

    <usual pantomime dialogue snipped>

    >
    > 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 -
    ....
    our %in;
    - Ken Singleton Jul 7 2004
     
    foo bar baz qux, Oct 17, 2005
    #14
  15. Lynn Guest

    wrote:
    (snipped)
    > 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
     
    Lynn, Oct 17, 2005
    #15
  16. Guest

    Tad McClellan wrote:
    > <> wrote:
    > > Tad McClellan wrote:
    > >> <> wrote:
    > >> > Tad McClellan wrote:
    > >> >> <> wrote:
    > >> >>
    > >> >> > Subject: Question for the regulars
    > >> >>
    > >> >>
    > >> >> I expect that many (most?) of the regulars do not see your
    > >> >> posts, because we are assholes.
    > >> >
    > >> > Did you read Bill Segraves' post?

    >
    > > As of this writing, it's his only post in this thread.

    >
    > 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
     
    , Oct 17, 2005
    #16
  17. Dr.Ruud Guest

    Tad McClellan:

    > Message-ID: <>


    YM: <news:>

    --
    Affijn, Ruud

    "Gewoon is een tijger."
     
    Dr.Ruud, Oct 17, 2005
    #17
  18. Guest

    wrote:
    > 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).
     
    , Oct 17, 2005
    #18
  19. Guest

    Lynn wrote:
    > wrote:
    > (snipped)
    > > 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.


    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
     
    , Oct 17, 2005
    #19
  20. Brian Wakem Guest

    wrote:

    > 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'.



    --
    Brian Wakem
    Email: http://homepage.ntlworld.com/b.wakem/myemail.png
     
    Brian Wakem, Oct 18, 2005
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sean
    Replies:
    1
    Views:
    628
    Cowboy \(Gregory A. Beamer\)
    Oct 20, 2003
  2. scott

    regulars expressions ?

    scott, Jun 28, 2005, in forum: Python
    Replies:
    4
    Views:
    349
    Devan L
    Jun 28, 2005
  3. Chris Hills
    Replies:
    18
    Views:
    489
    Richard Bos
    Sep 6, 2006
  4. jacob navia

    "regulars" do not use debuggers

    jacob navia, Jul 31, 2009, in forum: C Programming
    Replies:
    26
    Views:
    815
  5. santosh

    What happened to some regulars?

    santosh, Aug 20, 2011, in forum: C Programming
    Replies:
    6
    Views:
    530
    Charles Richmond
    Aug 20, 2011
Loading...

Share This Page