Slashdot Mirror


Periodic Table of the Operators

mAsterdam writes "At his code blog Mark Lentcner writes: "A while back, I saw Larry Wall give a short talk about the current design of Perl 6. At some point he put up a list of all the operators - well over a hundred of them! I had a sudden inspiration, but it took a few months to get around to drawing it..." You might want to take a look at this and think about which operators are yet to be discovered."

323 comments

  1. the pdf file by eille-la · · Score: 3, Informative

    http://www.ozonehouse.com/mark/blog/code/PeriodicT able.pdf

    I the only one who saw the adobe acrobat plugin for firefox on his knees loading this?

    1. Re:the pdf file by maswan · · Score: 4, Informative
      I put up a mirror of that file here: PeriodicTable.pdf

      The current server seems a bit slow to respond, so..

      /Mattias Wadenstein

    2. Re:the pdf file by brokencomputer · · Score: 1

      Gnome PDF viewer .131 had no problem loading this in firefox. Also, it renders correctly as long as the background is supposed to be black. :-/

    3. Re:the pdf file by Anonymous Coward · · Score: 2, Funny
      Are you sick of having to copy and paste URLs into your address bar, and remove the spaces put there by Slashdot? With amazing new Hyper-Link technology, following URLs is a snap! All you have to do to create one is put this into your post:

      <A HREF="your URL here">description of site</A>

      Remember to include the http:// in the URL or browsers will think it's a subdirectory of slashdot.org!

    4. Re:the pdf file by EugeneK · · Score: 1

      Holy crap, this is amazing. You should patent this.

    5. Re:the pdf file by SomeGuyFromCA · · Score: 1

      > [Was] I the only one who saw the adobe acrobat plugin for firefox on his knees loading this?

      The acrobat browser plugins do tend to spike CPU use all the way up to 100%...

      --
      if the answer isn't violence, neither is your silence / freedom of expression doesn't make it alright
    6. Re:the pdf file by Anonymous Coward · · Score: 0

      it isnt. it's white.

    7. Re:the pdf file by Anonymous Coward · · Score: 0

      With Firefox, the adobe pdf plugin likes to ask if you want to 'check for updates', but the prompt always goes behind the firefox browser window, so you don't see it. You have to alt+tab over to the adobe prompt and choose yes or no before the document will load in the browser.

    8. Re:the pdf file by Methuseus · · Score: 1

      That's why I've started just downloading PDF files instead of opening them in the browser. I've noticed IE does the same thing with Acrobat...

      --
      Two things are infinite: the universe and human stupidity, though I'm not yet sure about the universe. - A Einstein
    9. Re:the pdf file by E_elven · · Score: 1
      --
      Marxist evolution is just N generations away!
    10. Re:the pdf file by Dizzle · · Score: 1

      Loading? No. It loaded fine for me, but Firefox just crumples up like a rag doll when it tries closing the damned things.

      --
      -Dizzle
      "I most likely AM so interested in myself."
    11. Re:the pdf file by Anonymous Coward · · Score: 0

      How pitty the lovely author is a damn fucked pederast.

  2. Oh my sweet Jesus... by btlzu2 · · Score: 5, Interesting

    This cannot mean good things for Perl. Look at all of those operators!!!! Correct me if I'm wrong, but isn't that pretty onerous to have a huge chart of possible operators for a language? I'd quite prefer simplifying over adding multiple combinations of ways to doing things. That code is gonna be NASTY.

    All the more reason for me (IMO) to avoid Perl like the plague.

    --
    Zed's dead baby. Zed's dead.
    1. Re:Oh my sweet Jesus... by BokLM · · Score: 4, Insightful

      If you don't want more than one way to do it, then Perl is not for you ...

    2. Re:Oh my sweet Jesus... by Roland+Piquepaille · · Score: 1, Funny

      That code is gonna be NASTY.

      That code already is nasty. Ever looked at Perl scripts in the last few years?

    3. Re:Oh my sweet Jesus... by btlzu2 · · Score: 1

      Exactly what I was thinking. (whether you were being facetious or not!) :)

      --
      Zed's dead baby. Zed's dead.
    4. Re:Oh my sweet Jesus... by spectral · · Score: 2, Interesting

      I was going to disagree, but then I looked at it. Apparently orthogonality wasn't much of a concern when creating this language. I realize it's loosely/dynamically typed (the distinction between the two has always been difficult for me), but come on.. different types of compare operators that work on regular variables (one for numbers, one for strings)? Can't the interpreter just say "Oh, one of these is a string, internally. Do it like that. Or, have a special cast or somethign so in the rare cases it doesn't do that, then you can make it?

      I guess it's better for there to be operators for each, so there's no ambiguity. But if you didn't want type ambiguity, why not just make variables statically typed?

      Even if you use only 5% of this language, reading the code of someone else who uses even just a different 1% of the language is going to be a maintenance nightmare, imho.

    5. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      Stick to your Visual Basic then....

    6. Re:Oh my sweet Jesus... by ipjohnson · · Score: 1

      As I said in my last interview. You can write nasty code in any language some just lend themselves more to it.

      I write perl routinely to help do everything from produce C++ code to parsing log files. Its all in how you use it.

    7. Re:Oh my sweet Jesus... by RuneB · · Score: 1
      Possibly worse are languages that let you define your own syntax. Imagine something similar to #define in C, except you could specify what symbols you wanted to use to separate each argument.

      The TADS3 language uses this extensively to allow you to define shortcuts when defining an object. You can look at some examples here.

      --
      dtach - A tiny program that emulates the detach feat
    8. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 2, Insightful

      Part of the reason why Perl is so good is that it makes development fast and easy. That's what a scripting language should do. It should be high-level and easy to develop in. The extreme flexibility of Perl is a good thing.

      Contrast this to something like Python which I find barely acceptable as a high-level language. The syntax is just as tedious and verbose as something like C++ or Java. Which raises the question, why use the slower Python at all? Try using regular expressions in Python. It is kinda like using them in C++ or Java, eh? Now try it in Perl where it's built-in (special operators). Seamless, fast, and easy.

      The only things I like better about Python are that it has a simple built-in interactive mode, a better object system, and it's easier to integrate into non-Python projects. The language itself sucks though.

    9. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      Hello just testing pls ingore thx

    10. Re:Oh my sweet Jesus... by mcc · · Score: 4, Insightful

      come on.. different types of compare operators that work on regular variables (one for numbers, one for strings)? Can't the interpreter just say "Oh, one of these is a string, internally.

      This duality is already a feature of Perl and it actually is a necessity. The reason is that string compare and numeric compare are different desired operations.

      Let us say that perl used == for both string and numeric compare. Now let us say that someone wrote the following statement in a perl program: "3.0" == "3". Does this return true or not? If we perform a numeric compare, then yes. If we perform a string compare, then no. Now, you can point at my example and say that since 3 and 3.0 were both quoted here, clearly the programmer intended for 3 and 3.0 to be treated as strings. However, if rather than literals those had been variables-- maybe taken from user input-- that would have been no such indicators. The language has no way to tell what to do.

      This really so much isn't about types as it is about the fact perl will autobox numbers in and out of strings for you. I'll give you Perl has many features that just make one's head hurt, but this isn't one of them.

    11. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      It's really no different than the way Perl currently works.

      == versus "eq"? I never even think about it. It works because it lets you force both sides to strings, or you can force both sides to be numerical. So you can do things like "1" == "20" and it will convert them to integers before comparing. Or 1 eq 20 will convert them to strings before comparing. This gives the programmer a lot of power.

    12. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      I love that excuse: it's like saying you'd rather buy assembly-required kits where all parts can fit together "because there should be more than one way to do it". Wake up, programming isn't about getting fancy with coding style, is about consistency, readability and re-use. Unless you only write one-off hacks, of course.

    13. Re:Oh my sweet Jesus... by bcrowell · · Score: 1
      I guess it's better for there to be operators for each, so there's no ambiguity. But if you didn't want type ambiguity, why not just make variables statically typed?
      I can see three options for how to design the language:
      1. Design it the way it's actually designed: b<c and b lt c are both valid, and mean different things.
      2. Design it with static typing. You declare b and c as either strings or numbers, and b<c means something different in the two cases.
      3. Design it with static typing, have two different operators, and require an explicit cast if you want to do a numerical comparison of two strings, for instance.
      Option 2 sucks, IMO, because it means when you read the code, you can't tell what it's doing without knowing the types of b and c. It makes an opportunity for a lot of subtle bugs, e.g., you don't realize that your code is really doing a string comparison rather than a numerical comparison.

      Option 3 just sounds like a pain, although I guess some languages do it that way, e.g., I think in OCaml there are separate operators for multiplying integers and multiplying floating point numbers.

      Some of the operators might seem needlessly baroque, but they're actually really nice. For instance, the logical operators && and || have synonyms 'and' and 'or', which have lower precedence. That means you can often write complex logical expressions in a very readable way, without lots of parentheses:

      a
      and
      b || c
      (Slashcode ate my indentation there -- the two operands of the 'and' are meant to be pushed to the right for readability.)
    14. Re:Oh my sweet Jesus... by lightknight · · Score: 1

      Well, maybe.

      (Excuse my ignorance in such matters{Perl}), but I think it's the compiler's job (with other languages) to check for conditions likes this (comparing two unlike objects). It catches the mistake, you cast one of the objects one way or another, and use their methods.

      --
      I am John Hurt.
    15. Re:Oh my sweet Jesus... by Kegster · · Score: 1

      At least half of these are already in Perl at the moment, its not that hard to read, better than trying to figure out if someone really wants to test, ie numeric or string equality from context if the operators are the same.

      If you can remember what the operators do then it makes it explicit, which is good, you just have top memorise the operators, which could be a pain in the arse.

      Sure, you can use it to write nasty code that is impossible to read, but you can do that in practically any language that isn't completely tedious to use.

      I use perl because I like the flexibility, and it makes sense to me, if you don't like the way Perl works, use something else, like Python or Ruby, its not as if anyone is pointing a gun at your head forcing you to use Perl.

    16. Re:Oh my sweet Jesus... by Ugmo · · Score: 2, Interesting

      These constructs exist (or can exist with some work) in all languages even if there are no symbols for them.

      I originally learned programming (formally) with Pascal. We were taught to increment a loop variable with a:=a+1;

      When I learned C I thought the post increment operator was stupid and a waste, invented just so lazy programmers could save typing a few characters (a++ instead of the above). But anyone who uses pre and post increment operators knows it enables you to do some things in a nice compact way. You can do the same thing with Pascal but it takes more code and sometimes more complicated code.

      I had similiar feelings about short-circuit operators and I tend not to use them. My code is longer because of that.

      Have you ever tried using regular expressions in Java or Visual Basic? The Perl operators and syntax make using regexes and matching 1000 times simpler and easier to understand in Perl than those other languages if you ask me.

      I think if you learned Perl and understood all the freaky operators you would actually learn techniques and distinctions that would probably help you in using other languages once you tanslated the ideas into their syntax. (Foreach in Perl is similiar to iterators in C++, at least I use them that way)

      That being said I have been screwed over by the distinction betweeen the string and numeric comparison operators before.

    17. Re:Oh my sweet Jesus... by Fweeky · · Score: 0

      I prefer having more than one way to do it in terms of choosing different algorithms and code styles; whether I want to do it like a script, a procedural or OO app, custom datatypes and objects or native types, language defined loops or methods with control over passed code blocks.. there's *plenty* of ways to do things without giving the language itself huge levels of redundancy; that's a naive and frankly silly way towards having MTOWTDI. But, hey, TMTOWTDI, that's why we have multiple languages :)

    18. Re:Oh my sweet Jesus... by Halfbaked+Plan · · Score: 0

      And unlike the camel, perl didn't evolve in a desert. It was invented in a rarified atmosphere.

      So it's a hothouse plant, essentially.

      That's okay. There's also a following of people who raise African Violets. They have enthusiast magazines, clubs and associations, too.

      --
      resigned
    19. Re:Oh my sweet Jesus... by SatanicPuppy · · Score: 1

      Aside from the math issues vis a vis string/int comparing, I'm always leery of letting a program decide for itself the data type that it is recieving. Every time VB does that, its an open door to a buffer overflow.

      Agree completely about reading other peoples perl code, though.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    20. Re:Oh my sweet Jesus... by Mr.+Piddle · · Score: 1

      "3.0" == "3". Does this return true or not?

      Even numerically, good programmers assume this to be always false. Why? Because it isn't deterministic whether "3.0" is actually 2.999999... or 3.0000...0001. Also, "==" does not imply "almost"; it is exact.

      --
      Vote in November. You won't regret it.
    21. Re:Oh my sweet Jesus... by Waffle+Iron · · Score: 2, Interesting
      Contrast this to something like Python which I find barely acceptable as a high-level language. The syntax is just as tedious and verbose as something like C++ or Java.

      Have you bothered learning the latest feature additions to the Python language? Some of these can make Python just as terse as Perl, especially list comprehension; for example:

      print '\n'.join(dict.fromkeys([ x.lower() for x in file('foo.txt').read().split() if x not in ignore_words ]).keys())

      That's nothing like C++ or Java. And it's much easier to comprehend at a glance than the equivalent Perl code would be (for example, no subtle differences between "list context" or "scalar context" depending on exact placement of @s and $s).

    22. Re:Oh my sweet Jesus... by eyeye · · Score: 1

      here, have a free clue.

      THEY AREN'T COMPULSORY!
      You don't have to use them, feel free to do things the long way round and pretend you are using another language.

      I'm guessing you don't know anything about perl.

      --
      Bush and Blair ate my sig!
    23. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      Yes, I know about the crap that has been shoehorned in. Kinda like the stuff they have been forcing into Java because the designers were too dumb to make a decent language in the first place.

      Your example does not make Python worthwhile. You can do the same thing in C++. In Perl it's even easier.

    24. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      Perl is not C, so 3.0 is identical to 3 or you get your money back

    25. Re:Oh my sweet Jesus... by gorre · · Score: 1
      "3.0" == "3". Does this return true or not?
      Even numerically, good programmers assume this to be always false. Why? Because it isn't deterministic whether "3.0" is actually 2.999999...

      You obviously never studied mathematics, 3 and 2.999... are exactly the same.
      --
      "Madness is something rare in individuals - but in groups, parties, peoples, ages it is the rule." -- Nietzsche
    26. Re:Oh my sweet Jesus... by Waffle+Iron · · Score: 1
      Yes, I know about the crap that has been shoehorned in.

      And Perl doesn't have any crap shoehorned in? LOL.

    27. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      That's the whole point of casting -- to tell the compiler/interpretter how to interpret the data. You have this problem with overloaded operators in C++ too. And in PHP and Python.

      You could obviate the whole thing with sensible promotion of variables. Though that gets into an interesting case of what the default promotion should be -- to numbers or to strings?

    28. Re:Oh my sweet Jesus... by HeghmoH · · Score: 3, Insightful

      That's all fine and good until you have to read or modify somebody else's code. Then you're in for a world of trouble, because the operators you like to use and the operators he likes to use will not be the same, and you'll have to look them up.

      If you never get beyond hobby programming, of course, then this is almost never an issue.

      --
      Mod down posts with a "Free Mac Mini/iPod" sig, they're spam!
    29. Re:Oh my sweet Jesus... by Vlad_the_Inhaler · · Score: 2, Insightful

      40 odd years ago, Algol60 was defined. The 'equality' operator ('=', I think!) was defined as being 'roughly equal' for floating-point numbers.
      This turned out to be a bad thing(tm) so no-one has repeated that particular mistake since.

      --
      Mielipiteet omiani - Opinions personal, facts suspect.
    30. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0
      Whether that's true or not, in perl:
      $ perl -e 'if ("3.0" == "3") { print "true\n"; }'
      true
    31. Re:Oh my sweet Jesus... by This+Is+Ridiculous · · Score: 2, Insightful
      but come on.. different types of compare operators that work on regular variables (one for numbers, one for strings)?

      Perl has always had this. All Perl 6 values have a type like Int or Str, but this isn't necessarily useful--I/O in Perl is done exclusively with strings, so without casting (which already exists--the ~, + and ? unary ops, along with the 'as' binary op) all the comparisons would be with strings too.

      Basically, you have to have the typing somewhere. Some languages have them in the values; Perl has them in the operators. It's a design trade-off.

      If you really want a magical equality that Does The Right Thing, the smartmatch operator (~~) does a lot more than the old Perl 5 regex-binding (=~) ever did. You can pretty much hand it two arbitrary objects and it'll do something appropriate with them.

      Perl 6 looks like a big language--and really, it is pretty big. The trick to learning it is to recognize the parallels. For example, throughout the language the question mark is used for boolean operations, plus for numeric ops, and tilde for string ops. (The tilde is supposed to remind you of a little piece of string.) This extends to ANDs, ORs, XORs, and NOTs as well--there are the parallel sets of operators ?&, ?|, ?^, ?!, +&, +|, +^, +!, and ~&, ~|, ~^, ~!, along with logical short-circuting &&, ||, ^^, and !, and junctive operators &, |, and &. (Yeah, there's a break in the parallelism there, for hysterical raisins. Junctive operators, btw, allow you to say things like "$foo == 1|2|3", but they're a fair bit more flexible than just that.)

      --
      Hey, you try to find an open nick these days!
    32. Re:Oh my sweet Jesus... by modge · · Score: 1

      Im really glad I never studied maths much

      --
      I am a sig
    33. Re:Oh my sweet Jesus... by Jerf · · Score: 4, Insightful

      However, if rather than literals those had been variables-- maybe taken from user input-- that would have been no such indicators.

      Here is where your argument falls down. Proof by construction: There are a large number of languages of every variety that still manage to have types for that input.

      Your argument is more accurately described as:

      "Perl actively tries to avoid giving types to strings and numbers, and as a result of this desire to not distinguish between the two, the onus is on the programmer to do so. That's how the language solves this problem that other languages solve through stronger typing."

      At this point, one can then go on and debate whether or not this is a good thing, but don't pretend that Perl has no choice. It had all kinds of choice and deliberately chose this system, most likely for backwards programmer compatibility with awk and its other predecessors.

      Perl isn't "autoboxing"; that's a technical term that means that you take simple C++ or Java style scalars and automatically wrap them in an object. Perl is dynamically "looking at" the object as either a number or a string, depending on context; thus, to the programmer, every string is also a number (albiet usually 0) and every number is also a string.

    34. Re:Oh my sweet Jesus... by Mr.+Piddle · · Score: 2, Funny

      3.0 is identical to 3 or you get your money back

      That's unfortunate. Hopefully, Perl programmers can unlearn this habit when they work with just about every other programming language ever. You just can't get around the fact that floating point numbers are constrained to a certain number of bits in RAM, unless special math libraries are used (and those libraries are not used often).

      --
      Vote in November. You won't regret it.
    35. Re:Oh my sweet Jesus... by Mr.+Piddle · · Score: 2, Informative

      You obviously never studied mathematics, 3 and 2.999... are exactly the same.

      Programming != what is theoretically true in math. All I got is these 32 or 64 or 80 bits and there isn't any mathemetician of any IQ that can make 2.9999... in IEEE floating point equal 3.0 exactly.

      --
      Vote in November. You won't regret it.
    36. Re:Oh my sweet Jesus... by imroy · · Score: 4, Informative

      You're thinking about strongly typed languages e.g C, C++, Java, C#. In those language variables are only ever of one type. When copying from one type to another, or comparing different types, there are strict rules of "promotion" (i.e we always promote to higher-precision types).

      Perl is a weakly typed language. There's three main variable types: scalar, list (array), and hash (associative array). Scalars can be both numerical and text strings at the same time. This is the reason that Perl has different equality tests for numbers and strings. The run-time has to to be explicitly told which comparison to use. For an example of how not to handle this situation, just look at the way PHP does it. When a language is weakly typed, the interpreter/run-time loses information about how certain things are to be done with variables. That information loss must be made up somwhere. In this case, it's the operators.

    37. Re:Oh my sweet Jesus... by btlzu2 · · Score: 1

      here, have a free clue.
      Do you *have* to be an ass about expressing a different opinion? I don't care if they aren't compulsory. Having too many unnecessary options makes a language sloppy and furthermore, promotes sloppy programming.

      That said, did you enjoy your little "I am superior" posting? Hope so.

      --
      Zed's dead baby. Zed's dead.
    38. Re:Oh my sweet Jesus... by gorre · · Score: 1
      You're correct, programming is not the same as mathematics, on my computer 16 9s will suffice whereas in reality you would need an infinite number of 9s:
      $ perl -e 'if (2.9999999999999999 == 3.0) {print "true\n";}'
      true
      --
      "Madness is something rare in individuals - but in groups, parties, peoples, ages it is the rule." -- Nietzsche
    39. Re:Oh my sweet Jesus... by mcc · · Score: 5, Insightful

      "Perl actively tries to avoid giving types to strings and numbers, and as a result of this desire to not distinguish between the two, the onus is on the programmer to do so. That's how the language solves this problem that other languages solve through stronger typing."

      Stronger typing does not automatically solve this particular issue. Look at, for example, C. It uses == for numeric compare and strcmp() for string compare. Strong typing does not help here; ==, as in perl, means only one thing, and that one thing is "compare two numbers".

      Now, you *can* in C++ overload the == operator on a string class you create-- or in Java the equals() method-- to do custom comparisons on specific types. However this then brings up the question of what happens if for some reason you want to do a numeric compare between two string objects. You have to somehow do a conversion to a different object type. Perhaps this is a bit clumsy. So yes, certain applications of strong typing lead to a potential way to trick the language into allowing you to perform the two different operations of string and numeric comparison with only a single operator. However you have unfortunately in doing so introduced ambiguity into your definition of equality. This does not necessarily seem like a win to me.

      It is worth noting that Perl 6 offers the opportunity to strongly type your variables, and this includes numeric types. However it still uses the separate == and eq operators for numeric and string compare even when this strong typing is effect, simply as a design choice. I think this is a good one: there are already far too many situations where an operator or function in Perl behaves in different ways depending on minor details of the context, we do not need another. Again, I assure you, you are better off going to find some other grounds on which to attack Perl. You will not have to look long.

      Incidentally, I used the term "autoboxing" in the sense that Perl is automatically converting data entities from string to numeric types (yes, the variables may not be "typed", but the data certainly can be said to be). I was not aware the term "autobox" referred only to conversions between object and non-object types. Oops.

    40. Re:Oh my sweet Jesus... by mcc · · Score: 1

      Hopefully, Perl programmers can unlearn this habit when they work with just about every other programming language ever.

      Rejecting convenience because someday you may have to work without said convenience does not seem to me to be a logical behavior.

    41. Re:Oh my sweet Jesus... by E_elven · · Score: 1

      Well, the easiest route would simply be that "3" is not a number. 3 is, but "3" or '3' isn't. So 3 == 3 (true) 3 == "3" (false) "3" == "3" (true) 3 == "3".to_i (true). For comparison of numeric with a different numeric one could certainly just promote to whichever has larger capacity.

      --
      Marxist evolution is just N generations away!
    42. Re:Oh my sweet Jesus... by E_elven · · Score: 1
      Now, you *can* in C++ overload the == operator on a string class you create-- or in Java the equals() method-- to do custom comparisons on specific types. However this then brings up the question of what happens if for some reason you want to do a numeric compare between two string objects.


      This is a nonissue (unless you like poor design). Operator overloading is a great feature as long as you maintain it consistent and intuitive -therefore, the semantics for operator== should dictate that it always compares the contents of the object with the declared type. 3 == 3 should perform an integer comparison. "3" == "3" should perform a string comparison. If you need to numerically compare two strings you have two choices. Either "3".num_compare "3" or "3".to_i == "3".to_i.
      --
      Marxist evolution is just N generations away!
    43. Re:Oh my sweet Jesus... by E_elven · · Score: 1

      >2. Design it with static typing. You declare b and c as either strings or numbers, and bOption 2 sucks, IMO, because it means when you read the code, you can't tell what it's doing without knowing the types of b and c.

      If the code is properly designed, you either A) do know the types or B(etter)) don't need to. The semantics for x == y should always be the same -do the values compare if assumed both are same type.

      >That means you can often write complex logical expressions in a very readable way, without lots of parentheses:

      >a
      >and
      >b || c

      That is not readable (even with the better indentation) to someone who doesn't know the rule (and is completely unnecessary to be so for anyone else). The first question is 'hmm, why two operators?' This is more readily understood:
      a and (b or c).

      --
      Marxist evolution is just N generations away!
    44. Re:Oh my sweet Jesus... by E_elven · · Score: 1

      One of the distinctions between high-level and low-level languages is understandability. Perl looks like Assembler without indentation.

      --
      Marxist evolution is just N generations away!
    45. Re:Oh my sweet Jesus... by eyeye · · Score: 0, Flamebait

      Do you look at C++ and say "OMG so many options, look there are curly brackets and square brackets and cin and cout and vectors and ++ and != operators and so much more I give up! ".

      Yes there is a lot to perl if you look at it all expressed in the form linked in the article, but other languages would look similarly complex if laid out like that.

      As for my superior posting, it was as it actually contained some content. Look at the other persons reply - they made a good point instead of your backwards whining.

      --
      Bush and Blair ate my sig!
    46. Re:Oh my sweet Jesus... by eyeye · · Score: 1

      There is the problem with Perl, lots of people start to learn it and as soon as they can get something to run they think they have mastered it.

      Then they look at someone elses code and realise they actually know bugger all.

      The "problem" is that perl is very forgiving and caters to newbies by having easily accessible features while also catering to experts. Then when the clueless look at decent code their little minds boggle and they start despise perl because it makes them feel stupid.

      --
      Bush and Blair ate my sig!
    47. Re:Oh my sweet Jesus... by btlzu2 · · Score: 1

      C++ is atrociously sloppy as well. Operator overloading is atrocious and easily abusable. Strongly typed languages, no operator overloading is a much more sensible way to go. I'm not overwhelmed by the amount of operators, I'm disappointed in them.

      Sure Perl can hack out some good scripts, but so can a bash shell. The tasks I have to perform are either suited to a shell script (rather than Perl because Perl's a mess) or a full on application in Java or C.

      A scripting language, IMO, should be able to uphold strong-typing philosophy without making it too difficult to use. More maintainable and readable code should always be a primary goal of a language in my opinion.

      they made a good point instead of your backwards whining.
      If you can't handle my opinions, don't post. If you want to discuss like an adult, refrain from the insults, ok? Frankly, your attitude almost makes me not even bother discussing with you--it detracts from anything sensible you might be saying. This is just friendly advice, not trying to cut you down.

      --
      Zed's dead baby. Zed's dead.
    48. Re:Oh my sweet Jesus... by Jerf · · Score: 1, Informative

      Stronger typing does not automatically solve this particular issue. Look at, for example, C.

      C is not strongly typed. It pretends it is but it isn't.

      So yes, certain applications of strong typing lead to a potential way to trick the language into allowing you to perform the two different operations of string and numeric comparison with only a single operator.

      This, almost by defition, is bypassing the type system. Here there be dragons....

      However you have unfortunately in doing so introduced ambiguity into your definition of equality. ...yep, there's one of them.

      Perl gets this by default because it has the exact ambiguity you describe. Which side are you arguing for again?

      However this then brings up the question of what happens if for some reason you want to do a numeric compare between two string objects. You have to somehow do a conversion to a different object type. Perhaps this is a bit clumsy.

      Of course it's clumsy, it's a clumsy thing to want to do. The only language I know where conversion is something worth calling "clumsy" is Java. (Java is a damned clumsy language and is not a good one to study to learn about good syntax.) In most of the ones I can think of it's as simple as "int(a) == int(b)". You also get type protection if "a" isn't actually an "int" at all. Perl silently coerces "oiewjgew" into 0.

      I think this is a good one: there are already far too many situations where an operator or function in Perl behaves in different ways depending on minor details of the context, we do not need another.

      No, this is another. If you use == on a number, it works correctly. If you use it on a string, it first silently coerces it to a number. That's different behavior.

      You need to expand your language horizons. For one thing, I'm not attacking Perl, I'm explaining it. If it looks like an attack, it's your lack of understanding of my explanation, not an attack. Perl will give you a very fuzzy idea of what "typing" is. It's OK for the language, but it hasn't helped you understand what "typing" is when other people talk about it. I recommend Haskell or OCaml. (Python might be OK too, but that's probably still not the best place to learn about typing.)

      Perl is almost unique among the "real" languages for this peculiar context-sensitivity of strings vs. numbers, for good or for ill. As a result, as good as it can be to use sometimes, it's a really, really bad place to try to learn programming concepts. (Of course, that's typically true somewhere for any language, which is why expanding your horizons is necessary.)

    49. Re:Oh my sweet Jesus... by eyeye · · Score: 0, Flamebait
      Still looking for your point here..
      You don't like perl because it isn't strongly typed is all I can see you saying.apart from your factless "perl is a mess" whine.

      Anyway back on topic, are you still scared of operators. you say in your trollish first post to this topic.

      Look at all of those operators!!!!

      Which in particular scares you, '!=' or is it the terrifying '==' or is it containing code within curly braces,>=?. I can help you if you want, * means multiply, / means divide. Square brackets are for arrays.

      Do you get the point, most of the operators in that table are familiar to most programmers. (or at least to programmers who are willing to open their eyes and read).

      The vast majority of those operators also already exist in perl which since you say " This cannot mean good things for Perl. Look at all of those operators!!!!" can only mean you dont know much or anything about perl currently except you dont like it.

      --
      Bush and Blair ate my sig!
    50. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      bullshit.
      you just couldn't understand what the parent poster said.
      try again.

      oh, and i'm your friend, i'm not trying to bash you, just to help.

    51. Re:Oh my sweet Jesus... by btlzu2 · · Score: 1

      Dude, my point is there are over 140 operators (I lost count on that periodic table) in Perl and approximately 48 in Java. And which is the cleaner, more concise, and more powerful language? I didn't think I'd have to count them for you to make my point, but you're too busy being a dick.

      Have a nice day.

      --
      Zed's dead baby. Zed's dead.
    52. Re:Oh my sweet Jesus... by jsebrech · · Score: 1

      Stronger typing does not automatically solve this particular issue. Look at, for example, C. It uses == for numeric compare and strcmp() for string compare. Strong typing does not help here; ==, as in perl, means only one thing, and that one thing is "compare two numbers".

      C is NOT strongly typed. Strong typing means the type of any variable once declared can not change, and the variable can only be treated as that type. C's implicit conversion rules, and concepts like unions and casting, allow you to treat any type as any other, and additionally there is no runtime enforcement of types, because compiled C code only knows bytes, and has no run-time type information whatsoever.

      Besides, even at compile time C doesn't really understand the concept of string. It understands arrays of char, and comes with a library that pretends those are strings, but it all falls down when you do stuff that can't be represented in a single char/byte, which is why there have been so many attempts to upgrade C to deal with more than regular english. C was just never designed to deal with strings on anything than the most rudimentary level.

      However this then brings up the question of what happens if for some reason you want to do a numeric compare between two string objects. You have to somehow do a conversion to a different object type. Perhaps this is a bit clumsy.

      What is clumsy about that? If you can compare the two types in a sane way, C++ will do it, if you can't, it won't. If you want to compare types that can't really be compared, you're required to convert one. How is that a bad/clumsy thing?

    53. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      Hello? We're talking Perl 6 here. It hasn't even been released yet.

      Duh?

    54. Re:Oh my sweet Jesus... by Mr.+Piddle · · Score: 1

      Rejecting convenience because someday you may have to work without said convenience does not seem to me to be a logical behavior.

      It is logical. How much trouble does Microsoft's "convenience" need to cause before people learn to not execute their e-mail attachments? Bash's "export VAR = value" syntax is convenient, but it is broken on all genuine Bourne shells (e.g., most UNIX). Configure scripts are convenient, but they break very badly when they break making debugging near impossible. Auto-completion for text is convenient for some people who can't type so they never need to learn how. It is just a matter of debate where convenience ends and luxury begins, and my argument is that mixing floating point and integer types in equality expressions is just a luxury that leads to a compacency that can haunt future debugging efforts. Quite honestly, I think programming languages stopped evolving in usefulness and productivity once garbage collection became popular (memory management is by far the worst problem in C). Beyond getting rid of assembly coding and the advent of garbage collection, most everything else has been incremental improvements rather than true leaps forward.

      --
      Vote in November. You won't regret it.
    55. Re:Oh my sweet Jesus... by friedo · · Score: 2
      Oh, come now. If you were a real perl programmer you would have written

      perl -le 'print "true" if 2.9999999999999999 == 3.0'

      :)

    56. Re:Oh my sweet Jesus... by eidechse · · Score: 1

      The distiction beteween weak and dynamic typing often gets lost during the firefight...

      To put it succinctly:

      Weak Typing: Lots of implicit conversion. Variables can automatically be treated as if they were some other type.

      Dynamic Typing: Type checking is put off until run-time. Errors are often expressed via exceptions.

      The Strong/Weak characteristics of a typing system are unrelated to it's Static/Dynamic charcteristics. You can have languages that are Strong/Static (e.g. C++), Strong/Dynamic (e.g. Python), Weak/Static (e.g. C), and Weak/Dynamic (e.g. Perl).

    57. Re:Oh my sweet Jesus... by Mr.+Piddle · · Score: 1

      on my computer 16 9s will suffice whereas in reality you would need an infinite number of 9s

      Yes, but is that number of nines variable from architecture to architecture or is the epsilon "fudge factor" built into Perl defined in the language's specification? I know this is nit-picking, but these are questions that wouldn't have to be asked in C or Java.

      --
      Vote in November. You won't regret it.
    58. Re:Oh my sweet Jesus... by hazem · · Score: 2, Funny

      You obviously never studied mathematics, 3 and 2.999... are exactly the same.

      I thought that was engineering:

      pi =3
      g=10m/s^2

      or at least close enough for government work.

    59. Re:Oh my sweet Jesus... by Mr.+Piddle · · Score: 1

      ...no-one has repeated that particular mistake since.

      Then this thread of discussion must have never happened, either...

      --
      Vote in November. You won't regret it.
    60. Re:Oh my sweet Jesus... by Finuvir · · Score: 2, Funny

      I was able to gauge my progress through school and college based on the number of significant digits in g. "g is 10", "g is 9.8m/s", "g is 9.81ms^-1", "screw g; you want G!", "G? This is General Relativity!"

      --
      Why is anything anything?
    61. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      Other strongly typed languages include Python, Smalltalk, Lisp, ...

    62. Re:Oh my sweet Jesus... by gorre · · Score: 1

      I've been found out, I'm an imposter. *blush*
      Larry, please forgive me!

      --
      "Madness is something rare in individuals - but in groups, parties, peoples, ages it is the rule." -- Nietzsche
    63. Re:Oh my sweet Jesus... by Maserati · · Score: 1

      3 > 2.999... ?

      What about that one ?

      --
      Veteran, Bermuda Triangle Expeditionary Force, 1992-1951
    64. Re:Oh my sweet Jesus... by el-spectre · · Score: 1

      And? So, given a variety of tools, you code to a certain standard within your organization, and everything is fine.

      It's not like having many colors of paint prevents you from making a nice painting, is it?

      If you don't like how the language works, don't use it. Simple as that. A couple million of us DO and will continue to.

      --
      "Faith: Belief without evidence in what is told by one who speaks without knowledge, of things without parallel." - A.B.
    65. Re:Oh my sweet Jesus... by Waffle+Iron · · Score: 2, Insightful
      Hello? We're talking Perl 6 here. It hasn't even been released yet.

      No, OP was expounding on the virtues of Perl 5 vs. other existing languages: "Part of the reason why Perl is so good is that it makes development fast and easy.". Note that it did not say: "will make it fast and easy if and when it is ever released".

    66. Re:Oh my sweet Jesus... by gorre · · Score: 1

      No, if that were true what is the number between 3 and 2.999...?
      Remember that in between any two different reals there are an infinite number of numbers.

      Anyway the proof is simple:
      2.999... = x
      call that equation (1), then multiply both sides by 10
      29.99... = 10x
      and we'll call that (2), now substract (1) from (2) and we have
      29.999... - 2.99... = 10x - x
      ie 27 = 9x
      now simply divide both sides by 9 and we get x = 3

      IIRC there is also a relatively simple proof involving Cauchy sequences.

      --
      "Madness is something rare in individuals - but in groups, parties, peoples, ages it is the rule." -- Nietzsche
    67. Re:Oh my sweet Jesus... by pyrrhonist · · Score: 1
      Perl looks like Assembler without indentation.

      It also has an uncanny resemblance to line noise.

      I can't even post the example that I wanted to post to show this, because it doesn't get past the lamness filter.

      Reason: Please use fewer 'junk' characters.

      Aaaaarrrrggghhh!!!

      --
      Show me on the doll where his noodly appendage touched you.
    68. Re:Oh my sweet Jesus... by certsoft · · Score: 1
      I originally learned programming (formally) with Pascal. We were taught to increment a loop variable with a:=a+1;

      Most Pascal/Object Pascal programmers would use inc(a); which isn't quite as short as a++; but not too bad.

    69. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      You, my friend, sound like a prime candidate for Ruby..

      Ruby has first-class regular expressions, and is very concise and clear (for instance, do you want to define "+" for your class? No need for "def __add__(o):", just "def +(o)".. ) but it is fully orthongal and object-oriented, more so than Python.

      I too used Python a lot but couldn't figure out why so many people thought it was "elegant". Perl is just too confusing, Python is too .. Pythonic (verbose, doesn't use enough punctuation to separate variables from operations, arbitrary design choices, bloated library), but Ruby is just right.

      Ruby is the way.

    70. Re:Oh my sweet Jesus... by Vlad_the_Inhaler · · Score: 1

      nah - what I meant was that no-one since has implemented '=' as meaning 'nearly, but not necessarily exactly =' in a language.

      --
      Mielipiteet omiani - Opinions personal, facts suspect.
    71. Re:Oh my sweet Jesus... by blacksmith · · Score: 1

      Why wouldn't you have to ask that in C? The precision of a float or double isn't defined anywhere in the ANSI spec.

      I assume this is specified in Java though.

    72. Re:Oh my sweet Jesus... by gorre · · Score: 1
      Well I almost forgot to mention that when I say there is no number between 3 and 2.999... I mean there is no real number between 3 and 2.999.... From Rudy Rucker's book Infinity and the Mind:
      Formally speaking, it is as consistent to say that there is a number between all of .9,.99,.999,... and 1 as it is to say that there is a number greater than all of 1,2,3,.... And just as we go on to find more and more ordinals piled atop one another, we can go on to find more and more infinitesimals squeezed beneath each other.
      --
      "Madness is something rare in individuals - but in groups, parties, peoples, ages it is the rule." -- Nietzsche
    73. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      Am I the only one who thinks list comprehensions are hard to read? Generally Python needs more punctuation to make things "jump out":

      [foo for foo in bar]

      It takes my brain about a second to parse that. If it was more like Haskell:

      [x | x <- bar]

      my eyes could pick it out immediately.

      Python is just too homogeneous. Like LISP without the parentheses (not that Python is otherwise anything like Lisp, regardless of all the people who say it is "Lisp-like").

    74. Re:Oh my sweet Jesus... by Ugmo · · Score: 1

      Well, this was in an academic setting with generic pascal. I did not know enough then and remember less now, but two things would have been wrong with inc(a), at least according to me teachers at that time ( over 10 years ago).

      It is not as clear unless you are familiar with inc() what inc() does. a: = a+1; tells you exacly what is going on.

      This lack of clarity arguement is the same that people use against Perl. Of course if you can't understand what inc() is doing, maybe you should not be programming. Similiar things arre said about obscure Perlisms..; if you can't understand them you shouldn't call yourself a programmer.

      The other arguement is that if inc() is a call to a function then you have the overhead that involves. Of course, that is only if inc() is not part of the core language. I am not sure if it is.

      If it is, then the difference between inc() and a++ is just syntax. In effect, Pascal has the same operator. Why not give Pascal all the operators of Perl then?

      Like I was saying, you end up inventing the stuff that is already in Perl (if you are clever). If it is not part of the language spec then you just have to re-invent it at some other time or do it in a round about way. I think it is good to learn what Perl is trying to do even if you do not use it. It may help when programming in other languages.

      (e.g. I learned how useful the shift operators are from Perl and sometimes use it in other languages).

    75. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      Correct me if I'm wrong, but isn't that pretty onerous to have a huge chart of possible operators for a language?

      Never study Haskell. You can have user defined operators. And no, I don't mean overloaded. You can define new ones. Waht a %^+ operator? You got it.

    76. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      Option 3 just sounds like a pain, although I guess some languages do it that way, e.g., I think in OCaml there are separate operators for multiplying integers and multiplying floating point numbers.

      That's right: 2 + 2, 2.0 +. 2.0. 2 +. 2 is a type error, so is 2 + 2.0. It sounds clumsy, but before long you realise that the number of situations where you actually want to be mixing integers and floats is, well, rather limited. They're totally different beasts, for crying out loud! You can't even guarantee that (some_float + some_int - some_int == some_float). If you're interested in your code working, you stick to one datatype at a time.

      However, OCaml does provide generic equality operators. The basic = > = set have different implementations for different data types (your option 2, but it doesn't actually cause subtle bugs like you say because you don't ever start expecting stupid behaviours like "3.0" meaning the same as 3), and then you have == != for physical equality.

      I guess it's about as far from perl as you can get while still being a programming language, really...

    77. Re:Oh my sweet Jesus... by btlzu2 · · Score: 2, Insightful

      It's not like having many colors of paint prevents you from making a nice painting, is it?
      I'm afraid coding and painting are not even CLOSE to being analogous. Having unnecessary operators and sloppy constructs does NOT make you more expressive in a coding sense. If that were the case, why can I do everything Perl can, and most likely more, in Java than in Perl when Perl has over 140 operators and Java has only 48? Expressiveness is in the algorithms and the approach to a problem, not how many or what type of operators I can have.

      The problem a LOT of us have with Perl is that it is a very sloppy, unmaintainable language. You've got tons of people whipping up utter crap in Perl and then when they leave, programmers who use better languages are stuck wading through that garbage to re-write or maintain it. It's happened to me numerous times. I'm quite sick of Perl and the 5,000 ways people write the same scripts.

      A couple million of us DO and will continue to.
      Great. More work for me when your code falls apart and you can't add simple functionality because of fragile spaghetti code. ;)

      --
      Zed's dead baby. Zed's dead.
    78. Re:Oh my sweet Jesus... by This+Is+Ridiculous · · Score: 1
      Er...
      sub postfix:^_^ (Bool $operand) is looser(&infix:or) {
      $operand or die "Statement is unhappy: $!";
      }
      my $fh=open "$filename" ^_^;
      Yes, that really is perfectly valid Perl 6, and it pretty much does exactly what you think it does. (The 'is looser' specifies the precedence--my new ^_^ operator has a slightly lower precedence than 'or', but a higher one than the next built-in level of precedence.)
      --
      Hey, you try to find an open nick these days!
    79. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      No, C is strongly typed.

      The mistake he did what to assume that char* is the type of a string, but it isn't, it is the type of a pointer to a string, and == compares the two pointers correctly.

      C has simply no primitive string type.

    80. Re:Oh my sweet Jesus... by el-spectre · · Score: 1

      Ah, see, we have a difference in approach. You believe that there is One-True-Way to code, and I do not.

      This is actually a design philosophy difference that is intentionally built into Perl, and one of the reasons we like it.

      --
      "Faith: Belief without evidence in what is told by one who speaks without knowledge, of things without parallel." - A.B.
    81. Re:Oh my sweet Jesus... by Frodo+Looijaard · · Score: 1

      Unless you have a really weird internal floating point representation in your favorite language, 3.0 should always be equal to 3 (3.0 can be represented exactly in IEEE-like formats). So no need to unlearn this habit...

    82. Re:Oh my sweet Jesus... by btlzu2 · · Score: 1

      Not really a different approach. There are some fundamentally defined tenants of good programming however and they include strong typing for one. In order to advance Software Engineering, approaches to good design have to be codified. Things like fragility, rigidity, and immobility run rampant in Perl. A good analogy would be you defending the ability to make a house out of mud and sticks instead of brick and aluminum. It's not that you can't make the house out of sticks because you have the philosophy that sticks are an expression of your artistic side, but do you want to live in that house?

      If you're at all interested, this is one of the better articles on the subject--it's a really enlightening and interesting read for code writers! It's imperative for the software-writing "industry" to improve its practices, IMO (well, and others) and form a stronger discipline. Touchy-feely-I-have-the-right-to-write-unsafe-slop py-stuff doesn't necessarily make for good design!

      --
      Zed's dead baby. Zed's dead.
    83. Re:Oh my sweet Jesus... by certsoft · · Score: 1
      Well, this was in an academic setting with generic pascal

      By "generic" you probably mean Jenson and Wirth, which nobody actually uses for anything useful.

      It is not as clear unless you are familiar with inc() what inc() does

      Of course the same thing could be said about "writeln" :)

      The other arguement is that if inc() is a call to a function then you have the overhead that involves

      Inc is built into the language, it will generate the same code as a := a + 1; or as a C compiler generates for a++; given the same competency level of the compiler writer.

      Why not give Pascal all the operators of Perl then?

      That's one of the things I like about Pascal versus many other languages (including C and it's spawns), the lack of a million and one punctuation mark combinations.

    84. Re:Oh my sweet Jesus... by el-spectre · · Score: 1

      If I also added that OOP isn't always the best approach, will I be further lectured?

      --
      "Faith: Belief without evidence in what is told by one who speaks without knowledge, of things without parallel." - A.B.
    85. Re:Oh my sweet Jesus... by Teancum · · Score: 1

      Inc() is an inline function, which means it is just as efficient as an operator in terms of a compiled code perspective. You don't have to worry about function call overhead if you use it in this fashion. BTW, if you use x := x + 1 using Turbo Pascal (or Delphi), it optimizes to be the same thing as Inc(x), because the optimizer does pick out stuff like that and reduce it to a simple increment instruction in the assembly code.

      Object Pascal (as defined by Borland) offers a few shortcuts that C programmers usually take for granted but if you use "Standard Pascal" you really can't live without. Things like strings (not a part of standard Pascal), or being able to call a function without having the function be assigned to a variable (IMHO a "bug" in the Pascal definition that I'm glad Borland got rid of).

    86. Re:Oh my sweet Jesus... by btlzu2 · · Score: 1

      Sorry, I thought we were having a good discussion. I just thought this was interesting.

      --
      Zed's dead baby. Zed's dead.
    87. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 1, Informative

      Programming languages are a fairly miserable place to learn about type theory. A rigorous study of mathematics (computer science is not really a science, but rather just a collection of fields of mathematics) is far more useful for understanding the theory of types.

      Although I have to confess there is something sort of amusing about ML coming up in a discussion about the plethora of operators in Perl, as there are an arbitrary number of operators in ML.

      There is nothing especially novel about Perl's type conversion semantics. Let's just say that in a language X we have types S and T, and the semantics of X say that for any operator x : S -> 'a, if a morphism f : T -> S exists and has been designated then any context where x is applied to an instance t of type T, x will be applied to the application of f to t automatically.

      We'll just call this your typical type-safe cast with implicit coercion. These are said to be type-safe because the operations are well-defined (you've defined how to construct an instance of T from an instance of S).

      Now Perl has four scalar types, even though Perl pretends its basic types are scalars, arrays, and associative arrays. The four scalar types are integers, floats, strings, and references. It also has something sort of like a pseudo type class which we'll call reals, for which int and float are instances.
      Perl defines a number of implicit morphisms between members of its scalar context, which I'll just give some examples with made-up names: str_to_real : String -> Real
      str_to_int : String -> Integer
      str_to_float : String -> Float
      int_to_float : Int -> Float
      real_to_str : Real -> String ...

      Some binary operators:
      - : Real -> Real -> Real
      . : String -> String -> String ...

      So when writing 'Dog' - 'Cat' the programmer acknowledges that they are writing str_to_real('Dog') - str_to_real('Cat'), which in turn will in turn call str_to_(float | int). In which this case the mapping of from a string that does not fit one of the handful of patterns for encoding reals as strings is to zero. So we have 0 - 0 => 0.

      This sort of behavior may be considered stupid (in that it can result in all sorts of bugs), but it is a well-defined type-safe conversion. It's not isomorphic, but that's neither here nor there.

      Now removing automatic casts doesn't necessarily reduce the number of required operators. ML is a good example of this. In order to not require type annotations (and to avoid intractable type inference from not mandating annotations) you end up with (in the case of O'Caml--Standard ML has a few exceptions that are special-cases that sometimes make polymorphism more verbose as a result) different operators with different names for any type which you want to perform the logical operation on. +, +., +*, or you get to operate with modules (Yeah! That'll be intuitive for the average person on Slashdot). Haskell improves on this with the notion of type classes, but it can't deal with using the same operator in disjoint type classes.

      So back to Perl. Is Perl's operator bloat the result of implicit type casting? Well not really. Its problem is that it doesn't allow operator overloading, so it relies on a stupid, limited number of implicit type casts to obtain the behavior it desires. 'Dog' + 'Cat' => 0, because I can't and Perl doesn't define an operator + : String -> String -> String, and without rigorous exceptions it might be a real hassle (look at me make excuses for them!) for their implicit conversions to do anything valuable. Now operator overloading with multi-dispatch or mono-dispatch with type-safe coercion or reflection and exceptions, you'd have no problems expressing many logically-similar operations using the same operator symbol with disjoint types without as many problems. Python, Smalltalk, Common Lisp, Dylan, C++, ... all can manage to reuse a handful of operators without the sky imploding.

      Perl is just a crappy language with bad semantics.

    88. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      C is not a strongly-typed language, but strong typing has nothing to do with binding declarations. Type-safe type casts either implicit or explicit do not weaken typing. They're well-defined morphisms between two types.

    89. Re:Oh my sweet Jesus... by chromatic · · Score: 1
      There are some fundamentally defined tenants of good programming however and they include strong typing for one.

      I think Lisp hackers might well disagree, along with people who program Python and Ruby and, if they're honest, C, C++, Java, and C#. See ManifestTyping on the C2 Wiki for a fuller discussion.

      I have seen bad code in Perl, but I've seen it in many, many other languages. Perhaps a more interesting question is "Does Perl encourage sloppy programming or does it allow people who aren't concerned about so-called software-engineering to do productive things?"

    90. Re:Oh my sweet Jesus... by Mr.+Piddle · · Score: 1

      (3.0 can be represented exactly in IEEE-like formats)

      This isn't the point, rather the problem is using the equality operator for comparing floating point numbers. The odds that a floating point variable would actually be exactly equal to an integer are pretty low, in general.

      --
      Vote in November. You won't regret it.
    91. Re:Oh my sweet Jesus... by Mr.+Piddle · · Score: 1

      The precision of a float or double isn't defined anywhere in the ANSI spec.

      I assume this is specified in Java though.


      Java is very thorough in specifying the precision for its types. C is not, but the question above was regarding the "epsilon" that Perl uses for fudging equality. In C, it is still bad practice to use "==" for floating point numbers.

      --
      Vote in November. You won't regret it.
    92. Re:Oh my sweet Jesus... by btlzu2 · · Score: 2, Interesting
      Does Perl encourage sloppy programming or does it allow people who aren't concerned about so-called software-engineering to do productive things?"

      You have a good point there and perhaps it's true as far as doing productive things. It breaks when you have to do productive things along with other people and maintain it for future expansion.

      I do think, and this is down to opinion I suppose, that it *does* encourage sloppy programming because fundamental typing is nowhere to be seen. Use this variable over here for one thing, clobber it over there to use it for another. I read on that article you referenced and pretty much got confused by the differing opinions and corrections. Wiki is a pain in the butt to read! :) Here's my view, which I stole from the Java Language Overview on Sun's site:
      One of the advantages of a strongly typed language (like C++) is that it allows extensive compile-time checking so bugs can be found early. Unfortunately, C++ inherits a number of loopholes in compile-time checking from C, which is relatively lax (particularly method/procedure declarations). In Java, we require declarations and do not support C-style implicit declarations.
      Sure, you can write horrible code in Java too--I've done it--but at least it supports a more reasonable structure (interfaces, strong typing). There is no silver bullet language, I realize that, but to me Perl is pretty scary to rely on for nearly any task as I've found going back to maintain old Perl code from various sources.

      I think it boils down to opinion, but mine is very strongly opposed to using Perl as a serious language for anything. If they redesigned Perl completely, cut back 50% on the cruft and structured it more reasonably, I'd not have as much of a problem; however, they're adding more operators and it's remaining weakly typed, so I have no hope.
      --
      Zed's dead baby. Zed's dead.
    93. Re:Oh my sweet Jesus... by ralphbecket · · Score: 1


      Stronger typing does not automatically solve this particular issue. Look at, for example, C.


      Ha ha ha ha ha!

    94. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      If you're at all interested, this is one of the better articles on the subject--it's a really enlightening and interesting read for code writers!

      This is the universal cry from Java and Python loyalists "limiting choice is good for design" what happens when some language comes along with fewer operators than Java currently has (but then, like Java and Python builds some of that functionality back using bloated libraries) and starts screaming about how people can write sloppy code in Java because there are too many operators.

      Java's version of "there's more than one way to do it" doesn't exist at the operator level, it exists at the object and method levels where things can be obfuscated albeit more verbosely and in 10x more lines of code than in perl.

      BTW, all the EJB based Java systems I have had to deal with suffer all the rotting design problems and only a small percentage of the perl systems I have dealt with have had them as bad, so discipline, limitations, design patterns, strong typing and "safety" seem to have done exactly jack to acheive the goals of "good design".

      Programming Language Fascism seems to have some of the same problems as regular Fascism - person freedom = "bad for society". The industry (and OO even more so) seems desperate to try to find a shortcut where there is none. Lets simplify, codify and limit choices to try to idiot-proof the process of software development - its not working - we have lots of people who claim competence in a badly designed language and its horribly designed library interfaces (JDBC) but are not (see the old /. story on Java competence claims vs reality) and project for project things aren't significantly better for all the structure, money and design patterns thrown at them.

      The mods will damn me but: MS seems to have gotten the idiot-proofing down better with their C#, IDEs and .NET stuff than Java et al has. In my experience a smaller group of "developers" can get X functionality out of a .NET system than a larger group can get out of a Weblogic system. Of course, one perl or ruby programmer can often get that same X functionality is a shorter time than either, but that would be an unfair comparison.

    95. Re:Oh my sweet Jesus... by boots@work · · Score: 1

      No, if that were true what is the number between 3 and 2.999...?

      I think part of the definition of the real number field is that for any x, y there is a value z s.t. x 29.999... - 2.99... = 10x - x

      I don't think you can just sling around infinitessimals like that without treading close to a division-by-zero fallacy. It's been too long since I did serious math for me to be able to prove it.

      I think all you have proved is that the limit of 2.9999... is 3, which is obvious.

      IIRC there is also a relatively simple proof involving Cauchy sequences.

      But it won't fit in this margin? :)

    96. Re:Oh my sweet Jesus... by btlzu2 · · Score: 1

      I never get this AC replying thing when they have interesting points to discuss, but oh well, I'll try even though I don't usually respond to ACs.

      Your whole post characterized the goal of structuring and codifying knowledge in software engineering as some sort of pseudo-political repression! That is so far from the case if you understand what engineering is all about. "Limiting choice is good for design" is your spin on "Following certain principles found to be efficient will improve code quality."

      only a small percentage of the perl systems I have dealt with have had them as bad, so discipline, limitations, design patterns, strong typing and "safety" seem to have done exactly jack to acheive the goals of "good design".

      I find this anecdotal "evidence" to be HIGHLY suspicious and, frankly, I don't believe you. It's almost laughable to say that maintaining similar code in Perl has less problems. You can write rotting code in Java and you WILL write rotting code in Perl unless you're very clever. Java makes it easier to write flexible code without quite being as clever.

      Programming Language Fascism
      Get over yourself sir/madam. There's a reason the industry is trying to codify knowledge. It's called growth. Every industry does so. If you don't, you won't grow and software systems will remain inherently buggy and flawed.

      I have read good things about C# and how they fixed problems found in Java (especially kludges like marker interfaces and generics). Too bad it's a MS proprietary language--even though I hear work is being done to open it--I'll believe it when I see it in extensive use and the same quality as the MS version.

      --
      Zed's dead baby. Zed's dead.
    97. Re:Oh my sweet Jesus... by Eravnrekaree · · Score: 1

      Yes, I certianly agree. Perls operator set, is not confusing to me at all and it is easy to learn them. The way the chart is laid out makes it look overly confusing but any good book or good documentation will show that it is very easy to grasp. I really dont see Perls features as causing bad code or making it hard to read. I really believe that can just as easily happen in many other languages. Perl provides a lot more freedom than other languages, but I believe this does not mean that it is eisier to write bad code. For me, Perl is actually much eisier to understand, read and write than say C++. This honestly partly might be because I dont use C++, so I am not as used to it. People, when they see a language which is different from what they arent used to, suddenly think that it must be bad. Note that I said, 'for me',
      people are often different and have different tastes. Perl is different but that does not make it bad. Its operator set is really ideal at least to me and it is easy for me to learn and use. The idea that you for instance use eq for string comparison and == for numeric comparison is easy to grasp. As far as typing, I dont think perls loose typing really creates problems even in large projects, I havent seen it. Really, good coding style guidelines is what is needed in any language. Personally, generally I think Perls freedom and the choices it gives for how to do things make it eisier to read and write rather than more difficult. If people want a language that is highly restrictive, there are many other ones out there to do that. Please use them if thats what you want. Just because a language is different and doesnt fit my taste doesnt mean I demand that those langauges be changed to how I think they should be, I am glad that their are people who like using them. And I am glad I am able to use Perl, becuase it is most useable for me. I think we should continue to have our Perl as a language of freedom and choice, as it is, as those who appreciate it have come to benefit from the freedom, choice, and useability that it is gives, and the people who want restrictive languages should be able to have their other languages that do that.

    98. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      Stronger typing does not automatically solve this particular issue. Look at, for example, C. It uses == for numeric compare and strcmp() for string compare. Strong typing does not help here; ==, as in perl, means only one thing, and that one thing is "compare two numbers".

      C does not have a string type.

      "char *foo" delcares foo to be a pointer to a char, not a string. Convention says it points to an ASCIIZ string, not the language spec.

      And, you can compare two pointers. As long as you meant to compare pointers, you're also doing it meaningfully: == will be true when the two pointers are equal.

      But don't fall into the trap of thinking C has a string type of any kind.

    99. Re:Oh my sweet Jesus... by mcc · · Score: 1

      == compares the two pointers correctly.

      And pointers are represented as ints. Which is what I said, which is that all == can do is compare numbers.

    100. Re:Oh my sweet Jesus... by bigdavex · · Score: 1

      I was able to gauge my progress through school and college based on the number of significant digits in g. "g is 10", "g is 9.8m/s", "g is 9.81ms^-1", "screw g; you want G!", "G? This is General Relativity!"


      Apparently you skipped the stage when you considered g to be 9.8/ms^-2 instead.

      --
      -Dave
    101. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      but strong typing has nothing to do with binding declarations.

      What does have to do with it then?

    102. Re:Oh my sweet Jesus... by gwalla · · Score: 1
      For example, throughout the language the question mark is used for boolean operations, plus for numeric ops, and tilde for string ops. (The tilde is supposed to remind you of a little piece of string.)

      Don't get too attached to that. It looks like one of the changes for Perl 6 is tilde being redefined as the xor operator.
      --
      Oper on the Nightstar
    103. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      Wrong. Good programmers understand how their environment treats numerical values. In Perl(and several other languages) 3 and 3.0 are treated identically. There is nothing wrong with comparing them. Also, based on your comments in this thread it seems clear that you don't know what you are talking about. Go read this, and the other reading material referenced here. If you don't want to, or can't, read and understand that material then please quit spouting off and spreading your misconceptions to others.

    104. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      Not really a rebuttal, just some random thoughts...
      the goal of structuring and codifying knowledge in software engineering as some sort of pseudo-political repression!
      If you think that choice of language or development "paradigm" are not political topics within the world of software development then you are either being naive or disingenuous. I don't think that the P&P pdf that you reference is a pure pursuit of software engineering advancement. It is also to advance their OO views.

      Following certain principles found to be efficient will improve code quality.
      Not universally, maybe creating rules that play to the lowest common denominator works for beginners - you wouldn't give a student pilot an F-18, U-2 or 777 to start with and you wouldn't have someone learn to ride a motorcycle starting with a Hyabusa. But for those experienced in the art, a more expressive, subtle and powerful language is not necessarily a bad thing.
      Even if some Universal Software Engineering Truths are discovered, why would those have to be enforced by the language, why not a company or project level "lint"-like enforcement checker.

      You can write rotting code in Java and you WILL write rotting code in Perl
      Why because it is weakly/dynamically typed? Because you can use more than one language construct to do the same thing? Any discovery and codification of good practices can be fairly language independent.

      It's almost laughable to say that maintaining similar code in Perl has less problems.
      Actually, several places I've been (Banks, large million hits per day + websites) we wrote all the hard data cleaning/transforming and movement stuff in perl and the easy display the pre-digested bits on the web parts in Java and yes still the Java was more fragile, sorry. I suspect many places do things similarly as far as the work load division between languages. At the implemented platform level, I am constantly amazed at the perl language and the interpreter, it takes on anything and everything and still keeps running. On the other hand, I find the Java VM's tend to be fragile and crashing or hanging more frequently than my long running perl processes/daemons.
      In many ways one could constrain perl to act more like Java if those constrained characteristics are found desirable for a given project, however one cannot "unleash" Java to act more perl like - and I am sure most Java devotees like it that way...

      There's a reason the industry is trying to codify knowledge. It's called growth. Every industry does so.
      Right and as those arts/fields grow, the languages and vocabularies they use become more robust, powerful, subtle and rich. Not more rigid and structurally stiff. Math comes to mind, many languages developed over time to be able to express new concepts. Are there similarities between current OO oriented software engineering thinking and Principia Mathematica, I think so. Yes, Larry Wall would probably like that - Perl as the programming equivalent to Godel's Incompleteness Theorem... Along the same lines, I see strongly typed languages like Newtonian Universe and perl and more freaky languages as the Relativistic Universe. Strongly typed languages have their place but I can't imagine all other typing styles falling by the wayside. What will happen when OO falls from prominence (that Aspect Oriented crap isn't going to prop it up forever), what kind of thinking will replace it more structured or less - I think it will be less.

      BTW, I have an account and subscription, get mod points regularly and M2 less frequently but I usually post as AC, I don't see much difference.

    105. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      Pointers were ints in B and BCPL, but not in C. All integers may be compared and subtracted, but pointers cannot unless they point into the same struct or array (this was to accommodate segmented architectures). In fact there may be no integer type that can store a pointer--if pointers are implemented in separate registers, the compiler has to be able to use both even if they can't mix.

    106. Re:Oh my sweet Jesus... by Finuvir · · Score: 1

      Is there any way I can weasel out of this without looking stupid? No? Oh well, carry on with my ridicule, I've earned it.

      --
      Why is anything anything?
    107. Re:Oh my sweet Jesus... by btlzu2 · · Score: 1

      The reason why I don't dig responding to ACs is because a) they're usually miserable cretins who are emboldened by their anonymity b) they're usually trolls c) it's not fair for the AC to "know who I am" and I can't see "who they are"--whether past posts have been reasonable or trolls, etc.

      After reading some of your reply, I tend to think IHBT since the things you say are so beyond the reason and the experiences I've encountered as well as those of people I know in the computer industry. Either that, or you've truly had a vastly different set of experiences that seem to go against all common sense.

      I have written numerous modules in Perl and have found so many stability issues it's ridiculous. I have boiled down the problems to bugs in the Perl interpreter and libraries themselves. I even submitted a couple of bug reports, one in the IO.pm. I didn't wait around for a fix (although it is now). That is why I ported our production servers over to Tomcat instead of a CGI based web server. Years of buggy problems gone. Loading problems gone.

      So I don't know if you're jerking my chain or not. If you are, good one--ha ha. If you aren't, what planet have you been working on? :)

      --
      Zed's dead baby. Zed's dead.
    108. Re:Oh my sweet Jesus... by Cow+Jones · · Score: 1
      but come on.. different types of compare operators that work on regular variables (one for numbers, one for strings)? Can't the interpreter just say "Oh, one of these is a string, internally.

      That's what the PHP creators thought, and look where it got them. In PHP, you can have three variables A, B, and C, where

      A == B
      and B == C
      but C != A

      Yum. Don't believe me? Check this out:

      $a = "0";
      $b = 0;
      $c = "";
      if ($a == $b && $b == $c && $c != $a)
      {
      echo "oops";
      }
      --

      Ah, arrogance and stupidity, all in the same package. How efficient of you. -- Londo Mollari
    109. Re:Oh my sweet Jesus... by JediTrainer · · Score: 1

      Have you ever tried using regular expressions in Java?

      Perhaps it's a little wordy, but I never had much trouble using Perl syntax in Java using the Jakarta ORO library

      import org.apache.oro.text.perl.Perl5Util;
      ...
      Perl5Util perl = new Perl5Util();
      String expression = "/MYREGEX/";

      if ( perl.match( expression, inputLine ) ){
      //do something with the obj returned here
      perl.getMatch();
      }

      That's not so bad, is it? Of course if you plan on using an expression many times there's ways to compile and use it multiple times, but again, it's really not that difficult.

      --

      You can accomplish anything you set your mind to. The impossible just takes a little longer.
    110. Re:Oh my sweet Jesus... by bigdavex · · Score: 1

      You could ridicule me back for writing it wrong, too. 9.8 m/s^2 not that crap I wrote.

      --
      -Dave
    111. Re:Oh my sweet Jesus... by Ugmo · · Score: 1

      That is all one line in perl using the =~ operarator
      something like:

      if $_=~/MYREGEX/{ //do somthing
      }

      You can use a named variable instead of the $_ so it is easier to read. If you have to do this sort of thing a lot it is much easier to read and follow in Perl.

    112. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      Yes, I know about Ruby. Ruby has performance problems though.

      It is certainly a nice language and very Perl-like, but the implementation isn't great. Plus it still feels a bit more (too) structured compared to Perl.

    113. Re:Oh my sweet Jesus... by JediTrainer · · Score: 1

      If you have to do this sort of thing a lot it is much easier to read and follow in Perl.

      I respectfully disagree. I write both Perl code and Java code, and to be honest, while Java is wordier, I find it much easier to write maintainable code in Java. I also find it much easier to maintain other people's code in Java.

      I don't see what's so much harder about

      if ( perl.match( "/EXPRESSION/", line ) ){

      versus

      if $line =~ /MYREGEX/ {

      Wordy? Perhaps. But using this method (and Java's OO nature) I can juggle multiple matches if I need to correlate between them, without too much difficulty. In my view, both languages have their advantages.

      --

      You can accomplish anything you set your mind to. The impossible just takes a little longer.
    114. Re:Oh my sweet Jesus... by Ugmo · · Score: 1

      I don't like that you first have to set up the expression, then get the match, then retrieve the match.

      Don't get me wrong, when I write Java code and need to do things with strings I use regexes. In fact, I do not need to use any perl-like external libraries. Newer versions of Java support regular expressions as do Microsoft products.

      All of the OO type languages, including Python, seem to treat regexes the same way with a regex expression that needs to be compiled seperately from the matching and the matches end up in a seperate place that needs to be accessed...yadda yadda. It is not torture but there are a couple of extra steps that do not make things more readble. If you see a regex in any of the languages, you know what is going to happen. Outside of Perl, there is just a bunch of extra code before and after the actual regex.

      It is great that these things are available, but like I orginally said, Perl has some weird operators but all the things you do in Perl you can do in other languages, it just takes more syntax to get there. To use regexes in Java, you have to read through the library documentation and learn how to use the methods and understand the syntax. You have to do the same thing with Perl. Just becuase =~ looks stranger than = doesn't mean you went through less work learning it.

      It is like there was no such thing as multiplication x. And someone figured out that if you add 2+2+2 3 times it gave you 6 . For whatever reason, they end up doing this a lot. They then wrote a function addManyTimes() and used that everywhere.

      Would they be crazy to come up with an operator x and use that instead?

      There are many computery things that are just as common as multiplication. When dealing with text files, the regex operations are actually more common. Perl just uses operators for very common computery things.

      I had to learn a lot of operators in Comp Sci like AND, XOR in logic UNION, INTERSECTION in set theory PROJECTION, SELECTION, BOWTIE in relational agebra. Go look up a LaTex reference page to see all the crazy operators out there. When you have to do something over and over again operators are not a bad thing. Larry Wall et al. are just recognizing this and making them available in the language. You don't even have to use them. They are making most of the fuctions available as function calls also.

      If you want a language that is readable and easily understandable, try reading COBOL code. It is very readable. Much more readable than Java. Try writing it sometime. You'll go nuts. You can take readability too far.

      My Perl code had $big_long_descriptive_variale_names and #lots of comments

      Other Perl coders laugh at me, but my code is readable. It does not have to look like line noise. The operators are easy for me to read and write and once people learn them, the code is easy to understand.

    115. Re:Oh my sweet Jesus... by devphil · · Score: 2, Insightful


      While that sounds all nice and freedom-loving, that's exactly why any group larger than about 5 people usually gives up on Perl.

      So there's 10 ways to do something. Okay, great, you only need to use one of them to write the code. But it's not the same way I used, and neither of those are the same way as the guy over here used, and the sourceforge[t].net code we just downloaded uses a fourth way, and the new hire wants to use a fifth because "it's the Perl Way."

      So now all of use have to know all 10 ways of doing the same damn thing, and all the minor ways in which they differ. Just to read and maintain it, not to write anything new.

      "More than one way" is fine. Anarchy is not.

      --
      You cannot apply a technological solution to a sociological problem. (Edwards' Law)
    116. Re:Oh my sweet Jesus... by eliasen · · Score: 1
      nah - what I meant was that no-one since has implemented '=' as meaning 'nearly, but not necessarily exactly =' in a language.

      Actually, Mathematica does just that.

      "Approximate numbers are considered equal if they differ in at most their last eight binary digits (roughly their last two decimal digits)."
      --
      Make your computer ten thousand times larger--try Frink
    117. Re:Oh my sweet Jesus... by spectral · · Score: 1

      Honestly, this makes sense to me. I'm going to stop using PHP now, because crap like that has actually been ingrained enough that it doesn't bother me. === and checking types in PHP is second nature.. *Sigh*

    118. Re:Oh my sweet Jesus... by boots@work · · Score: 1

      I think the grandparent is not trying to say "2.99999..." repeating unto infinity, but rather e.g. 2.9999999999999999999981823, the kind of quantity that tends to pop up in FP arithmetic. As another poster noted, 3 can be represented exactly in FP, so it's a bad example. 3.3 would be better, which is 3.2999999999999998223643160599749535322189 as a double.

      It's also wrong to say it's not deterministic. Of course it is; converting an integer to a float is a pure algorithm. I think what he meant is "I can't tell off the top of my head". :-)

      On a related note, it looks like Python is about to get some Cowlishaw-style Decimal number types, which should help with some of these problems.

    119. Re:Oh my sweet Jesus... by Anonymous Coward · · Score: 0

      Static typing is related to static type annotations of binding declarations.

      Strong typing means that for any types T and S
      1. Operations defined on type S will operate on instances of type S.
      2. Operations on type S will not operate on instances of type T, unless there exists an well-defined morphism T -> S.

      C is weakly typed for a number of reasons.

      Firstly it has a limited mechanism for actually specifying types. Typedef? No, it specifies only aliases for types. Enum? No. Any time you use either of these to define "types" you're not, and usage of them is not type safe. If you aren't pretending these are "types," then this is irrelevant.
      Secondly, C's type-coercion does not require any well-defined semantics. You can cast one type to another type, and the result will not be a valid instance of the second type. Its behavior is not well-define, and may very well cause havoc and fire to fall from the sky.
      Thirdly, C's unions are not type-safe. Same problem as above. Fire and brimstone.

    120. Re:Oh my sweet Jesus... by cavebear42 · · Score: 1

      I have been known to code a little. My languages in the order I learned them: C, C++, Motorola based assembly, Intel based assembly, Java, MIPS based assembly, and perl.

      Let me state that I(NSH)MO only assembly programmers have the right to discuss what is and is not ridged, optimized, and solid. To continue with your analogy, I can build out of bricks or mud and sticks, and I know how to turn mud and sticks into bricks.

      At the current time, perl is my language of choose. The longevity of the code is at the discretion of the coder in any language. The readability is a combination of the skill level of the reader and the completeness of the commenting and documentation. The fact that I can say either:
      if ( x != y )
      or
      unless ( x == y )
      makes the code easier to read. Also:
      elsif( x == y ){
      }
      is far cleaner than:
      else{
      if( x == y ){
      }
      }
      Its not the operators that cause confusion, it is the habit of the programmer. In all fairness, I do have trouble reading:
      ( x == Y ) && ( a == b ) || ( y = 1 );
      rather than
      if ( ( x != y ) || ( a != b ) ){ y = 1};

      But who am I to say that my way of doing it is any better than his.

      The moral of this story is that what they pay us for is NOT to think like everyone else. TIMTOWTDI helps us remember this.

    121. Re:Oh my sweet Jesus... by Vlad_the_Inhaler · · Score: 1

      Ouch, never heard of that particular one. I see it runs on Macs (which I have never been exposed to) and was originally perpetrated back in 1988. The horror of it all :-)

      Why did'nt they introduce a new operator? Something like (that gets eaten, I meant the chars: less-than, equals, greater-than or even vice versa) or =0=? Is that operator considered useful by those who use the language?

      --
      Mielipiteet omiani - Opinions personal, facts suspect.
    122. Re:Oh my sweet Jesus... by localman · · Score: 1

      So there's 10 ways to do something.

      Um, isn't this true for any non-toy problem in every language? I mean, even C, which is very a very small language by today's standards -- I may understand things on the line level a little easier but expand that out to a couple lines and there are once again 10 ways to do anything.

      I think Perl operators take big bites: they do more and thus encapsulate more "different approches". Wheras in most languages there is a small set of operators but the combinations which you have to string them together to get anything done is longer and more complex -- thus you're back to having many conflicting ways of accomplishing the same thing.

  3. Undiscovered: the /. operator by thomasdelbert · · Score: 4, Funny

    The /. operator is the one that causes your system to grind to a halt.

    - Thomas;

    --
    ___ This sig is in boldface to emphasize its importance!
    1. Re:Undiscovered: the /. operator by Anonymous Coward · · Score: 1, Funny

      So the equivalent of Unobtainium in periodic terms then.

    2. Re:Undiscovered: the /. operator by Anonymous Coward · · Score: 0
      The /. operator is the one that causes your system to grind to a halt.

      From the Objective Caml Reference Manual:
      val (/.) : float -> float -> float

      Floating-point division.
      It's actually quite fast on modern hardware...
  4. Cache? by anonieuweling · · Score: 1

    Does anyone have an URL for a cache of this PDF file?

    1. Re:Cache? by Anonymous Coward · · Score: 0

      Is it just me and my Firefox or does the Google pdf-to-cache conversion need some work..?

    2. Re:Cache? by technix4beos · · Score: 1

      Definately needs some work. I think a better approach is to just strip any and all tags from the pdf and present it as plaintext as much as possible.

      Wouldn't have formatting issues with text screaming off to the right, like it is now.

      --
      user@host$ diff /dev/urandom /dev/uspto
    3. Re:Cache? by Inda · · Score: 1

      Dude that looks nothing like it :)

      Some kind sole has mirrored it though.

      http://freecache.org/http://condor.madoka.be/vario us/PeriodicTable.pdf

      --
      This post contains benzene, nitrosamines, formaldehyde and hydrogen cyanide.
    4. Re:Cache? by FLEB · · Score: 1

      Short answer:

      Easier said than done.

      Long answer:

      The only problem with that, though, is that it would need to make educated guesses as to where things like columns are. If not, a two-column layout would get messy, with c1-c2-c1-c2 alternating in the same paragraph.

      Most PDFs don't just have "paragraphs" of text. The text is broken up, line-by-line, with positioning information for each (AFAIK). With the positioning info, the lines don't even need to be in the file in the order they're originally shown.

      --
      Information wants to be free.
      Entertainment wants to be paid.
      You just want to be cheap.
    5. Re:Cache? by BokLM · · Score: 1

      I put it on my web server here.

  5. Looks great by PktLoss · · Score: 1

    I really think that looks usefull, if only I programmed in perl.

    Anyone want to make something similar in PHP? :)

    Congrats to the author.

    1. Re:Looks great by SHEENmaster · · Score: 2, Informative

      Here it is.

      --
      You can't judge a book by the way it wears its hair.
    2. Re:Looks great by just-a-stone · · Score: 1

      the w3schoole table is rather incomplete -
      consider using php.net operators manual instead - there are more of them (but far away from maxing out ascii like perl 6 is about to do)

  6. PDF mirror by Cond0r · · Score: 5, Informative

    A mirror location for the PDF of the periodic table: http://condor.madoka.be/various/PeriodicTable.pdf

  7. I looked all over. by Phidoux · · Score: 5, Funny

    Where is the WTF operator?

    1. Re:I looked all over. by beacher · · Score: 1

      It's the ; behind the || die

    2. Re:I looked all over. by thomasdelbert · · Score: 3, Funny
      Where is the WTF operator?
      Here:

      ($p?(/.{70}\|$/):(/^\|/))||(&{$\[3]}<$/[0])?($p=!$ p):&{$\[$p]}||die("$d");

      - Thomas;
      --
      ___ This sig is in boldface to emphasize its importance!
    3. Re:I looked all over. by BillX · · Score: 1

      You mean this one?

      # WTF?!?

      All over my code, that's where...

      --
      Caveat Emptor is not a business model.
    4. Re:I looked all over. by Compuser · · Score: 1

      WTF?

    5. Re:I looked all over. by Autonomous+Cowturd · · Score: 0

      Perl is the only language that makes more sense after it is compiled.

    6. Re:I looked all over. by Temporal · · Score: 3, Funny

      Man... someday someone is going to write an obfusicated perl version of "rm -rf *" and post it on slashdot, and everyone is going to fall for it.

    7. Re:I looked all over. by Anonymous Coward · · Score: 1, Funny

      And do essentially no damage to their systems, because nobody runs as root, and everyone backs up their home directories on a regular, automated basis. Right?

  8. Some of these have a halflife of a few nanoseconds by JCCyC · · Score: 5, Funny

    Code written with them becomes illegible after that.

  9. Perl 6 by Anonymous Coward · · Score: 5, Funny

    Perl 6 is going to be the best thing that ever happened to Python.

    1. Re:Perl 6 by aurelien · · Score: 3, Insightful

      http://www.underlevel.net/jordan/erik-perl.txt

      it stands for itself...

      * ; ; ; h e l m e r . . .
      | I have been slowly learning lisp over the past year and have had someone
      | mention to me that I should learn perl, for jobs etc.

      the unemployed programmer had a problem. "I know", said the programmer,
      "I'll just learn perl." the unemployed programmer now had two problems.

      having a job is not unimportant, but if knowing perl is a requirement for
      a particular job, consider another one before taking that one. this is
      true even if you know perl very well. life is too long to be an expert
      at harmful things, including such evilness as C++ and perl.

      I once studied perl enough to read perl code and spot bugs in other
      people's programs (but later gained the wisdom that this was not an
      accomplishment -- spotting a bug in a perl program is like spotting the
      dog that brought the fleas), but I don't write in it and I don't ever
      plan to use it for anything (part of my new position is quality assurance
      for the systems I'm inheriting responsibility for, and part of any
      serious QA is removing perl code the same way you go over a dilapidated
      building you inherit to remove chewing gum and duct tape and fix whatever
      was kept together for real). also, very much unlike any other language I
      have ever studied, perl has failed to stick to memory, a phenomenon that
      has actually puzzled me, but I guess there are some things that are so
      gross you just have to forget, or it'll destroy something with you. perl
      is the first such thing I have known.

      this is your brain. this is perl. this is your brain on perl. any
      questions?

      | If I learn lisp well will I be able to do what people do with perl[?]

      no, you won't. however, there is a very important clue to be had from
      this: what people do with perl is wrong. perl makes a whole lot of tasks
      easy to do, but if you look closely, you will see that those tasks are
      fundamentally braindamaged, and should never have been initiated. perl
      is perhaps the best example I can think of for a theory I have on the
      ills of optimization and the design choices people make. most people,
      when faced with a problem, will not investigate the cause of the problem,
      but will instead want to solve it because the problem is actually in the
      way of something more important than figuring out why something suddenly
      got in their way out of nowhere. if you are a programmer, you may reach
      for perl at this point, and perl can remove your problem. happy, you go
      on, but find another problem blocking your way, requiring more perl --
      the perl programmer who veers off the road into the forest will get out
      of his car and cut down each and every tree that blocks his progress,
      then drive a few meters and repeat the whole process. whether he gets
      where he wanted to go or not is immaterial -- a perl programmer will
      happily keep moving forward and look busy. getting a perl programmer
      back on the road is a managerial responsibility, and it can be very hard:
      the perl programmer is very good at solving his own problems and assure
      you that he's on the right track -- he looks like any other programmer
      who is stuck, and this happens to all of us, but the perl programmer is
      very different in one crucial capacity: the tool is causing the problems,
      and unlike other programmers who discover the cause of the problem sooner
      or later and try something else, perl is rewarding the programmer with a
      very strong sense of control and accomplishment that a perl programmer
      does _not_ try something else.

      it's not that perl programmers are idiots, it's that the language rewards
      idiotic behavior in a way that no other language or tool has ever done,
      and on top of it, it punishes conscientiousness and quality

      --
      aurelien
    2. Re:Perl 6 by CTachyon · · Score: 1

      Well, considering that the Perl 6 effort is what kicked off the Parrot bytecode engine, which both Python and Perl plan to use, you're probably right.

      --
      Range Voting: preference intensity matters
    3. Re:Perl 6 by Doctor+Crumb · · Score: 1

      Bad programmers will write bad code no matter what language they use. I have seen incredibly crappy code in *every* language I've ever used. I have tried to write elegant and readable code in every one of those as well; it is easier in some than others.

      That said, it is much easier to justify to management the 5 minutes you spent writing a perl script to solve the problem at hand than it is to justify 5 hours building a clean extensible framework. I would have to write 59 other 5 minute perl scripts before it is more time-efficient to write that 5h framework. The workplace cares more about getting the job done, which is something most comp scis forget.

  10. The Elements - Tom Lehrer by Richard_L_James · · Score: 3, Funny
    which operators are yet to be discovered.

    The sentance reminded me of the Elements song.... No doubt someone has already started rewriting it for Perl !

  11. Relevant excerpt from the INTERCAL language manual by mcc · · Score: 4, Funny

    TONSIL A (1)

    The Official INTERCAL Character Set

    Tabulated on page XX are all the characters used in INTERCAL, excepting
    letters and digits, along with their names and interpretations. Also
    included are several characters not used in INTERCAL, which are presented
    for completeness and to allow for future expansion.

    Character Name Use (if any)

    . spot identify 16-bit variable
    : two-spot identify 32-bit variable
    , tail identify 16-bit array
    ; hybrid identify 32-bit array
    # mesh identify constant
    = half-mesh
    ' spark grouper
    ` backspark
    ! wow equivalent to spark-spot
    ? what unary exlusive OR (ASCII)
    " rabbit-ears grouper
    ". rabbit equivalent to ears-spot
    | spike
    % double-oh-seven percentage qualifier
    - worm used with angles
    < angle used with worms
    > right angle
    ( wax precedes line label
    ) wane follows line label
    [ U turn
    ] U turn back
    { embrace
    } bracelet
    * splat flags invalid statements
    & ampersand[5] unary logical AND
    V V unary logical OR
    (or book)
    V- bookworm unary exclusive OR
    (or universal qualifier)
    $ big money unary exclusive OR (ASCII)
    c| change binary mingle
    ~ sqiggle binary select
    _ flat worm
    overline indicates "times 1000"
    + intersection separates list items
    / slat
    \ backslat
    @ whirlpool
    -' hookworm
    ^ shark
    (or simply sharkfin)
    #|[] blotch

    Table 2 (top view). INTERCAL character set.

    (1) Since all other reference manuals have Appendices, it was decided that
    the INTERCAL manual should contain some other type of removable organ.

    (2) This footnote intentionally unreferenced.

  12. Google cache by lilmunkysguy · · Score: 1
  13. PDF Mirror by technix4beos · · Score: 3, Informative

    I'm also hosting the PDF directly, here:

    PeriodicTable.pdf

    --
    user@host$ diff /dev/urandom /dev/uspto
  14. Awful! XD by Apage43 · · Score: 4, Insightful

    Take a look at this, then take a look at a real periodic table. Yup, that's right, a list of the operators of perl are more complicated than a list of all the atoms that make up everything around you. Mirror (Bittorrent so I wont get myself /. ed) http://www.raiden.se/download/1541/PeriodicTable.p df.torrent

    1. Re:Awful! XD by kryptkpr · · Score: 1

      That's not much of a mirror, it requires signing up for an account.

      --
      DJ kRYPT's Free MP3s!
  15. OMG by vijaya_chandra · · Score: 1

    If this periodic table somehow gets into school textbooks

    the number of those who would pick chemistry as their career would definitely exceed those who take up computers
    (atleast in our CS-crazy country
    you guessed it right. India)

    1. Re:OMG by syynnapse · · Score: 1

      I used to have a big intrest in Chem, but all the annoying crap (everything about chem, that is) drove me away.

      Now i'm studying comp sci, and if I had seen a table like this in CS1, i might have just picked philosophy, and all you geeks be damned.

      --

      System.out.println(syynnapse.getSig());

    2. Re:OMG by Nasarius · · Score: 1

      I'm doing both at the same time (in the US). Scary stuff :)

      --
      LOAD "SIG",8,1
    3. Re:OMG by Anonymous Coward · · Score: 0

      As anyone who has ever taken an advanced logic course knows, Philosophy can be some of the geekiest shit around.

      You know how it is. Biologists dream of being Chemists; Chemists dream of being Physicists; Physicists dream of being Mathematicians; Mathematicians know they're essentially just Philosophers. And Philosophers just don't care.

      I'm a Mathematician, if you care. heh.

  16. music video, too (Re:The Elements - Tom Lehrer) by retiarius · · Score: 1

    appears at http://www.cdbaby.com/tomleher

    1. Re:music video, too (Re:The Elements - Tom Lehrer) by retiarius · · Score: 1

      "This may prove useful to you someday
      perhaps, in a somewhat bizarre set of circumstances."

      --Tom Lehrer

      corrected to:

      http://www.cdbaby.com/cd/tomlehrer

  17. Mirror by eyeball · · Score: 2, Informative

    Mirror mirror on the (Larry) Wall...

    Bandwidth courtesy of .Mac

    --

    _______
    2B1ASK1
  18. huh by INeededALogin · · Score: 2, Funny

    You might want to take a look at this and think about which operators are yet to be discovered

    Yet to be discovered? means... Yet to be thought of... or yet to be documented. I am sure that I could find all of them by spending a few minutes looking through the code.

    Sorry, I am just puzzled by what I am discovering.

    1. Re:huh by Anonymous Coward · · Score: 2, Funny

      O, a sarcasm detector, thats a real useful operator.

    2. Re:huh by RenaissanceGeek · · Score: 1
      You might want to take a look at this and think about which operators are yet to be discovered

      This is an allusion to the final line of Tom Lehrer's song "The Elements" (written, I believe, for the educational TV program "The Electric Company" (targeted to the age group between "Sesame Street" and "3 2 1 Contact.") His tune "Ly" is pretty funny, as well, for something intended for educational TV.)

      ``These are the only ones of which the news has come to Harvard, And there may be many others but they haven't been discovered.''

      I was intoduced to Tom Lehrer's work by listening to the "Dr. Demento Show" on the radio (the man who gave Wierd Al Yankovick his first big media exposure.) Funny, twisted stuff.
      --
      What is the difference between a small revolutionary change and a large evolutionary change?
    3. Re:huh by This+Is+Ridiculous · · Score: 1

      The holes in the pattern could indicate where more operators will be added. For example, there are multiplication equivalents for numbers, strings, and lists (*, x, and xx), but there are only addition/concatenation operators for numbers and strings (+ and ~). The pattern suggests that there should be a list concat operator, and that it should be ~~ (although that's already taken by smartmatch).

      --
      Hey, you try to find an open nick these days!
  19. Mirror of the PDF by stefanb · · Score: 1
    1. Re:Mirror of the PDF by Anonymous Coward · · Score: 1, Informative

      Dude, you forgot the http bit...This works better :)

    2. Re:Mirror of the PDF by Anonymous Coward · · Score: 0

      Your post just screams "retarded."

  20. There's one of these for Oracle too... by lpangelrob2 · · Score: 1
    Admittedly, not nearly as complex as the Oracle one (nothing like a poster of reserved words to keep you company at work). And yet, has Oracle gone away? Not really. I won't get into the orthogonality of the language debate, though. :-p

    This could be pretty helpful for people that can't remember what all those symbols do and yet have to code on a regular basis. Heck, if I were a Perl developer I'd blow this up and print it.

    1. Re:There's one of these for Oracle too... by The+Unabageler · · Score: 1

      As a perl programmer for the past 5 years, the only ones that don't stick in my head (along with their relative precedence to whatever else I'm doing) are the -x operators.

      --
      perl -e '$_="\007/4`\cp%2,".chr(127);s/./"\"\\c$&\""/gees; print'
    2. Re:There's one of these for Oracle too... by bucknuggets · · Score: 1

      > Admittedly, not nearly as complex as the Oracle one (nothing like a poster of reserved words to keep > you company at work). And yet, has Oracle gone away? Not really. While oracle is a pain-in-the-ass, it doesn't have this kind of confusion. It has both proprietary & ANSI metadata tables, quite a few system & user functions, a fairly simple language, and a fair amount of reserved words. There's quite a bit of complexity there, but most users will only touch on 10% of it, and there is typically just a very limited number of ways of doing the exact same thing. Perl on the other hand, has about six gazillion ways of doing the exact same thing. And reading another coder's work can require hours of analysis *of the stinking language* rather than of the solution. Nope, this is a disaster, and even the bloated beast that is Oracle looks reasonable in comparison. I can't think of a better reason for getting serious about python or ruby....

  21. Can't seem to find it... by mcc · · Score: 4, Funny

    We may have to wait for Perl 7 for that one. However, if you look under "Quasi Variables/Templars", you will find there is a "yadda, yadda, yadda" operator.

    1. Re:Can't seem to find it... by DMUTPeregrine · · Score: 1

      With names like that, why don't we all just switch to INERCAL character set. Fun!

      --
      Not a sentence!
    2. Re:Can't seem to find it... by perljon · · Score: 1

      yadda yadda yadda is cool

      it makes this valid executable code

      sub bla {
      ...

      }

      # the ... is the yadda yadda yadda operator

      There is also an infinity operator. I forget how to to denote it, but it allows you to do

      foreach my $number ( 1..infinity) {

      }

      of course it's filled in as you need it, unless you have a pentium infinity processor.

      --
      This isn't the sig you are looking for... Carry on...
  22. Hmm.. by Azureflare · · Score: 1
    Anyone else having problems viewing this pdf in linux? A large part of the pdf is completely black in Xpdf and kghostview.

    In fact, it does the same thing in Acrobat reader 4 through cxoffice. What gives?

    1. Re:Hmm.. by uss_valiant · · Score: 1
      Anyone else having problems viewing this pdf in linux? A large part of the pdf is completely black in Xpdf and kghostview. In fact, it does the same thing in Acrobat reader 4 through cxoffice. What gives?

      Works with Adobe Acrobat Reader 6.0 (no black areas).
      Jaws PDF Editor Version 2.1 is readable, but the rectangle around the periodic table is black instead of white.
      I thought the newest version of Jaws PDF Editor was Acrobat 6.0 compatible, strange.
      (all on WinXP)
    2. Re:Hmm.. by ChrisDolan · · Score: 2, Insightful

      It's a PDF v1.4 document. You need Acrobat 5 or higher (or the equivalent) to view it properly. It looks black because the transparent images are not supported in PDF v1.3 and earlier. It could be considered a flaw that Acrobat 4 does not recognize that it's a newer PDF than the application knows how to render.

      The author probably built the chart in Illustrator, which outputs its PDF documents as v1.4 by default.

  23. Not just linux by Azureflare · · Score: 1
    Not just linux, I just tried it in Acrobat reader on my windows box, and it's also got the black background...

    Looks like someone made a bad pdf =P

    Either that, or they were on a mac.

    1. Re:Not just linux by dumbnose · · Score: 1

      Looks fine on OS X.

    2. Re:Not just linux by 1u3hr · · Score: 1
      Not just linux, I just tried it in Acrobat reader on my windows box, and it's also got the black background... Looks like someone made a bad pdf =P Either that, or they were on a mac.

      The file info says it was made by Quartz in OS X. Anyway, I was viewing it in Acrobat 4 on Windows, which showed parts obscured by black boxes. But I could delete them with the Touch-up object tool and it looks fine now.

    3. Re:Not just linux by Anonymous Coward · · Score: 0

      Either that, or they were on a mac.

      It's clear from the beautiful typography (Zapfino and Optima) that it was done on a Mac, and judging from the drop shadows on all the boxes I'd say it was probably done in OmniGraffle. All stuff that comes free with every Mac (okay, OmniGraffle only comes with PowerMacs and PowerBooks).

      It looks fine in both Preview and Acrobat Reader 5.0 on OS X, and I expect Acrobat Reader to render cross-platformly. It does use true drop shadows, and maybe some older PDF viewers don't render transparency properly. Or there's a possibility that this is related to the bug that was fixed in Mac OS X 10.3.4 just a few days ago:

      A PDF file's shadowed graphics will now print as expected with a PostScript printer.

  24. Really, it's not too bad. by Anonymous Coward · · Score: 2, Insightful

    I'll be the first to admit that Perl can be ugly--it's driven me to an interest in Ruby--but when you really think about it, it's not that many operators.

    Alot of them, for example, are numeric operators that should be familar to most programmers: !=,==,=,&,&&,, and so forth. About a third of them are regex operators. And among those that are left, many are either common Perl operators, or are not that difficult to figure out if you don't know what they are--e.g., "eq".

    I could make up a similar list for almost any other language, and it would appear pretty large.

    Perl has more operators than other languages, but if you include some of the things this individual is including, I'm not sure it's that much more.

    My reaction, too, was something like "whoa! what are all those!" But then when I saw what they were, it didn't seem so overwhelming.

  25. Brace yourself... by pedantic+bore · · Score: 2, Interesting
    I hope there are typos in this table, or else I'm not looking forward to Perl 6 any more... It's going to break my brain to go back and forth:
    • Why is "?:" spelled "??::"?
    • Why is "&&" different from "and"? Ditto for "||" and "or", etc.
    • "." is now "~"?
    • Charwise operators?

    And just to be pedantic, shouldn't all the "op=" operators be described as molecules formed from "op" and "="?

    --
    Am I part of the core demographic for Swedish Fish?
    1. Re:Brace yourself... by Anonymous Coward · · Score: 1, Informative

      > Why is "&&" different from "and"? Ditto for "||" and "or", etc. Operator precedence. Look at perldoc perlop

    2. Re:Brace yourself... by Hanji · · Score: 2, Informative
      Can't answer all of those, but as for
      Why is "&&" different from "and"? Ditto for "||" and "or", etc.
      It's always been that way, at least for perl 5 (I have no earlier perl knowledge)

      and and or have much lower precedence than && and ||, the idea being that the latter should be used for logical expression ($a || $b), and the former for a sort of concise control structure (using short circuit evaluation), i.e.
      open(FIN,$file,"<") or die("Unable to to open $file: $!");
      Since they have such low precedence, it's (practically?) guaranteed that you can safely use them for that, and they will be evaluated only after the entire first operand.
      --
      A Minesweeper clone that doesn't suck
    3. Re:Brace yourself... by Dr.+Zowie · · Score: 4, Informative

      Why is "?:" spelled "??::" ?
      Because "?:" is a logical (short-circuit; control flow) operator. The newer spelling makes it look more like "&&" and "||".
      Why is "&&" different from "and"? Ditto for "||" and "or", etc.
      Precedence, my friend, precedence. That already exists in perl 5. The spelled-out operators have much lower precedence than && and friends -- so you can say
      if( $a = shift and $a=~m/foo/ ) { ... }
      conveniently. ($a gets the shifted value, not the boolean AND of the shifted value and the match).
      "." is now "~"?
      Well, three good ones out of four ain't bad... IMHO this is dumb. The reason is that "->" is now "." (saving some keystrokes, I suppose) -- but I'd rather leave both operators as-is.
      Charwise operators?
      Yes, excellent stuff! I believe that this is actually driven by the PDL application -- there, you have large arrays (e.g. several million entries) and want to do vast vectorized operations on them. Currently PDL uses the perl 5 bitwise operators for vectorized ops -- but that's not a perfect fit, since sometimes you do actually want bitwise operations.

    4. Re:Brace yourself... by mcc · · Score: 1
      Why is "?:" spelled "??::"?

      A quote from the relevant docs. In short, Larry Wall really, really wanted to use the colon for something else.
      The old ?: operator is now spelled ??::. That is to say, since it's really a kind of short-circuit operator, we just double both characters like the && and || operator. This makes it easy to remember for C programmers. Just change:

      $a ? $b : $c

      to

      $a ?? $b :: $c

      The basic problem is that the old ?: operator wastes two very useful single characters for an operator that is not used often enough to justify the waste of two characters. It's bad Huffman coding, in other words. Every proposed use of colon in the RFCs conflicted with the ?: operator. I think that says something.
      "." is now "~"?

      Huh? Well, I hope so-- last I heard "." was becoming "_", leading to the horrific situation where "$a _" and "$a_" have totally different meanings. ~ makes much more sense.

      At any rate, they're coopting the "." operator as a dereference operator, the way it's used in java, so it couldn't be stringcat anymore.

      And just to be pedantic, shouldn't all the "op=" operators be described as molecules formed from "op" and "="?

      They should be, but a big chunk of the things on this chart ought to be as well, not the least of which are the charwise operators. The vast bulk of usable perl "operators" are formed from molecules of this sort.
    5. Re:Brace yourself... by WWWWolf · · Score: 1

      The Perl 5 string concatenation operator (full stop) has changed into an underscore in Perl 6. The reason was given ages ago - The full stop is now for a method call, like in many other programming languages. Yeah, I thought it looked ugly the first time I saw that. I don't really care.

      I suspect (in other words, guess) the difference with "&&" and "and" will be the same as it is currently: They have different precedence. ("and" being tighter than "&&".) I don't really know.

      You may find the Exegesis on the operator issues helpful.

    6. Re:Brace yourself... by This+Is+Ridiculous · · Score: 3, Insightful
      Why is "?:" spelled "??::"?
      Larry Wall felt that inline if wasn't a common enough operation to lose both question mark and colon to. He also likes to point out that, like || and &&, ??:: is a short-circuiting logical operator.
      Why is "&&" different from "and"? Ditto for "||" and "or", etc.
      Different precedence levels. This already exists in Perl 5.
      "." is now "~"?
      Yes. Larry wanted dot to be used for method calls, since objects are becoming much more prevalent in Perl 6. The tilde wasn't being used for anything terribly important (1's complement), so he stole it and made something else do 1's complement; it's supposed to remind you of a little piece of string.
      Charwise operators?
      Allow you to treat a string as a bit vector and perform bitwise operations on it. You can already do this in Perl 5 with the normal bitwise ops--Larry just split them out into separate operators for Perl 6.
      And just to be pedantic, shouldn't all the "op=" operators be described as molecules formed from "op" and "="?
      Yes, as should the bool/int/bitstring ops, and a lot of other things. That, IMHO, is the main flaw of this table, although I don't really know how to do it better.
      --
      Hey, you try to find an open nick these days!
    7. Re:Brace yourself... by ggwood · · Score: 1

      I apologize for my ignorance, but couldn't you just use parentheses to enforce precedence instead of having separate operators?

      I'm not saying the language shouldn't have any redundancy. I'm just asking if there exists some expression which can be done with one but not the other?

      I'm not a perl programmer, just a curious observer.
      _______________________________________ ______

      --
      a war on terrorism? How can we end a war on a method?
    8. Re:Brace yourself... by CaptainPinko · · Score: 1

      well a change from "->" to ".", could this be to bring Perl in line with most of the other OOP languages? eg. python and java?

      --
      Your CPU is not doing anything else, at least do something.
    9. Re:Brace yourself... by Anonymous Coward · · Score: 0

      I apologize for my ignorance, but couldn't you just use parentheses to enforce precedence instead of having separate operators?

      Yes, but (sometimes (parentheses can) (be (irritating, (you)) know what) I mean?)

      In perl, the common code fragment that uses the "or" operator is

      open FILE, $file or die "Error opening $file: $!\n";

      Perl programmers are used to being able to avoid parentheses in the common cases. Not having "or" would force them to use || and parentheses.

    10. Re:Brace yourself... by This+Is+Ridiculous · · Score: 1
      I apologize for my ignorance, but couldn't you just use parentheses to enforce precedence instead of having separate operators?

      Certainly--this is the reason we don't have (e.g.) a low-precedence 'add' binary op. However, one of Perl's standard idioms is the use of short-circuiting 'or' for error handling:

      #Perl 6 'open' returns a filehandle instead of
      # taking one as a parameter.
      $fh=open "$filename" or die "Can't open $filename: $!";

      #Perl 6 'system' returns 0 but true on success.
      # (Perl 5 just returned a plain old zero, so you
      # had to test it with 'and' instead of 'or'.)
      system "/bin/ls $dir" or die "Can't start /bin/ls: $!";

      In both of the above cases, you could use parens, but the lack of parens plus the 'or' instead of '||' makes the code more readable. (And yes, believe it or not Perl hackers do occasonally worry about readability.)

      --
      Hey, you try to find an open nick these days!
  26. Python by Anonymous Coward · · Score: 1, Funny

    Then people will learn why Python is the best thing that ever happened to Ruby.

    1. Re:Python by Anonymous Coward · · Score: 0

      please exemplify.

    2. Re:Python by Anonymous Coward · · Score: 0

      I already learned that long ago.

      Ruby 1.8 is awesome.. I just discovered that with the Ruby/DL package you can pull in ANY .so library and use it as a ruby extension without having to do anything special!

      Whenever I program in Ruby, I have to keep a stack of boxers nearby because I'm constantly shitting myself with excitement! Damn you Matz!

  27. To tell the truth by grouse · · Score: 1

    It was when I first saw what they had planned for Perl 6 that I decided to switch.

  28. Yeah! by Phidoux · · Score: 1

    WTF(($p?(/.{70}\|$/):(/^\|/))||(&{$\[3]}$/[0])?($p =!$ p):&{$\[$p]}||die("$d"));

  29. THAT'S A LOT OF NUTS!!!! by fragbait · · Score: 2, Insightful

    To people who don't deal with the Periodic Table of Elements on a regular basis (i.e. it isn't part of the job or hobbies), this is overwhelming. I find this interesting because I can see how the brain of a fellow human works.

    Why go this trouble if they will be presented in the index of a book or an order of operations table? He's forced the information into his way of understanding. He's taken the operators and organized them in a manner that he feels they are easy to deal with.

    A chemist can make everything look like chemistry. Or for the programmers, a C programmer can program C in any language.

    -fragbait
  30. And those are just the operators... by Per+Wigren · · Score: 1

    Wait until they add the special variables like $_ and $^ ...
    I'd like to have a chart over how to do simple stuff like accessing a string in an array in a hash.. I always forget where to put that cryptic $\@%-stuff..

    If you like the concept of Perl but hate the cryptic syntax and feel that Python isn't flexible enough without being too verbose, have a look at Ruby! It's 100% OO down to the core and it's simply beautiful! It's Perl done right.

    --
    My other account has a 3-digit UID.
    1. Re:And those are just the operators... by close_wait · · Score: 1
      Wait until they add the special variables like $_ and $^ ...

      In Perl 6, most of the cryptic punctuation variables are going away.

    2. Re:And those are just the operators... by This+Is+Ridiculous · · Score: 1
      To my knowledge, Perl 6 will only have four variable names consisting entirely of punctuation:
      $_ current topic (often, the object a method was invoked on)
      @_ default argument list for subs
      %_ extra named arguments on methods
      &_ current subroutine
      On the other hand, there will be a decent number of variables with punctuation in their names:
      $.x @.x %.x Object public data member
      $:x @:x %:x Object private data member
      $?x @?x %?x "Hypothetical" variable (used mainly for backtracking in grammars)
      $^x @^x %^x Autodeclared parameter (can be used with map, sort, grep, etc.)
      $*x @*x %*x True global variable ($*IN, $*OUT, $*ERR, @*ARGV, $*OS...)
      Most of the old punctuation variables are becoming true globals. (By the way, you can leave the * out of those if there isn't another variable by that name in scope.)

      Even that looks like a lot, but remember:
      • $.x and $:x are only used by people writing classes. (People using classes others have written won't be exposed to them.)
      • $?x is only used by people doing fairly advanced parsing, like language grammars.
      • $^x is completely optional--it can be used like "sort { $^a cmp $^b } @list", but you can also say "sort -> $a, $b { $a cmp $b } @list", or even write a full subroutine and write "sort your_sub_here @list".
      • The star in $*x is not usually needed--it's only needed if you have a similarly-named variable somewhere in scope.
      --
      Hey, you try to find an open nick these days!
  31. Re:Relevant excerpt from the INTERCAL language man by Anonymous Coward · · Score: 0

    Intercal is a joke language (though there is a compiler, natch).

    See also brainfuck, whitespace, etc.

  32. Perl6 Kitchen Sink: **= as an operator?! by Anonymous Coward · · Score: 1, Insightful

    Yes, how often does one have to perform "x = pow(x,y)" - or God forbid - "x = x ** y" - that you would need to shorten it to "x **= y"? This is what is wrong with Perl6 - it has the kitchen sink/second system syndrome. You all know what happens to such projects.

    1. Re:Perl6 Kitchen Sink: **= as an operator?! by This+Is+Ridiculous · · Score: 1

      Does **= really take up a big slice of brain tissue to remember? It fits an overall pattern perfectly, and is quite clear to anyone familiar with += and **.

      Remember, you don't have to use every operator in every Perl program. You should use a subset of the language that you're comfortable with and that allows you to do the work you need to do.

      --
      Hey, you try to find an open nick these days!
    2. Re:Perl6 Kitchen Sink: **= as an operator?! by forkboy · · Score: 1

      If you're writing a script for processing scientific data, you may very well use that operator quite a bit, especially with complex equations. I wrote a program to parse data from an experiment measuring the absorption spectra of organic dyes with conjugated pi electron systems and I had to use it quite a few times even in such a small script.

      The bottom line is, if there's a feature, someone will probably use it.

      --
      This message brought to you by the Council of People Who Are Sick of Seeing More People.
  33. You can write nasty code in any language by Anonymous Coward · · Score: 1, Insightful
    As I said in my last interview. You can write nasty code in any language some just lend themselves more to it.
    Why do people think that simple language equates to easier programming/comprehension? Hey, maybe we should reduce the number of words in English or the number of letters in the alphabet!

    Oops. I said "comprehension". That's a complicated word. It requires understanding a large vocabulary. Perhaps I should have circumlocuted instead by saying "easy to understand"? We wouldn't want to have parsimony and nuance in our expressions...

    At some point you have to pay for complexity. If you don't do it at the language level, you'll do it at the phrase, block, unit, or organizational level. How long to learn Brainfuck and how long to build a useful program in it?

    So apart from some windy griping, only one coherent argument has been presented here to counteract Perl's dada/inclusiveness bent. That was the astute observation that the families of operators are bigger because the types are not explicit and therefore the operation must be explicit instead of relying on context to understand what "a op b" actually really means. However all is not necessarily ideal because now the type of operation disappears from the local context, hence the reason for such reviled ideas as Hungarianization ("aByteP op bByteP").

    I find the most unsettling part of Perl is that I always thought scripting languages should be easy to learn: a limitation that makes them poorly suited to large or complex projects. And on the other end of the spectrum, an industrial-strength language should take years to learn properly but once mastered you can build the universe.

    1. Re:You can write nasty code in any language by Daniel_Staal · · Score: 1
      I find the most unsettling part of Perl is that I always thought scripting languages should be easy to learn: a limitation that makes them poorly suited to large or complex projects. And on the other end of the spectrum, an industrial-strength language should take years to learn properly but once mastered you can build the universe.

      So, which is the unsettling part; that Perl is an industrial-strength language that is easy to learn (at least learn usably), or that Perl is a scripting language that is suited to large and complex projects?

      --
      'Sensible' is a curse word.
    2. Re:You can write nasty code in any language by Anonymous Coward · · Score: 0

      What is unsettling is Perl is much harder to learn and read than seems sensible for a scripting language which is, by intent, supposed to be on the quick-n-dirty side. JMO.

      That said, the ideal of incremental deepening as "industrial strength" demands it is an intriguing value in language design and Perl is one of the few language that has such a property of adding fluency as task demands require it.

  34. Operators considered optional. by mcc · · Score: 5, Insightful

    One of the underlying philosophies about perl is to give the user as many options for doing things as is concievably possible. However, there's certainly no reason you have to take these options or, generally, to know those options are there. I repeat: you do not have to know these operators to use perl 6. There is almost nothing on this entire graph for which you could not get the same functionality in a more clean and readable manner by just doing it a different way.

    There is no doubt that a cleaner and more consistent language would arise from putting all the language functionality into clear and well-organized paths that everyone would use and recognize in exactly the same way. However the thing is, that is not what many people want. And I would posit that the popularity of perl proves that that is not what people want. While this chart may horrify many programmers, the simple fact is that one of the main reasons for the popularity of perl is the freedom offered by all of its shortcuts and bizarre little unnecessary operatorss. Someone programming in, say, Java, will find themselves often having to stop, scratch their heads, and try to remember or look up the method or class in the standard library used to do some trivial thing, or write a trivial function to do it themselves. While the perl programmer just scribbles out &$g =~ /(.)/g or the first thing that comes to their mind and moves on.

    Perl 6's one big problem, from my perspective, is that the language is *so* big that it's unlikely or impossible any one person will be familiar with all of its features. However one of these features-- which is either horrible or very attractive depending on how you look at it-- is that it offers you the opportunity to redefine the syntax. My personal theory is that many organizations which decide to adopt perl 6 internally will use this to just cut out large swaths of the language, cutting perl 6 down to something more streamlined and manageable. That is, in order to ensure everyone can read each other's code, they will be able to just set certain coding standards-- for example, "don't use hyper operators" or "don't alter the perl grammar"-- and then enforce this by requiring everyone to include a lib that simply removes these features from the language. Do something like this, and you're left with a language which is readable yet still perfectly functional and still more attractive in many ways than many other languages.

    This doesn't help though with the reason this is a big problem, though: code reuse. Perl 6 offers so many options that code written by another person or another organization, when it falls in your hands may sometimes appear to have been written in a different language than the one you are used to. And if people have been taking advantage of the syntax-redefinition features, it will literally be in a different language. However, I suspect this will not be an intractable problem for one reason. Perl 6 offers a very robust object system; it is likely that most of the code reuse in perl 6 will be done through modularity and incorporation of objects, rather than simple cut and paste code reuse. This is in fact generally the way that things work in perl 5; people just modularize everything, and learn not to poke too closely at the internals of any class they're given to work with, looking only at the perldocs. Weirdly, despite the illegible code (or perhaps because of it), the perl culture, or at least the perl module community, seems to have developed a tendency to write very exhaustive documentation. Anyhow, we shall see what happens.

    One last thing. This chart is not as bad as it seems. Most of the size of this chart stems from the explosion of "operators" caused by the addition into perl 6 of APL-style "adverbial operators". (I believe the user may define their own adverbs, but I am not sure.) This means that many of the operators on this list are actually compound operators-- for example, the "add the contents of two lists" oper

    1. Re:Operators considered optional. by alw53 · · Score: 2, Insightful

      >One of the underlying philosophies about perl is to >give the user as many options for doing things as >is concievably possible. However, there's certainly >no reason you have to take these options or, >generally, to know those options are there. I >repeat: you do not have to know these operators to >use perl 6.

      You can write programs in whatever subset you want;
      but if you want to read someone else's programs you had better know it all. Which is why Perl is a write-only language.

    2. Re:Operators considered optional. by chromatic · · Score: 1

      I pity the people who try to read your comment but don't understand the words "subset" and "programs" or independent clauses joined by semicolons. Therefore, English is a write-only language.

    3. Re:Operators considered optional. by DerekLyons · · Score: 1
      • Perl 6's one big problem, from my perspective, is that the language is *so* big that it's unlikely or impossible any one person will be familiar with all of its features.
      • This doesn't help though with the reason this is a big problem, though: code reuse. Perl 6 offers so many options that code written by another person or another organization, when it falls in your hands may sometimes appear to have been written in a different language than the one you are used to. And if people have been taking advantage of the syntax-redefinition features, it will literally be in a different language.
      This has some interesting implications for any open source project written in Perl. 'Many tounges' trumps 'many eyes'.
  35. There is more than one way.. by rijrunner · · Score: 0



    If you want to live up to the whole "There is more than one way to do it" slogan, you have to give someone a swiss army chainsaw..

  36. Re:Some of these have a halflife of a few nanoseco by BerntB · · Score: 3, Insightful
    Oh, get real. Many of them should IMHO not be operators; the file tests ('-r', etc) are probably there because of compatibility w Perl 5.

    But most stuff are quite logical and easy to pick up for a Perl 5 programmer like
    boolean operators, ... (yada yada yada), etc.

    Lots are straight Perl 5, like
    eq, ne, ( .. list ..), { }-use, []-use, \, etc.

    quite a few are pure C (and Perl 5), like
    --, ++, +=, ==, !=, &&, ||, |=, [array access], etc.

    In short, it's not that different from Perl 5. An indication on the periodic table for what is different from Perl 5 would have been very useful.

    Author, please?

    --
    Karma: Excellent (My Karma? I wish...:-( )
  37. Re:what is up with SPACES in the urls at slashdot? by lvdrproject · · Score: 0, Offtopic

    I imagine it splits 'words' greater than 50 characters. Happens on all kinds of software. (For example, vBulletin does it too.)

  38. It sure is... by Dr.+Zowie · · Score: 1

    It sure is, since it means you'll be able to import bits of perl code to do the stuff that's awkward in Python.

    1. Re:It sure is... by Anonymous Coward · · Score: 0

      That made no sense at all.

      You do realize that Python will not be targetting Parrot, right?

  39. If you think this is scary... by dexter+riley · · Score: 3, Funny

    ...remember that unlike Perl operators, you can't overload the chemical elements. Imagine if He meant helium, unless some chemist changed its definition to mean Mercury, or Ununtrium, or anything else!

    Mmm, a bottle of good old H2O! Glug glug. What's this small print? "The oxygen in this molecule has been overloaded to be radioactive, caustic, and-" ack!
    Thud.

    1. Re:If you think this is scary... by pjt33 · · Score: 3, Funny

      Dexter used to drink a lot, but now he drinks no more:
      For what he thought was H2O was H2SO4.

    2. Re:If you think this is scary... by CTachyon · · Score: 1

      I always preferred "Little Timmy took a drink, but now he'll drink no more".

      --
      Range Voting: preference intensity matters
    3. Re:If you think this is scary... by Slamtilt · · Score: 1

      I liked:

      Poor old Brown is dead and gone,
      His face we'll see no more,
      For what he thought was H20
      was H2SO4.

  40. Re:Relevant excerpt from the INTERCAL language man by Anonymous Coward · · Score: 0

    Don't forget fuckfuck!

  41. Nah... by Dr.+Zowie · · Score: 1
    I love a good rant as much as the next guy, but that one doesn't hold enough water. It's true that perl allows you to do really despicable things in the name of a dirty hack, and it's true that many programmers succumb to the temptation -- but all of the fundamental mechanisms in lisp are present in perl as a strict subset of the language.

    The rant is about crappy perl programmers. The argument that it supports best is that many perl programmers are crappy, rather than that perl itself is crappy.

    The problem, as I see it, is that perl makes quick-and-dirty hacking so quick and easy (for the experienced) that scalable solutions are put off until they're needed much more badly than in other, more restrictive, languages. That's OK. Here's why:

    All engineering solutions -- in computer programming, engine design, city layout, or what-have-you -- have multiple tiers of solution for different sizes of problem. A solution that works well for small things (e.g. a simply carbureted air-cooled gasoline engine to drive a scooter) doesn't work well when scaled up to larger operations (like pushing a supertanker around). You have to use more sophisticated solutions that take time to design and implement, but that win in the larger case.

    Applied to programming tasks, perl makes it easy enough to hack together sort-of-working solutions that you can really get a long way with quick and dirty stuff. (by analogy: the VW Beetle, the longest running car model in history [RIP] uses a simply carbureted air-cooled engine. It's not the most powerful car around, but more of them were bought new than any other model of car in history.)

    Ease of hacking is not a problem, that's a solution. Sure, closed-loop, fuel-injected, water-cooled engines are more powerful and scalable -- but they solve a different class of problem.

    A while ago I remember touring the U.S.S. Blowfin in Pearl Harbor -- it's a WW2 era submarine. One of the most interesting parts of the ship was the little machine shop -- rather than shipping spares of every little thing on-board, they carried loads of pipe and metal stock, and a compact milling-machine-and-lathe setup to make stuff. I remember thinking how similar that was to the Perl attitude of just leaving a big box of tools and parts around, to hook up whatever you need.

    Like the little machine shop, perl offers you the ability to do a lot of crufty stuff. It's up to you to know when to be crufty and when to be more careful. The problem is that carefulness and insight are much more rare than hackability. You seem to be ranting about perl, but you're actually ranting about people with poor programming judgement. Those people would write crap in any language.

  42. Don't use the Apocalyptic Perl6!!! by Anonymous Coward · · Score: 0
    Perl6 is a BUGator.
    Perl6 is an awful BUGatorian.
    Perl6 is a dangerous BUGatorianic.

    open4free ©

  43. huh? by gumbi+west · · Score: 3, Insightful
    Okay, can someone explain to me what it means to be to the right or left of another opperator? What is periodic about this table?

    The amazing properties of the periodic table was that you could predict properties of elements that had not yet been discovered, and this amazing property is of use today. For example, we can predict that, chemically, strontium makes a good calcium analog because they are in the same column, and we are right! Strontium is often found in bones where calcium normally is. (this was important when there was a lot of radioactive strontium in fallout and when it decayed it didn't hold the bone together as well.)

    Anyway way, for other properties, next-to relationships are importantand also allows for predictions to be made.

    1. Re:huh? by This+Is+Ridiculous · · Score: 2, Insightful

      There's no exact pattern, but in general similar operators are grouped together. For an example take a look at the bitwise/charwise/boolean and/or/xor, and the fact that xx (list repetition), x (string repetition), and * (multiplication--like number repetition) are in the same column. Additionally, True Operators below about the midline of the table tend to be lvalues (able to be assigned to), although that isn't quite consistent.

      By the way, there is at least one operator that this table predicts should exist: list concatenation. Well, except that you can just push the elements on to the end of the array, or use an idiom like @c=(@a, @b).

      (Hmm...could comma be considered the list concatenation operator?)

      --
      Hey, you try to find an open nick these days!
    2. Re:huh? by newhoggy · · Score: 1
      Computer scientists are conducting ongoing research into a number of elusive operators. For instance, the pattern exhibited by:

      = assignment, Bi,R 15 := run-time binding, Bi,R 15 ::= compile-time binding, assignment, Bi,R 15

      Have led them to conjecture the existance of the high level operators such as:

      :::=
      design-time binding, Bi,R 15
      ::::=
      before-time binding, Bi,R 15

      Other sought after operators include:

      ....
      infinite range, Po,L 4
      +/
      bitwise err, Bi,L 11
      inf
      infinitesimal, Qt
      '...'
      anon. string

      and so forth.

    3. Re:huh? by gumbi+west · · Score: 1

      great. What does this have to do with this "periodic table"?

    4. Re:huh? by MtnViewMark · · Score: 1

      In the main table, left-to-right expresses precedence (read the key, look at the numbers). Precedence runs tighter on the left and looser on the right. The only exceptions are the mirrored Assignegens, which are all at the same precedence.

      There are some other general relationships that can be deduced by the chart, many localized relationships, and as others in this thread have noted, some missing operators are clear.

      That being said, I originally did this chart as a goof. Of course, in the interests of making the best possible joke, I endeavored to make all the details accurate. But that put the whole enterprise on a slippery slope: Suddenly the chart was, gasp, useful!

      What is a designer to do? The joke is that the form and subject don't match. But once such a chart is useful (and indeed, it has sparked discussions in the Perl 6 Language mailing list), should I have changed the form? NO! On with the joke...

      - Mark

  44. consistency by Craig+Ringer · · Score: 1

    So long as **= is consistent with +=, -=, *=, and all the others in that vein then frankly it's quite fine.

    It's when you get large sets of operators that /don't/ fit an overlying pattern that I see trouble.

    As this argument seems to satisfy many, "Python does this too." I happen to think it's the right approach, and possibly less confusing than having some operators availible in <op>= form but not others. It's also worth noting that at least in Python, if I remember correctly the 'x += y" forms are more efficient than the "x = x + y" forms.

    When it comes to Perl 6, I'll be glad to see the alleged OOP support in Perl 5 torn out and thrown away. That way, if I ever have to venture back into Perl I won't find it /quite/ such a painful experience. Still, as a recovering Perl user currently revelling in the "oh, it all makes sense!" experience of Python, I hope never to have to do that at all.

    1. Re:consistency by multi+io · · Score: 1
      When it comes to Perl 6, I'll be glad to see the alleged OOP support in Perl 5 torn out and thrown away. That way, if I ever have to venture back into Perl I won't find it /quite/ such a painful experience. Still, as a recovering Perl user currently revelling in the "oh, it all makes sense!" experience of Python, I hope never to have to do that at all.

      Perl5's OO architecture is basically built on modules, bless and @ISA and can be explained exhaustively in about 5 sentences. Yet it is still quite useful.

    2. Re:consistency by This+Is+Ridiculous · · Score: 1
      Perl 5 OO is being thrown out in favor of a more developed system:
      #Derived is a subclass of Base; it imports members from
      # the role Role (sort of like a Ruby mixin)
      class Derived is Base does Role {
      #Read-only accessor automatically generated
      has $.publicvar;
      #Read-write accessor generated
      has $.pulicwritevar is rw;
      #No accessor at all
      has $:privatevar;

      method publicmeth($foo, $bar) { ... }
      method :privatemeth($baz) { ... }
      }
      --
      Hey, you try to find an open nick these days!
    3. Re:consistency by Craig+Ringer · · Score: 1

      I'm not claiming that it's not useful. I just find it horrible to work with.

  45. mod parent FUNNY by Anonymous Coward · · Score: 0

    Informative parent??? It's a joke! Mirror Mirror on the Larry Wall... cmon, moderators! not even a mirror link there! get with it!!!

  46. Perl, good and bad by Julian+Morrison · · Score: 1

    I used to like perl, I don't anymore, except for extremely transient glue code.

    The goodness of perl: it allows you to design and express the success mode of a program in a clean, compact and, if you are any good, also readable form.

    The badness of perl: it makes the task of mapping and trapping the potential failure modes of your program, pragmatically impossible. In particular this relates to "coverage": that for the full set of possible erroneous inputs, the program detects and cleanly handles the error. Loosely typed variables and various forms of DWIM cause a re-multiplication of complexity as each input passes through each operator. Bugs can of this sort can typically only be solved by trace logging, and there is no plausible way to be certain that none such remain.

    Compare this to something like eg: ocaml, where there is absolutely no ambiguity about types, where the transformations applied to the input are deterministic for a given type, and where incomplete coverage is a syntax error.

  47. The only one you need to know is .... by Anonymous Coward · · Score: 0

    PHP > Perl

    oh wait, the crack heads at Perl write it as

    PHP gt Perl

    1. Re:The only one you need to know is .... by Anonymous Coward · · Score: 0
      oh wait, the crack heads at Perl write it as

      PHP gt Perl
      You're thinking of bash. We crackheads would probably write it as:
      print join(" is better than ",sort{$b cmp $a}qw(PHP Perl))."\n";
  48. It's so embarrassing to reply to your own comment. by pedantic+bore · · Score: 1
    Why is "&&" different from "and"? Ditto for "||" and "or", etc.

    What I meant to write was "why are they the same? I'm still trying to figure out how to read this table. First I thought precedence went in one direction, then another, and now I doubt it's represented in the table. So never mind.

    --
    Am I part of the core demographic for Swedish Fish?
  49. PNGified Mirror by CTachyon · · Score: 1

    Since the PDF renders at a downright glacial pace, I rendered it with GhostScript at 75 DPI (actually at 300 DPI followed by an interpolated 0.25x scale, since I couldn't figure out how to get GS to do sub-pixel rendering). Anyways, here it is (174 KB). And may God have mercy on my server.

    --
    Range Voting: preference intensity matters
    1. Re:PNGified Mirror by dimss · · Score: 1

      Note that gs doesn't render this PDF correctly. I have the same problem too :( Look at two words above "Filinis".

  50. Hear hear! by BerntB · · Score: 2, Interesting
    I couldn't have written that better.

    Just one nitpick:

    but all of the fundamental mechanisms in lisp are present in perl as a strict subset of the language.
    That is, as far as I know, true for all but lisp macros. (Perl 6 changes that situation?)

    Lisp is the only language I'd rather use than Perl -- for most tasks.

    --
    Karma: Excellent (My Karma? I wish...:-( )
    1. Re:Hear hear! by This+Is+Ridiculous · · Score: 1

      Perl 6 has ridiculously powerful macros--they're essentially subs that are run at compile-time, which return either strings of code or fragments of parse trees. I believe that makes them about as powerful as Lisp's.

      Actually, in Perl 5, a mechanism called a source filter allowed you to modify the code (in string form) before Perl ever parsed it. It was a pain in the ass to use, but a few really cool things were done with it, like Damian Conway's Switch.pm module. Still, I wouldn't argue that it was anywhere near Lisp's level.

      Actually, considering that Perl actually has syntax, and that Perl 6 macros can go anywhere that Perl 6 subs can (e.g. creating new operators), you could argue that Perl 6 macros are more powerful than Lisp ones...

      --
      Hey, you try to find an open nick these days!
    2. Re:Hear hear! by BerntB · · Score: 1
      Actually, considering that Perl actually has syntax, and that Perl 6 macros can go anywhere that Perl 6 subs can (e.g. creating new operators), you could argue that Perl 6 macros are more powerful than Lisp ones...
      As a self confessed Perl fanatic it hurts, but I still have to disagree in the name of my integrity. :-)

      The feature with Lisp is that there are only simple parse trees -- so it's easy to analyze and modify code as a data structure.

      I do not believe it's possible for code to analyze code as easily in Perl as in Lisp -- because of the semantic and syntactical richness.

      That richness of expressiveness is what makes (at least me) love Perl because it's fun, but when analyzing and modifying code, it must be a disadvantage. Different optimizations.

      Please, do convince me I'm wrong! :-)

      --
      Karma: Excellent (My Karma? I wish...:-( )
    3. Re:Hear hear! by Dr.+Zowie · · Score: 1

      Yah, I was thinking of code prefilters in perl 5 -- but you're right, they're not as powerful as Lisp macros, since you don't get to work with the parse tree, only the source string.

  51. This is a beautiful diagram by dozer · · Score: 4, Interesting

    Excellent antialiasing, excellent fonts with good kerning, great drop shadows, lots of repititive work assembled pretty much flawlessly... This chart gets an A+ for style (which is pretty rare in the non-Mac Unix world).

    Does anybody know the tool Mark Lentcner used to make it? Illustrator? Could I be so bold as to hope that Sodipodi or Inkscape are now capable of something like this?

    1. Re:This is a beautiful diagram by jcbphi · · Score: 1

      This uses Zapfino with its alternate character shapes (which is included on OS X), and the embedded info in the PDF tells me it was created by printing to a file on OS X.

      Couldn't say what was used to create it though, perhaps the creator will be so nice to share. It doesn't really look like the work of Illustrator to me, but I could be wrong on that. Whatever was used to create it, it looks like mostly just a lot of hard work and attention to detail (ex choosing alternate character shapes on some of the titling fonts).

    2. Re:This is a beautiful diagram by barfy · · Score: 1

      Yeah except this was created on a mac... /Producer (Mac OS X 10.3.3 Quartz PDFContext)

      And judging from feature sets that were used, it was likely created in Adobe InDesign...

    3. Re:This is a beautiful diagram by MtnViewMark · · Score: 3, Informative

      Thank you for the kind comments.

      I used Omnigraffle 3 (standard edition) running on Mac OS X (10.3).

      - Mark

    4. Re:This is a beautiful diagram by toby · · Score: 3, Interesting
      lots of repititive work assembled pretty much flawlessly
      Except for the odd typo (e.g. in junctive elements) - not to disparage a neat, humorously executed piece of work and a clever idea.
      Could I be so bold as to hope that Sodipodi or Inkscape are now capable of something like this
      Hand-coded PostScript is quite capable of this :-) Certainly the PS greybeards pulled off even fancier things that way - 3D with hidden surface removal, etc.

      --
      you had me at #!
  52. Problem by Dizzle · · Score: 1

    The periodic table is useful in spotting trends in the elements. This table shows... no trends. It's just a loose grouping in a visual style resembling the periodic table.

    For example, going across a row shows that Atomic Radius decreases while the Electron Affinity increases.

    --
    -Dizzle
    "I most likely AM so interested in myself."
  53. unfortunately, you still have to READ others' Perl by mkcmkc · · Score: 5, Insightful
    you do not have to know these operators to use perl 6

    Unfortunately, you still have know these operators in order to READ Perl code written by other programmers.

    Perl 5 is already conceptually too large to use. Perl 6 just takes things completely over the top.

    Mike

    --
    "Not an actor, but he plays one on TV."
  54. Re:what is up with SPACES in the urls at slashdot? by KingAdrock · · Score: 1

    Just to clarifiy, it does split long URLS to avoid page horizontal page scrolling. It isn't an issue if the poster actually posts a linke with the URL.

  55. You got fooled! by grouse · · Score: 1

    The only official source for that was an April Fool's Day Press Release.

    The Parrot implementors plan for it to be able to run Python, but the current Python implementors have no current plans to switch development from C to Parrot.

    1. Re:You got fooled! by CTachyon · · Score: 1

      Um, no, actually. It started off as a joke at the time, but since then Parrot has actually turned into a a real project which will run Perl 6 and, eventually, Python and other interpreted languages. (The Perl folks are in much more of a hurry to ditch their spaghetti Perl 5 VM, so that's priority #1. :-P) But there's some strong rumblings in the Python community about the Python port in progress, there are quite a few references to JVM bytecode translation and a Scheme port, and I've seen unsubstantiated rumors of Ruby and PHP ports. True, the core Python community isn't planning a switch yet, but if someday down the road the standard Parrot distribution comes with a Python frontend, people might start flocking to it for the one-stop convenience.

      --
      Range Voting: preference intensity matters
    2. Re:You got fooled! by grouse · · Score: 1
      True, the core Python community isn't planning a switch yet, but if someday down the road the standard Parrot distribution comes with a Python frontend, people might start flocking to it for the one-stop convenience.


      Yeah, but you said Python plans to use Parrot. Which is simply not true, as you admit.

      I'm not sure what "strong rumblings in the Python community" means and the link you provided is even more confusing. But here's a hint: Dan Sugalski is not commonly recognized as a member of the "Python community" yet, but I am looking forward to seeing his finished work on Parrot, and Python integration.
    3. Re:You got fooled! by CTachyon · · Score: 1

      I admit I did have an overly strong impression of how much Parrot featured in Python's (particularly GvR's) current long-term plans. I was under the impression of a 2.5-going-on-3.0 timeline. Admittedly, I don't pay nearly as much attention to the Python community as I do to Perl (I've been getting itchy enough for Perl 6 that I've considered writing a toy Perl-like language that merged some 5 and 6 features).

      --
      Range Voting: preference intensity matters
  56. try this too... by dolmen.fr · · Score: 1
    Whether that's true or not, in perl:
    $ perl -e 'if ("3.0" eq "3") { print "true\n"; }'
    1. Re:try this too... by gorre · · Score: 1
      Whether that's true or not, in perl:
      $ perl -e 'if (3.0 eq 3) { print "true\n"; }' true
      --
      "Madness is something rare in individuals - but in groups, parties, peoples, ages it is the rule." -- Nietzsche
    2. Re:try this too... by gorre · · Score: 1

      oops forgot the
      but you get the picture.

      --
      "Madness is something rare in individuals - but in groups, parties, peoples, ages it is the rule." -- Nietzsche
  57. Perl is now a WMD! by Anonymous Coward · · Score: 0

    If small operators were to be fused or larger operaters were to be split, how much energy would be released?

  58. Is Perl becoming the 21st Century APL by WGR · · Score: 1

    I couln't help but laugh when looking at the Periodic table of the Operators and thinking of the criticisms of APL that it had too many operators and was a "write-only" language. At least APL had a simple precedence rule (all code to right has higher precedence and code in parentheses is evaluated first).

    APL differentiated between functions, which took values as operands, and operators, which take functions as operands to generate new functions. This seems something that Perl could do to help clean up the definitions of much of its syntax.

  59. The problem is that Perl6 ain't Perl5 anymore... by fprog · · Score: 0

    In Perl5, idioms were under control some how: We had stuff like regexp, match, search, translate. Context grouping keywords like q, qq, qw: for non-interpreter string, interpreted string, list context. The usual @_ $_ @ARGV $` $& $' $| variables, not including the other ones... Usual __END__ __DATA__ and similar. POD stuff =cut =head1 =item Stream operator = ) Some for slurping $a = ; @b = ; The rest was quite straightforward, except 'advanced regexp' syntax with backtracking that most people don't use, at least not without proper comments. The problem with Perl6 is that Perl5 code won't work anymore, everything you knew about Perl5 doesn't exist anymore, you need Ponie for one part and Perl6 for the remaining. It's like comparing Perl5 with Python. [or your favorite language]. It would have been better to introduce new keywords gradually without breaking source code that currently works, so people can use the new keywords as they need it, that would have create a more smooth learning curve. But currently, you have to learn a new language that has nothing to do with Perl5. Without looking further, assuming you are comming from Perl5 and that you have to maintain some Perl6 library, what does the following do: while ($s=$n.accept()) { print $s.gets; } if +(f($s+%hf)) == +$b { print; } $a = "abc"~$b~$c~$d~"def"~getVar($d); @a ^[{ $^a > $^b ?? 1 :: ($^a,$^b) := ($^b,$^a) }] @b; @b = + @c; @a = += @b; @b = + @c; @a = += @b; @a ^+= @b; @a v+= @b; Assuming you can see the > operator on your ASCII non-Unicode editor, instead of ?+?. Have fun!

  60. An "antiqued" version, perhaps? by jemenake · · Score: 1

    He used such a pretty script for some of the lettering, I'm surprised he didn't replace all 's's with 'f's like in old documents.

    Instead of "Assignegens", we'd have "Affignegenf". If you actually look at the PDF, you can see how cool it would look in the script he chose. :) .... and can I get mine on parchement, please?

    1. Re:An "antiqued" version, perhaps? by Anonymous Coward · · Score: 0

      Actually, that "f" you are refering to is a gothic s, and it isn't actually an f; the two letters are distinct. The s lacks the bar that f has. I always knew studying Old German would eventually be useful!

  61. Perl = Programmers Early Retirement Language by ffallen · · Score: 1

    It will happen in one of two ways:

    Programmer writes gobs of Perl code and employer is scared to let anyone else touch it, thus ensuring Job Security (much like C++).

    *OR*

    Programmer writes gobs of Perl code under employer instruction and so, goes rapidly insane trying to maintain his own nightmare.

    Either way, both retire to a trailer and a bait shop, the ultimate goal for all geeks when they get tired of constantly retraining, competing with cheaper labor, working too many hours, and avoiding sex through no fault of their own.

    1. Re:Perl = Programmers Early Retirement Language by jcuervo · · Score: 1
      Programmer writes gobs of Perl code and employer is scared to let anyone else touch it, thus ensuring Job Security (much like C++).
      The guy I took over for in January tried that, or so it would seem. Didn't work for him. I pretty much replaced everything he ever wrote with two programs (as opposed to *checks* his twelve -- there's your nightmare).

      As for the programs I replaced him^Whis stuff with, well, I sure as hell wouldn't want to have to walk into them off the street, but someone would be able to figure 'em out after not too long. There's even a decent amount of perlpod in there.
      Programmer writes gobs of Perl code under employer instruction and so, goes rapidly insane trying to maintain his own nightmare.
      Maintaining my own code is easy. Waking up before noon is hard.
      --
      Assume I was drunk when I posted this.
  62. comparison blues by mangu · · Score: 1

    Another problem is, how do you order two variables containing, for instance, 9 and 19? Alphabetically, "19" comes before "9", numerically, 19 is bigger than 9.

  63. Whoa. by Anonymous Coward · · Score: 0

    That's the first PDF it's taken xpdf more than 10 seconds to open.

    That means something, I think.

  64. misspelled name by soundofthemoon · · Score: 1

    The submitter, mAsterdam, has misspelled the name of the chart's author. It's Lentczner, not Lentcner. That's T as in "Tsar", C as in "Czar", Z as in "Zorro". (Yes, this is a very inside joke.)

  65. In support of large languages by smishra · · Score: 2, Interesting
    English (or your native language) is a large language. Very few of us can claim to know it all. However we all use it and are comfortable with it.

    The problem with large languages is not that they are large but that it is very difficult to arrive at a consistent useful description. Our modern languages have evolved over a very long time. A modern theory is that the capacity for language is hardwired into our genes and is the primary differentiator of humans from animals.

    Programming lanaguages on the other hand are small. While Turing completeness may imply that all languages are equivalent, it is easier to interface with languages that most closely match the domain being modelled and are closer to the way we humans think.

    For all this the large number of operators in Perl are not bad as long as they are internally consistent and consistent with the way we think.

  66. Re:The problem is that Perl6 ain't Perl5 anymore.. by This+Is+Ridiculous · · Score: 1
    First of all, let's bring your code up to date, and clean it up to something someone might actually write:
    while ($s=$n.accept()) {
    print $s.gets;
    }
    #What's being printed? $_ isn't being set
    # anywhere.
    print if f($s+%hf) == $b;
    $a = "abc"~$b~$c~$d~"def"~getVar($d);
    #I don't know what construct you think that was,
    # or why you were making some of the assumptions
    # you did, but here's how that would really be
    # written. (I almost used map, but you don't do
    # that in void context--it's wasteful. This is
    # a Perl 5 style rule that carries over to 6.)
    for zip @a, @b -> $a is rw, $b is rw {
    $a > $b ?? 1 :: ($a, $b) := ($b, $a);
    }
    @b = + @c;
    #Syntax error on the next line.
    @a = += @b;
    @b = + @c;
    #Syntax error.
    @a = += @b;
    @a >>+=<< @b;
    @a >>+=<< @b;
    Now, as best as I can figure, here's how a decent Perl 6 hacker would write it:
    while ($s=$n.accept()) {
    print $s.gets;
    }
    print if f($s+%hf) == $b;
    $a = "abc" ~ $b ~ $c ~ $d ~ "def" ~ getVar($d);
    # or $a="abc$b$c${d}def&getVar($d)", perhaps.
    for zip @a, @b -> $a is rw, $b is rw {
    ($a, $b) := ($b, $a) unless $a > $b;
    }
    @b = +@c;
    #Not touching this till I know what it is.
    @a = += @b;
    @b = +@c;
    #Likewise.
    @a = += @b;
    @a >>+=<< @b;
    @a >>+=<< @b;
    Now, if I may demonstrate something a bit more realistic:
    #Log analysis script.
    use Apache::ParseLog <<parse_lines>>;

    my(%goodbad) = part {
    given (.status ~~ /(\d)\d\d/)[0] {
    when 2|3 { 'good' }
    when 1|4|5 { 'bad' }
    'malformed';
    }
    } parse_lines(open "access_log" or die);

    say "Successful Requests: ", +%goodbad{'good'};
    say "Unsuccessful Requests: ", +%goodbad{'bad'};
    The only parts that need much explaining are that (a) part is a built-in that divides a list up into categories; (b) given/when is a switch construct; and (c) say is how Perl 6 spells "printline". While there are some new operators in there, their meaning is fairly intuitive.

    The rest should be reasonably clear to a Perl 5 hacker. Note that the weird parts were not the operators--they were new functions, each of which added some new functionality to Perl.
    --
    Hey, you try to find an open nick these days!
  67. INTERCAL extension to Perl by Teancum · · Score: 1

    In (almost) all seriousness, I thought I saw a Perl extension that included the INTERCAL interleave, select, unary and, or, & xor. Basically all of the unique Intercal operators. I think that would have to be a whole new column in this periodic table if they were included. It has been demonstrated that you can perform all normal calculations using these operators, but it does produce some messy code if you want to do "ordinary" bit manipulation. There are time I do wish for a select operator in my favorite compiler.

    This table doesn't have the overprinted characters (that have two characters symbols printed in the same space, like the cents symbol (aka "change"), or the hookwork (which I though was its own EBDIC symbol on the old IBM 370's, but I might be mistaken). I know this is a /. limitation, and not an oversight on your part.

  68. Re:Operators considered optional. IT'S OWN HEADING by Nom+du+Keyboard · · Score: 1
    a few days ago while reading slashdot, the little "fortune" quip at the bottom of a pageload was "'So far, we've managed to avoid turning perl into APL' -- Larry Wall". Maybe that one should be expunged from the database... ;)

    You bury the best piece at the very end of a nice post. This deserved to have a post of its own. :^)

    --
    "It's the height of ridiculousness to say for those 9 lines you get hundreds of millions."
  69. Re: Unidentified flying operator: SPACESHIP by khamar · · Score: 1

    Truth is stranger than fiction. The equality operators in perl:

    Numeric, String, Meaning
    == eq Equal To
    != ne Not Equal To
    <=> cmp Comparison

    This is called the spaceship operator:

    <=>
    --
    The first dog barks. All other dogs bark at the first dog.
  70. English IS as write-only as Perl can be. by Roman_(ajvvs) · · Score: 2, Insightful
    When it comes to people who were never taught set theory (which subsets is part of) or the common use of the term 'programs' in computing, then yes; English is a write-only language. People who use english as a second language come to mind as an immediate example.

    Using a relatively obscure subset of Perl is akin to using jargon in a paper. Noone but those "in the know" would fully understand what on earth you're on about. When you want to make yourself understandable to a wider audience it is at times (unfortunately) necessary to lower your vocabulary to the lowest common denominator. But with most programmers being less than adept at social interaction, this concept doesn't get applied to writing code very often.

    Which brings us back to this periodic table. It's use is to create a common vocabulary. Chemists use the periodic table as a common framework, so people can understand eachother when they're talking about materials. Sodium (English) = Natrium(dutch) = Na. Most chemistry specialists would identify Na. Not many dutch chemists would easily identify "Sodium". If you had to make sure someone understood you, what would you use? I hope that this table gets wider recognition.

    --
    click-clack, front and back. I'm not moving this car otherwise.
  71. I think perl is going to die soon. by smell_the_glove · · Score: 1

    Looking at this "periodic table" of operators reinforced my view that perl is not going to last much longer as a real player in computer languages. There is a complexity threshold in computer languages which, once exceeded, makes people not want to use the language any more. Perl 5 was already pushing that threshold pretty hard, and now perl 6 has just got right off the deep end. Most people are just going to switch to python (I did a long time ago, and never looked back). And even python is getting too complicated!

    I think what language designers forget is that humans have to learn that massive rule set before they can use the language effectively (not to mention in order to read other peoples' code). What they should do instead of piling on features is to provide ways for users to add their own features if necessary (provide meta-features if you will). So, for instance, in Haskell you can define your own operators, which have to consist of characters from a predefined operator set. If you are reading Haskell code and see an operator which is not familiar, it's probably part of the application and you know where to look for its definition. Also, you can use any binary function as an operator by surrounding it with backticks. Simple, and no periodic table needed. In lisp or scheme this issue doesn't even come up, because there is no difference between functions and operators at all.

    I think computer languages should be judged not so much by how many features they have but by how many features they allow users to add for themselves.

  72. You do want to provide standard features by smishra · · Score: 1
    This would imply that each user would have to reinvent large portions of what they need.

    The real trade offs are between the portions that are made available as libraries and the portions that are made available as core features of the language.

    When choosing a language for a commercial project the out of box ability to solve a large part of the problem is a big factor.

  73. Typing Versus Discipline by chromatic · · Score: 1

    I'm not sure that Java is strongly typed, though. For example, if I didn't know better, I'd expect that Java containers would hold type information. At least C++ generics allow this. (Java generics don't count. If all I wanted were shorter code without any kind of compile time safety, I could write my own preprocessor to cast to and from Object!)

    I think that's not the real issue though.

    I can find you dozens of Perl programs that use global variables willy-nilly, have no documentation, expose a wide range of security problems, have massive code duplication, reinvent well-known wheels badly, and show no evidence of design, maintenance, or care.

    I'm not sure how static typing can fix any of those problems.

    I can also find you dozens of Perl programs that have comprehensive test suites, well-factored code, sane and useful documentation, and well-designed APIs which have had code contributions from multiple authors.

    Again, I'm not sure that dynamic typing worked against those projects. In fact, I personaly find it much easier to write test code in languages that allow allomorphism!

    I agree that there's terrible code in serious systems and that people ought to be more careful and disciplined. I disagree that static typing is the way to enforce that. If you're worried what novices might do with powerful features, I think it's better to teach them how and when to use those features well than to remove those features from the language, where even the experts can't use them.

  74. html sucks by boots@work · · Score: 1

    Should have been:

    I think part of the definition of the real number field is that for any x < y there is a value z s.t. x < z < y

    29.999... - 2.99... = 10x - x

    I don't think you can just sling around decimal fractions like that without treading close to a division-by-zero fallacy. It's been too long since I did serious math for me to be able to prove it.

    I think all you have proved is that the limit of 2.9999... is 3, which is obvious.

    If you think you have done otherwise, please write it without relying on decimals.

    IIRC there is also a relatively simple proof involving Cauchy sequences.

    But it won't fit in this margin? :)

    1. Re:html sucks by gorre · · Score: 1

      I think all you have proved is that the limit of 2.9999... is 3, which is obvious.

      2.999... denotes the limit. The proof I reproduced in my previous comment is just an informal one intended for the general audience on slashdot, if you want a more rigorous proof I'm sure Google would oblige. This may satisfy you. I am only an undergraduate maths student and not an expert, but my professor would certainly mark me wrong if I said 0.999... != 1 in an exam.

      --
      "Madness is something rare in individuals - but in groups, parties, peoples, ages it is the rule." -- Nietzsche
    2. Re:html sucks by boots@work · · Score: 1

      I would be interested to hear whether your prof says "2.9999 is *exactly* equivalent to 3." I don't know for sure, though it seems like you can make a distinction between them.

    3. Re:html sucks by gorre · · Score: 1

      If you say 2.999... is not the same as 3 you are getting into some pretty weird mathematics or as Cantor would say: you are "infect[ing] mathematics with the Cholera-Bacillus of infinitesimals."

      PS. please reply so I can take that scan down once you have read it, thanks :).

      --
      "Madness is something rare in individuals - but in groups, parties, peoples, ages it is the rule." -- Nietzsche
    4. Re:html sucks by boots@work · · Score: 1

      I think this is how I would put it (as a humble engineer, not a maths postgrad): generally of course we can say that 2.9999.. = 3. Sometimes we want to make the distinction, even if Cantor disapproves. Even if the limit = 3, the *concepts* of "3, exactly" and "the limit of 2.99999..." can be distinguished.

      Thanks for the information!

  75. Re:The problem is that Perl6 ain't Perl5 anymore.. by fprog · · Score: 0

    Well, the problem is that the unicode << >> tags
    didn't display correctly, and that will be a problem with Perl6 among all the other Unicode
    and other charset being used.

    Ok, another:

    #!/usr/bin/perl

    use IO::Socket::INET;
    $n=IO::Socket::INET->new(LocalP ort=>20010,Listen=>5);
    $n->listen();
    while(($s=$ n->accept()))
    { print <$s>; close $s; }

    Perl 6:

    #!/usr/bin/perl

    use IO::Socket::INET;
    my IO::Socket::INET $n = (LocalPort=>20010,Listen=>5);
    $n.listen();
    while ($s=$n.accept())
    { $stdout.print($s.getlines); $s.close; }

    $s is a socket, but the thing is at first sight,
    when I read this, I saw string concatenation...

    print if f($s+%h<<f>>) == $b;

    is what should have been seen if tags worked,
    which is print $_ if f( taking the addition of two scalar one from $s the other from the hash %h
    key "f" is equal to $b in numerical context.

    $a = "abc"~$b~$c~$d~"def"~getVar($d);

    is equal to this in Perl5:

    $a = "abc".$b.$c.$d."def".getVar($d);

    @a ^[{ $^a > $^b ?? 1 :: ($^a,$^b) := ($^b,$^a) }] @b;

    This in place comparision thingy can be found
    explained on perl.perl6.language

    I agree that we have $^a $^b in Perl5.

    The others one which didn't print
    is all the possible <<+>> >>+<< scenarios.

    @b = >>+<< @c;
    @a = >>+=<< @b;
    @b = <<+>> @c;
    @a = <<+=>> @b;
    @a ^+= @b;
    @a v+= @b;

    http://groups.google.com/groups?threadm=200 21101113810.B7568%40rama.comp.pge.com

    Not mentioning the abuse of .= scenarios and others like the Yen operator instead of zip...

  76. Unicode? by pluvia · · Score: 1
    Did they finally run out of characters for their operators? Is anyone else concerned that Perl is branching beyond the standard set of keyboard characters for their core language?

    From Synopsis 3: Summary of Perl 6 Operators:
    qw{ ... } gets a synonym: ... . For those still living without the blessings of Unicode, that can also be written: << ... >>.
    . . .
    zip has an infix synonym, the Unicode operator ¦.
    Unfortunately, /. will not display the unicode equivalent to << ... >>. Also note that '¦' is not a pipe '|', though the former is what the pipe key looks like on my keyboard.

    Granted, these are still ASCII (>128) and currently just synonyms, but branching to unicode characters seems like a bad omen to me. Then again, IANA Perl programmer, so maybe I'm just blind to the joys of terse hieroglyphic code.
  77. Re:It's so embarrassing to reply to your own comme by MtnViewMark · · Score: 1

    Precedence runs from almost strictly left-to-right as tightest-to-loosest. The op= forms are the only serious exception. The precedence for each operator is given a numeric value in the upper right.

    Note: The Perl 6 language is under active design. While these are the current set of operators, the precedence levels have not been set or even been largely discussed. Therefore, the precedence levels are mostly my own guesses. (Oops, I suppose this post outs me as the author!)

  78. Hilarious! by nosferatu-man · · Score: 1

    Nicely done, sir!

    'jfb

    --
    To spur "enterprise Linux," Big Bang, the distributed two-phase commit.
  79. Missing op? by Anonymous Coward · · Score: 0

    Am I just reading an old copy? I just noticed that there's no "as" operator. I seem to recall Larry recently mentioning "as" for casting. Am I wrong?

    aQazaQa

    1. Re:Missing op? by This+Is+Ridiculous · · Score: 1
      Am I just reading an old copy? I just noticed that there's no "as" operator. I seem to recall Larry recently mentioning "as" for casting. Am I wrong?
      Not old per se--just one the author missed. You are right--the 'as' operator ("(expr) as (class)") was introduced with Apocalypse 12, along with the entire type system and classes and objects.
      --
      Hey, you try to find an open nick these days!
  80. As the Author... by BerntB · · Score: 1
    I believe the diagram would be much more useful with a colour difference, or something, added to indicate something new for Perl 6?

    If you have put all the time into it already, a few hours more wouldn't hurt that much... pretty please?

    (-: Then it wouldn't be as good an example for the Perl-hating crowd, either. :-)

    --
    Karma: Excellent (My Karma? I wish...:-( )
  81. MOD PARENT UP! by Anonymous Coward · · Score: 0

    +1 Informative!

    C'mon, do it as a joke, and so people make make lame posts complaining about "moderators on crack" and so forth.

  82. Mod parent up! by Julian+Morrison · · Score: 1

    For inventing operators that perl might actually have in version 7!

  83. You can already do that by Julian+Morrison · · Score: 1

    It's called "isotopes".

  84. Re:unfortunately, you still have to READ others' P by asuffield · · Score: 1

    I manage to use perl just fine. And I either knew the answers to all those offhand, or I could tell you why you shouldn't write code like that in the first place.

    Argument trivially refuted by counterexample.

  85. Re:Some of these have a halflife of a few nanoseco by hummassa · · Score: 1

    "Many of them should IMHO not be operators;"
    I humbly disagree. Perl (and Perl6, by extension) use the concept of Huffman-encoding source (if something is done many times, it should be trivial to write and read, with the least keystrokes possible);

    I prefer:

    do_something if -r 'file.txt'

    To:

    if( readable_file("file.txt") ) {
    do_something();
    }

    and having to implement readable_file as some other stuff.

    --
    It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
  86. Table of Condiments That Periodically Go Bad by devphil · · Score: 1


    An even better table: http://web.mit.edu/dryfoo/www/Info/condiments.ht ml

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  87. Re:unfortunately, you still have to READ others' P by doofusdan · · Score: 1
    > Perl 5 is already conceptually too large to use.

    Then how on earth did I ever manage to use it?

    This statement reminded me of the Douglas Adams quote about people who prove black is white and then get run over at the next zebra crossing.

  88. Re:Some of these have a halflife of a few nanoseco by BerntB · · Score: 1
    if something is done many times, it should be trivial to write and read, with the least keystrokes possible
    I agree. File tests are important -- but not that important! I would (if not considering Perl 5 compatibility) do something like open().

    foobie_bletch() if test_file("foobar", "+r");

    Seems more orthogonal.

    But less compatible with shell programming, of course... hmm. I'm not certain, on closer consideration.

    --
    Karma: Excellent (My Karma? I wish...:-( )
  89. pretty by jadewang · · Score: 0

    It's very pretty. You should be proud.

  90. Re:unfortunately, you still have to READ others' P by mkcmkc · · Score: 1
    ---Perl 5 is already conceptually too large to use.

    --Then how on earth did I ever manage to use it?

    I'm not asserting that it's impossible to write programs in Perl. That would be silly, of course.

    The question I'm talking about is the relative difficulty of writing well-engineered software in some problem space--i.e., relative to the other languages available.

    (I programmed in Perl for a number of years, and I think it was a great step forward in its day and that we owe Larry Wall a great debt. But, I also think Perl's day is (and should be) done, unless a great deal of accreted junk can be jettisoned.) My opinion, of course.

    Mike

    --
    "Not an actor, but he plays one on TV."
  91. Re:unfortunately, you still have to READ others' P by ChaosDiscord · · Score: 1
    Perl 5 is already conceptually too large to use.

    It's a darn sight smaller than English, and you seem to manage that reasonably well.

  92. Re:unfortunately, you still have to READ others' P by mkcmkc · · Score: 1
    [Perl]'s a darn sight smaller than English, and you seem to manage that reasonably well.
    True, but there's no obviously superior alternative to English, for the things I need English for. And no one gets hurt when I flub my English.

    Mike

    --
    "Not an actor, but he plays one on TV."