Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Perl::Improved Volume 0, Number 0

by Wassercrats (Initiate)
on Aug 26, 2004 at 17:10 UTC ( [id://386089]=perlmeditation: print w/replies, xml ) Need Help??

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Wassercrats::Improved Volume 0, Number 0
by revdiablo (Prior) on Aug 26, 2004 at 18:03 UTC


    Welcome to the first and only edition of Wassercrats::Improved. You say we like your ideas and we'd like to see more than one at a time? Well, you're wrong.

    You might have guessed that I'm replying once and only once, because I usually don't like wasting my time with trolls. This is sad. My post mocks Wassercrats.


    In This Issue:

    Silly Critique: File tests
    Ridiculous Critique: Perl's zero-based numbering scheme
    Saddening Perlmonks Posts


    Silly Critique

    File tests are modeled after the ones used by most shell programmers, via the test command, otherwise known as [. This is extremely convenient, and make doing common file tests very easy. Perhaps there could be a case made for synonyms that are spelled out, but I wouldn't want to use them.


    Ridiculous Critique

    Many languages start their indexes at 0. I would venture to say this is the rule, not the exception. I can't say for sure, not having done an exhaustive survey of programming languages, but my gut feel tells me it's correct. Moreover, the 0-based index has been around for so long, changing it at this point would be insane.


    Saddening Perlmonks Posts

    The fact that you are proud of your amazingly bad post drives the nail in the coffin. At one time, I just thought you were ill-informed and annoyingly naive. Now I know you're simply a troll. I wish you would stop wasting our time, but I know you won't. This makes me extrodinarily sad.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Perl::Improved Volume 0, Number 0
by perrin (Chancellor) on Aug 26, 2004 at 17:57 UTC
    The numbering of array indexes and other things in Perl start at 0. This is dumb.

    $[ = 1;
    Now they start at 1. However, that would be dumb.

      Indices should start at one. Its the joining of the meanings of offset and index that leaves us with arrays that start at zero. Offset is a measure of how far to travel from the start and there it makes sense that travelling nowhere from the start leaves you at the start. Calling the first element the zeroth element is just sloppy.

      Maybe if this were C or some sort of assembly then I'd think that using offsets makes more sense than indices.

        it seems to me that having indicies starting at 0 makes programming much easier, because this concept removes many playings with adding/substracting 1 when calculating them.

        Imagine you do two-dimension array simulation
        With 1-based arrays you'll need to do something like this:

        and this is equivalent to
        which is dumb
      A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Perl::Improved Volume 0, Number 0
by Fletch (Bishop) on Aug 26, 2004 at 18:10 UTC
                           /  \\
                    ______ \  //
                   /      \/ o \
          ________/             \
                  \_  \__\ \-----o

    Squeak! (Not to be confused with Squeak, of course). And I stayed (mostly) inside the lines. I'll have be sure to hang this one on the fridge.

    Edit by tye, remove color="..." and fgcolor="..." attributes

                             /  \\
                      ______ \  //
                     /      \/ o \
            ________/             \
                    \_  \__\ \-----o   

      I let me 2 year old color this one, she thinks arrays should start at zero.

Re: Perl::Improved Volume 0, Number 0
by demerphq (Chancellor) on Aug 26, 2004 at 20:10 UTC

    The filetests are that way because they are that way elsewhere. If you want longer filetestnames there is nothing stopping you doing so:

    sub file_size($) { -s $_[0] }

    As for 0 indexing veruse 1 indexing I think its one of those debates that deserves more attention than "This is dumb."

    And i think this comes down to why people here dont give you any respect. Your arguments are usually poor, and when you do have a good one they are so mired in crud that its hard to tell that you have a point. If you want to post something about file tests or about indexing that has some meat to it then do so, but please don't continue with stuff like this. I know you feel agreived about how you've been treated but i really think you need to reasses your own conduct as well.


      First they ignore you, then they laugh at you, then they fight you, then you win.
      -- Gandhi

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Perl::Improved Volume 0, Number 0
by Grygonos (Chaplain) on Aug 26, 2004 at 18:43 UTC

    alphabetically speaking(in english), there are 26(52 for the case-insensitive) possible file test operators. Honestly,show me where 26 (52) test operators becomes inadequate, and then you may have a case for more descriptive (read: larger length)test operators. Not everything should be overly verbose

    if(-'the allmighty file test for directory status passes on' FILE) { with(preceding::zero(4) && decimal::point(2) print '4'); }
    This is obviously an extreme exaggeration but, you honestly expect anyone to care that you find the file test operators (a basic perl attribute) inconvenient? please.... If you don't like perl.. don't program in it.. simple as that. I have rants about VB, you don't see me trolling a VB board asking them to change a language I have a dislike for do you?

    I'm sure my xp will take a nose dive for this , but I don't care so much.

      Not everything should be overly verbose

      I don't think that's Wassercrats' point. It's easy to understand why the file test operators in the shell are so short -- they're common operations there. Based on my Perl corpus though, I don't use them often enough to justify two-character operators.

      Now it'd be terrible practice for me to pronounce the one true way based on a single corpus, but as I mostly program applications and not administration scripts, I wouldn't mind terribly much using something like File::exists( 'filename' );.

        File::exists( 'filename' );

        This seems like a natural addition to English, but I think it would need something more like a source filter and less like the typeglob diddling of English, so it's not an easy addition.

        Update: demerphq has the right of it... just a sub File::exists($) { -f $_[0] } would do it.


        You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.
Re: Perl::Improved Volume 0, Number 0
by hardburn (Abbot) on Aug 26, 2004 at 17:47 UTC

    You are dumb. I back this statement up with as much evidence as you provide in your arguments.

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

Re: Perl::Improved Volume 0, Number 0
by SamCG (Hermit) on Aug 26, 2004 at 18:53 UTC
    Even for a relative perl novice like myself your "critiques" seem a bit dopey so far. It's a bit silly to say the file test codes don't sufficiently "describe" the test -- such descriptions are only important for those who don't know what the codes are and don't want to look them up. And I'm in agreement with the other poster on 0-based indices; I think they're pretty typical. I hope your criticisms will get a little better, you give very little in the way of reasons for why you think something is "dumb" or why something "should" be a certain way.

      Actually I thought the file test one was actually somewhat valid. Granted those coming from a shell background probably have no problem with them, it might be nice if there was something akin to Ruby's File::Stat class which provides a more predicate-like set of tests for the OOPy out there. Someone enterprising might patch File::stat accordingly and send it to p5p.

Wassercrats::Improved, Part Deaux
by Paulster2 (Priest) on Aug 27, 2004 at 12:34 UTC

    You know Wassercrats, I really am trying to give you the benifit of the doubt on this why do people always down vote my nodes (posts) thing, but you leave me very little wiggle room. Your arrogance is stifling! As I tried to point out to you in previous CB instances (and others have, also) it's not your ideas or your knowledge of perl that gets you down voted, it's all of the garbage and bagage that comes along with it. For instance you posted:

    Bonus Critique
    Perl's zero-based numbering scheme
    The numbering of array indexes and other things in Perl start at 0. This is dumb.

    You may be correct in this assumption, but give us something to work with, here. While it may be obvious to you what you mean, it means nothing to the rest of us. Explain your argument why This is dumb with out all of the rhetoric that usually comes with your posts, you might actually get someone to agree or at least respond to you in a civil fasion. (As a side counter point to your non-argument above: While starting the numbering at 0 may be dumb to you, I guess you're suggesting that all computers/code external of perl should be fixed so they don't use zero for a base? WOW, does this smell of Y2K?)

    Then let's take a look at the Let's Bash O'Reilly node that won you worst node of the year honors. I'm not talking about the original node, specifically, but how many Re: nodes did you write after it? So many that I stopped counting, most of them are very negative in tone, which will more than likely win you a -- for your efforts. Quit leaving yourself open for such abuse, unless of course you like it. (I hope you know that a psychology student could write a thesis on you and gain a doctorate! .oO(Hey, maybe that's his goal?))

    I leave your posts/nodes and remarks to one of several (maybe multiple) things:

    1) You are young and you know it all.
    2) You are using Wassercrats as a pseudonym, and are using it to express things without getting -- on your other node.
    3) You want to be a martyr.

    I'm sure that there are a plethora of things that I could list here, but this is what I came up with off of the top of my head.

    So bottom line to what I am trying to tell you: 1) Explain yourself without rhetoric, 2) Be constructive, not destructive, 3) When you've made your point (at least in your eyes), leave it alone. You don't have to retort to every node that posts.

    I tell you one thing though, you sure know how to get this site fired up.


    PS: I tried to color the rat, but it left marker on the screen. I'm still trying to clean it off.

    You're so sly, but so am I. - Quote from the movie Manhunter.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Perl::Improved Volume 0, Number 0
by antirice (Priest) on Aug 26, 2004 at 22:20 UTC

    Wassercrats, this node should be your next noteworthy node considering it's where you state your exact intentions here on this site. It's nice to see you're sticking with it as I surely would've grown tired of it by now. How you find the time and willpower, I'll never know.

    I'd also like to say that the funniest thing you've ever posted is your response to this node. ;-)

    The first rule of Perl club is - use Perl
    ith rule of Perl club is - follow rule i - 1 for i > 1

Re: Perl::Improved Volume 0, Number 0
by coec (Chaplain) on Aug 27, 2004 at 00:13 UTC
    I come from a shell background so I don't agree with your comments on the file tests, although I understand that they can be ambiguous. If there is an aspect to a language that you find difficult, how about commenting the code until you are comfortable with the operations you are performing?


    # Get the age of the file my $age = -M BASE_DIR."/$state/$_";

    Update: Fix the comment...

Re: Perl::Improved Volume 0, Number 0
by Joost (Canon) on Aug 27, 2004 at 11:36 UTC
    Haha! I like this post. I do have some criticisms, though:

    A single letter doesn't adequately describe the function of the tests. The test names should be longer and more descriptive.

    Since Perl was originally intended to be a sort of "shell language for text manipulation" and unix shells also use the -X functions for file tests, the single letter scheme probably made it easy for the intended audience to learn and use them. We can hardly remove it now, as it would break most scripts that need the tests. I agree that the names for these functions should be longer and more descriptive, but that's what File::Stat does for you already, if you want to use it.

    The numbering of array indexes and other things in Perl start at 0. This is dumb.

    There are perfectly valid arguments for using a 1-based indexing scheme, just as there are perfectly valid arguments for using a 0-based indexing scheme. Since you don't provide any, I won't either. Look around, this discussion has been going on for decades. AFIK most modern (as in, newer) languages use 0-based indexing, though (I'm not saying 0-based indexing is more correct, just that it's become the dominant scheme).

    Some other 0-based indexing schemes in Perl are rather silly (like 0-based months) but are here because of consistency with underlying system calls and backward compatibility. OTOH I haven't directly manipulated the output of localtime() and gmtime() in years: I find POSIX::strftime() and the DateTime modules much simpler to use anyway.

    Misc. feedback:

    I like Ratty.

    I'd like to see a discussion about little-endianness vs big-endianness in next issue. :-)

Re: Perl::Improved Volume 0, Number 0
by zentara (Archbishop) on Aug 27, 2004 at 14:02 UTC
    Did you know you could spell "rats ass crew" from the letters in Wassercrats?

    You may find this sig seen here, useful in your pursuit of intellectual excellence:

    Non gratum anun rodentum..."not worth a rat's ass".

    It would look good on t-shirts for your "crew".

    I'm not really a human, but I play one on earth. flash japh
Re: Perl::Improved Volume 0, Number 0
by ccn (Vicar) on Aug 27, 2004 at 19:39 UTC

    I know why did you post that. It's because chiburashka got lower than you in "Other Users" nodelet

    ++WC :)

Re: Perl::Improved Volume 0, Number 0
by bradcathey (Prior) on Aug 27, 2004 at 02:35 UTC

    Perl isn't the only language to start array indexes at 0. But then BASIC has/had option base.

    I have to agree with antirice, where do you find the time or energy to come up with this stuff? However, I have to say some of it is entertaining. It's just makes me wish there were levels for negative XP. -1 to -10 = dumb, for starters, but then where do you go from there?

    I look froward to your next edition of Perl::...what was it called?

    "Don't ever take a fence down until you know the reason it was put up." G. K. Chesterton
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Perl::Improved Volume 0, Number 0
by Gunth (Scribe) on Aug 29, 2004 at 04:17 UTC
    The thing you don't understand is Perl is about choice. It doesn't force you to start at 0,
    $[ = 1;
    but does by default because the people that coded Perl coded it in a language that does, and many, many other languages start at 0 as well. Why change it and confuse people? and you can create longer verbose functions instead of well defined shell commands,
    sub file_exists { -X shift }
    but people are use to it already.

    And probably for anything else you write in your rants you can do too with no difficulty.

    Perl is a great language, but there's no need to sway from well defined coding principals. If we do then it would be much more complicated and complex than it is now.

    Everything you are claiming at criticism of Perl are actually benefits. Perl inherits from a lot of computer languages and principals while still being unique, making it very powerful and easy to learn after being around the Unix OS for a while.


Re: Perl::Improved Volume 0, Number 0
by sintadil (Pilgrim) on Aug 29, 2004 at 16:02 UTC

    The test names should be longer and more descriptive.

    Why? They're named that way for programmers coming to Perl from a shell. Thus, the shell programmers are familiar with them. Hence, you lose any "it's more intuitive!" arguments. And if you're coming to Perl from something like C, you have stat().

    The numbering of array indexes and other things in Perl start at 0. This is dumb.

    Why? Array indices start at 0 in just about every other programming language1, and they're modeled after the way the machine addresses memory. It'd be a major point of contention and grinding of teeth if Perl changed decades of programming intuition in order to make sense to someone who doesn't have a computer science background. ... not to mention that it'd break so much code, and possibly expose off-by-one security holes in that which it doesn't break outright.

    I really don't like what you're doing here, though I (in spite of myself) appreciate the ultimate goal of what you're doing. Just don't make me use your creation. :)

    I'll end this post with a quote from my .signature:

    I abhor a system designed for the "user", if that word is a coded pejorative meaning "stupid and unsophisticated". -- Ken Thompson


    1: Yes, I realise that conformity is almost always a bad idea, but standards are good, especially something as widespread as array indices.

      05:00  TheEnigma wakes up...
      05:01  Pours first cup of coffee...
      05:02  TheEnigma oO(Mmmm... coffee...)
      05:03  Shuffles into computer room...
      05:04  TheEnigma oO(What's on PM today?)...
      05:05  browsing...
      05:06  browsing...
      05:07  TheEnigma <exclaim>Hey..another episode of my favorite soap opera,
                                  As The Wassercrats Trolls</exclaim>
      05:10 TheEnigma oO(Man..this coffee just isn't strong enough)

      Actually, I think the monks are going about this all wrong. We already know he's going for the lowest XP. But I think this thread is something different. In this node he mentions Perl::Improved being "fun", and that too many monks "don't get it". Fun? Get it? Sounds like it's all a joke. That's what we all should be responding to: how funny it is!

      Unfortunately for you Wassercrats, even with this new criterion, your node is subpar. As a comedian, you need to think of your audience. Although I didn't go to a university, or study programming formally, I find an affinity for the type of humor programmers tend to exhibit, especially those with *nix background. (At least, this is my impression.) It's wry, clever, offbeat, with many literary/cultural references.

      So my advice Wassercrats, get a feel for sense of humor you need. Watch plenty of Monty Python and The Simpsons. Read The Lord of the Rings for good literary references; and of course all the O'Reilly Perl books, which tend to exhibit the proper tone.

      But. if it makes you feel any better, my kids would probably think "It's dumb" hilarious. I know "rats ass crew" would have them ROTFLTAO ;)


      A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Perl::Improved Volume 0, Number 0
by Anonymous Monk on Aug 29, 2004 at 15:23 UTC
                           /  \\
                    ______ \  //
                   /      \/ o \
          ________/     idumb   \
                  \_  \__\ \-----o
Re: Perl::Improved Volume 0, Number 0
by Solo (Deacon) on Aug 27, 2004 at 02:35 UTC


    Evacuate?! In our moment of triumph?! I think you overestimate their chances... (Famous last words of Grand Moff Tarkin)
Re: Perl::Improved Volume 0, Number 0
by Your Mother (Archbishop) on Aug 28, 2004 at 02:06 UTC

    OP++. Any family without at least one, como se dice, eccentric? aunt or uncle is a poorer family for it.

Re: Perl::Improved Volume 0, Number 0
by CountZero (Bishop) on Sep 10, 2004 at 18:44 UTC
    Whatever you may think of Wassercrats, this node sparked a lot of interesting discussions. I move that Wassercrats is elevated to the rank and function of the Monastery Jester: he who is allowed to say anything to anyone and although what he says is never serious, it might start people thinking.

    None of us should ever get worked up by what he says because we would all know that it are only the thougths of a "fool".


    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      Jesters dont spew venom!!!!
    A reply falls below the community's threshold of quality. You may see it by logging in.
rats ass crew Number 0.1b
by Anonymous Monk on Jan 06, 2005 at 10:55 UTC
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://386089]
Approved by dragonchild
Front-paged by dragonchild
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2024-04-19 12:51 GMT
Find Nodes?
    Voting Booth?

    No recent polls found