Slashdot Mirror


PHP Gets Namespace Separators, With a Twist

jeevesbond writes "PHP is finally getting support for namespaces. However, after a couple hours of conversation, the developers picked '\' as the separator, instead of the more popular '::'. Fredrik Holmström points out some problems with this approach. The criteria for selection were ease of typing and parsing, how hard it was to make a typo, IDE compatibility, and the number of characters."

523 comments

  1. Going back to DOS style... by joaommp · · Score: 5, Funny

    ... and comming full circle.

    1. Re:Going back to DOS style... by Dogtanian · · Score: 0, Troll

      Going back to DOS style...

      No; DOS used the backslash as a directory separator (since- apparently- someone had permitted forward slash to be a legal filename character before subdirectories had been introduced).

      AFAIK PHP uses the forward slash for that purpose (or does this depend upon the server/OS it's running under?) Either way, namespaces have nothing to do with the infamous DOS usage.

      --
      "Slashdot - News and Chat Sites Deviant". (Click "homepage" link above for details).
    2. Re:Going back to DOS style... by Anonymous Coward · · Score: 4, Informative

      Uhm no. Because the DOS commands used '/' for indicating options as opposed to the '-' of the UNIX world.

    3. Re:Going back to DOS style... by larry+bagina · · Score: 2, Informative

      which was based on CPM and VMS.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    4. Re:Going back to DOS style... by joaommp · · Score: 5, Funny

      Jeez, take a joke as it is, will you?

    5. Re:Going back to DOS style... by lysergic.acid · · Score: 1

      what exactly is Pikiwedia? just a static non-editable version of Wikipedia? it looks exactly like Wikipedia but with all collaborative editing features/links, Wikipedia branding, and basic navigation elements(i.e. search) removed.

      the content is copied directly from Wikipedia, and though it doesn't seem completely up to date, it's only about a month outdated. therefore it's not completely static, so you wouldn't be able to cite Pikiwedia pages as a fixed source any more than you could Wikipedia.

      at least Answers.com adds additional content/features (dictionary results & pronounciation audio clips) to the Wikipedia articles--and they also have a search feature. frankly, i don't see what value Pikiwedia has aside from being yet another Wikipedia mirror.

    6. Re:Going back to DOS style... by The+Bender · · Score: 2, Insightful

      Geez, you have a website that just mirrors Wikipedia and dumps google ads all over it? You must be some kind of a business genius. Particularly since you seem to think that spamming /. will get you clicks. Bandwidth usage and hatred maybe, but clicks, nope.

    7. Re:Going back to DOS style... by NemosomeN · · Score: 1

      I was wondering the same, Google helped very little, maybe lower bandwidth? Seems useless to link to. Not sure why Wikipedia is mirrored so often, what is Wikipedia's uptime? I'd be shocked if it were below 99.9%, maybe even a 5-niner.

      --
      I hate grammar Nazi's.
    8. Re:Going back to DOS style... by Anonymous Coward · · Score: 0

      It isn't much of a stretch to consider a subdirectory as a namespace for file names. It's hard to believe now, but back then we had plenty of systems with no directory support - all files had to have a unique name. In this context, a subdirectory was a wonderful new feature, with much the same advantages as a namespace has in programming.

    9. Re:Going back to DOS style... by Hadlock · · Score: 1, Redundant

      Unless you live in china! In which case you'll need to find a mirrored copy of TOR (the onion router) to even be able to ping Wiki. As recently as last august Wikipedia was completely stonewalled in China, along with most western news sites.

      --
      moox. for a new generation.
    10. Re:Going back to DOS style... by Anonymous Coward · · Score: 1, Informative

      I was wondering the same, Google helped very little, maybe lower bandwidth? Seems useless to link to. Not sure why Wikipedia is mirrored so often, what is Wikipedia's uptime? I'd be shocked if it were below 99.9%, maybe even a 5-niner.

      Pikiwedia (unlike Wikipedia) is plastered with adverts, which I suspect is the reason for its existence, along with most other unofficial WP mirrors. WP provides a ready source of content to attract eyeballs. That's it; it's for their benefit, not yours.

      Maybe I'm being cynical, but there's not even a search box on the site (perhaps because it doesn't include all the WP content anyway). It even copies the "welcome to Wikipedia" message on its front page.

    11. Re:Going back to DOS style... by andymadigan · · Score: 1

      Actually, while I was loading that page I saw "waiting for en.wikipedia.org" so some of their stuff is still coming from there, further reducing its utility as a mirror.

      --
      The right to protest the State is more sacred than the State.
    12. Re:Going back to DOS style... by maxume · · Score: 1

      You can refer to a specific version of a Wikipedia page by url. For instance:

      http://en.wikipedia.org/w/index.php?title=Help:Page_history&oldid=246972212#Linking_to_a_specific_version_of_a_page

      It still isn't really something that should be used a reference though.

      --
      Nerd rage is the funniest rage.
    13. Re:Going back to DOS style... by ultranova · · Score: 1

      AFAIK PHP uses the forward slash for that purpose (or does this depend upon the server/OS it's running under?) Either way, namespaces have nothing to do with the infamous DOS usage.

      Actually, as namespaces serve the same purpose as directories, it seems that this usage is identical to the DOS usage.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    14. Re:Going back to DOS style... by eulernet · · Score: 2, Funny

      Scroll your screen to see the animation:

      \
      -
      /
      |

    15. Re:Going back to DOS style... by Ed+Avis · · Score: 1

      Nope, it's because DOS (following VMS convention) used slash for options. For example DIR/OD to sort by date. AFAIK, all versions of DOS (since 2.0) and Windows have accepted both \ and / as directory separator, although many userland applications may insist on \.

      --
      -- Ed Avis ed@membled.com
    16. Re:Going back to DOS style... by hvm2hvm · · Score: 1

      Well namespaces could be viewed as some sort of directory, a folder of classes or something. I saw the link right away and if you ignore the fact that most languages use :: as the separator I think it's an intuitive enough operator. Anyway, like others said it was a joke, you don't have to take it seriously.

      --
      ics
    17. Re:Going back to DOS style... by billcopc · · Score: 2, Insightful

      So how do you like scamming your ads off of Wikipedia's content ?

      Just when I thought the human race couldn't get any more pathetic, I get proven wrong.

      --
      -Billco, Fnarg.com
    18. Re:Going back to DOS style... by tepples · · Score: 1

      So how do you like scamming your ads off of Wikipedia's content ?

      Answers.com does the same thing. A lot of these mirrors with ads are still up even when Wikipedia has an error page.

    19. Re:Going back to DOS style... by Z00L00K · · Score: 1

      And the backslash is one of the most stupid characters you can select when it comes to non-US keyboards. It's on the AltGr+'+' key on the Swedish keyboard for example.

      And the backslash is also used to quote several different control characters like \r for carriage return \n for newline etc.

      The level of stupidity is taken to a new level. This is one more reason to avoid PHP.

      If now someone could convince Microsoft to abandon the backslash for the forward slash too...

      --
      If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    20. Re:Going back to DOS style... by Hal_Porter · · Score: 1

      That's a service

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
    21. Re:Going back to DOS style... by joaommp · · Score: 1

      apparently, not to all non-US keyboards... on the Portuguese keyboard, it's the key below the ESC, just left to the 1

    22. Re:Going back to DOS style... by NemosomeN · · Score: 1

      Oops, I always forget that I have adblock installed. I only very recently started using it (I wish I could easily select "annoying ads" to block. I don't mind most, but don't blast me with pop-unders, flash ads, etc.). Maybe that's why I had trouble seeing its utility.

      --
      I hate grammar Nazi's.
    23. Re:Going back to DOS style... by tagger1948 · · Score: 1

      The "/" was used in MS-DOS command lines to identify a "switch" (UNIX calls 'em "options" and uses a dash character). MS had a bunch of DEC & DG type coders there back when DOS was developed, and that's how they did it at DEC. Using the "\" as a pathname separator was a huge mistake because UNIX used "/" and all it did was to confuse a whole generation of college kids who grew up on UNIX.

    24. Re:Going back to DOS style... by badpazzword · · Score: 1

      Hate to break it to you, but typing ~ or ` on an Italian keyboard (with the Windows key set) require Alt+asciicode. That's much worse ;)

      (On Ubuntu it's AltGr-í and AltGr-' respectively.)

      --
      When ideas fail, words become very handy.
  2. what wrong with by netdur · · Score: 0, Offtopic

    dot?

    php now is anti-slash dot?

    --
    "Steve Jobs invented the world" -- Bill W. GATES
    1. Re:what wrong with by FooAtWFU · · Score: 2, Funny
      Slashcode runs off of Perl. They must hates it with a passion.

      [sic]

      --
      The World Wide Web is dying. Soon, we shall have only the Internet.
    2. Re:what wrong with by anotherone · · Score: 4, Insightful

      PHP uses the . as the concatenation operator. PHP does not support operator overloading...

      --
      Username taken, please choose another one.
    3. Re:what wrong with by mysidia · · Score: 2, Informative

      PHP uses the . as the concatenation operator. PHP does not support operator overloading...

      You don't need operator overloading. To use the same symbol in different contexts.

      You need a parser worth its salt.

      a.one = $b.two . $a.one

      Only has one use of the concatenation operator if 'a' and 'b' are namespaces.

      A good convention is to simply require space around the concatenation operator. Or to require both operands meet the lexical conventions of a variable or string constant, for it to be interpreted as a concatenation.

      I.e. $X = $A . $B

      Is a concatenation

      $X = $A.$B

      Is a parse error

      $X = $A.B

      Is an assignment of 'X' to the 'B' variable within the 'A' namespace

    4. Re:what wrong with by moderatorrater · · Score: 4, Insightful

      The whole purpose behind using '.' as string concatenation instead of '+' is that it eliminates ambiguity. What you're suggesting throws the ambiguity back in. Remember, if it's more complex for the parser to understand, it's more complex for a human to understand. As a programmer who moves between PHP and Javascript a lot, I can tell you that I miss being able to use a dot for objects when I'm in PHP, but the ambiguity in string concatenation/addition in javascript is an order of magnitude more annoying.

      I suspect they're doing the same thing with namespaces. The backslash isn't used for anything except escaping strings, and I doubt that's going to add any ambiguity at all. There are a lot of problems with PHP, and it's well worth your ridicule, but making sure that separate operations have separate operators isn't one of those problems.

    5. Re:what wrong with by mysidia · · Score: 2, Interesting

      The backslash isn't used for anything except escaping strings, and I doubt that's going to add any ambiguity at all.

      Oh?

      What's this going to mean?

      namespace X;
      class n{
      }
      $X\n->r = "B";
      Then later....

      $X="S";
      echo "$X\nn->r\n";

      Doing string interpolation unambiguously will be a PITA, since \ has special meaning inside a string.

      Does the "\n" delinate the end of the identifier and a carriage return, or is it being used as a namespace separator?

      I don't think they're making parsing all that easy.

      At least with lexical rules and a . operator, things can be well-defined, and not break other features of the language.

    6. Re:what wrong with by moderatorrater · · Score: 5, Informative

      As I remember, everything more complex than just outputting the value of the variable (ie calling a method, accessing a property, etc) requires you to use brackets inside of the string. Namespaces would work the same way without adding any complexity that wasn't already there.

    7. Re:what wrong with by shutdown+-p+now · · Score: 1

      As a programmer who moves between PHP and Javascript a lot, I can tell you that I miss being able to use a dot for objects when I'm in PHP, but the ambiguity in string concatenation/addition in javascript is an order of magnitude more annoying.

      That's actually one thing D got right - using binary "~" for string and array concatenation was both new for a curly-braces family language, not easy to confuse (unary "~" is not used that often), and has a mnemonic definition (it's called the "rope", and ties strings together).

    8. Re:what wrong with by mysidia · · Score: 2, Interesting
      Actually, no. You can do the following:

      <?
      class Q{
      };
      $Q->n="B";

      echo "$Q->n\nS";
      echo "$Q$Q+$Q\nX->n\n";
      ?>

      And the output in PHP 4.4.8 (version of PHP distributed in stable OSes) is:

      B
      SObjectObject+Object
      X->n

      Just like one would expect....

    9. Re:what wrong with by hvm2hvm · · Score: 1

      Well you could avoid using a variable inside a string since that gives ambiguity already. It's a feature that helps in simple cases that would be simple enough to do without it but complicates too much big projects. Just concatenate them with that fancy operator . everyone is talking about.

      --
      ics
    10. Re:what wrong with by Anonymous Coward · · Score: 0

      The whole purpose behind using '.' as string concatenation instead of '+' is that it eliminates ambiguity. What you're suggesting throws the ambiguity back in.

      No, '.' is used because PHP is weakly typed. Whether to add or concatenate HAS to be specified by the programmer because unlike in strongly-typed languages (e.g. Java), there's no way for the interpreter to know which you want.

      The backslash isn't used for anything except escaping strings, and I doubt that's going to add any ambiguity at all.

      Epic failure. An ambiguous example is even linked in the summary. For starters it causes tremendous confusion in reflection; for instance if you have a namespace Foo containing a class tBar, then a string reference written 'Foo\tBar' or "Foo\\tBar" is correct, whereas "Foo\tBar" is an error as the double-quotes cause a tab character to be escaped. How awful is that?

      Remember, if it's more complex for the parser to understand, it's more complex for a human to understand.

      The above example points out the fallacy in this argument. It is trivial for a parser to understand it as it isn't actually ambiguous, but it is extremely confusing and error-prone for humans reading the code. It sounds more like \ was chosen because it is easier to write the interpreter, and to hell with maintainability of code.

    11. Re:what wrong with by Anonymous Coward · · Score: 0, Flamebait

      Just like one would expect....

      Except that it's lousy parsing. PHP should never have allowed anyone to expect that in strings, given that it HAS the ${...} construct.

      It's just a shitty shortcut that's lived forever, like how text that isn't a function and isn't in quotes is a string anyway, which is what makes $foo.one impossible, because it would be parsed as $foo . "one".

    12. Re:what wrong with by mysidia · · Score: 1

      Use of that fancy concat operator . makes things less readable.

      Sorry... echo "Hello, $name, I am a fancy computer. How is $othername ?\n";

      Is much simpler, clearer, and more convenient to write than echo "Hello, " . $name . "I am a fancy computer. How is " . $othername . " ?\n";

      And avoiding the useful feature (string interpolation) still doesn't resolve ambiguities that are created when other programmers already have or will use string interpolation.

      String variable interpolation is a convenient feature PHP has taken from perl and the shell.

      And its availability and similarities to perl and the shell is part of what has made PHP so popular.

      So to make it not work in a consistent convenient way at this point that doesn't break other programs would be unfathomable.

      And by the way, using ${} brackets is inconvenient.

      It seems pretty clear that use of \ as namespace separator is a mistake. There are better choices like ':' which are even more proven for use in C-like languages.

      PHP is reinventing the wheel, but they're making this one square.

    13. Re:what wrong with by hvm2hvm · · Score: 1

      It is more readable from a non-programming point of view. But if you are searching for a bug in your script then having everything modularized and atomized as much as possible can help you spot the problem. If on the other hand you have to question simple syntax your search is going to be slower.

      --
      ics
    14. Re:what wrong with by Domstersch · · Score: 1

      require both operands meet the lexical conventions of a variable or string constant, for it to be interpreted as a concatenation

      Yeah? By string constant, I assume you mean string literal? But you can also concatenate numeric literals. And class constants. And regular constants.

      And by the time you've got those cases, ($a.two . $a.one) is ambiguous, regardless of how good your parser is. Oh, unless you want to make whitespace around operators meaningful, which is, frankly, horrible.

      --
      =w=
    15. Re:what wrong with by TomRitchford · · Score: 1

      . as the concatenation is bone stupid, but is a result of other bone stupid decisions in PHP. The trouble is that PHP automatically coerces your results into other types, which results in craziness like "false" == 0 being true; if + were the concatenation operator, PHP wouldn't be able to tell whether to do string concatenation or addition.

      Part of the fault allows rests with the unbelievably dreadful parser in the language, written completely ad hoc. If you want to see a bad parser, if you want to see really bad code in general, look at the PHP parser.

      What makes e.g. Python good is a series of excellent decisions which make later decisions easier. What makes PHP execrable, terrible, dreadful, is a series of poor decisions at the beginning and a refusal to admit or realize them or correct for them.

      I think the \ as namespace is a great idea as I think PHP should go away and this will hasten its inevitable though prolonged death.

    16. Re:what wrong with by Firehed · · Score: 1

      Honestly, that problem is largely avoided by having an editor that does decent syntax highlighting. I find myself bouncing between them all the time, it really depends what I'm doing. More often than not, I'll use whichever approach allows the least escaping of quotes, since the backslashes all over the place IMO make for even worse readability than the concatenated strings.

      Then again, I'm also doing my best to avoid all of the random mixing of languages that everyone does when first starting out with PHP (echoing HTML as part of a script as compared to having a standard HTML page with little bits of <?php echo $inlineVar; ?> as needed. Chances are that most people that know enough about coding to actually use namespaces (read: not most PHP coders) are doing the same. Having said that, I still think the originally-intended double-colon namespace separator would make more sense with the existing OO syntax in place. Or I do five minutes after reading the summary; the more clearly-declared intentions that using a backslash will bring will probably grow on me, even if I'm not a big fan of paying homage to old DOS folders.

      --
      How are sites slashdotted when nobody reads TFAs?
    17. Re:what wrong with by Firehed · · Score: 1

      Epic failure. An ambiguous example is even linked in the summary. For starters it causes tremendous confusion in reflection; for instance if you have a namespace Foo containing a class tBar, then a string reference written 'Foo\tBar' or "Foo\\tBar" is correct, whereas "Foo\tBar" is an error as the double-quotes cause a tab character to be escaped. How awful is that?

      And why would you be echoing a namespace anyways? You'll do your "use net\firehed\something as shortname;" and be done with it If you're insistent on not using 'use' then you'll wrap the whole thing in curly braces like you would for almost any other OO vars (echo "I've got a few words for you, {name\space\$user->name['first']}."; I would think).

      --
      How are sites slashdotted when nobody reads TFAs?
    18. Re:what wrong with by mysidia · · Score: 1

      And by the time you've got those cases, ($a.two . $a.one) is ambiguous, regardless of how good your parser is. Oh, unless you want to make whitespace around operators meaningful, which is, frankly, horrible.

      Yes, I do. It's not so bad, PHP already does it.

      Have you ever tried $X - > member (where $X is an instantiated class object?)

      You can't do it. it's a "->" operator, not a "- >" operator, just like A.B would be a namespace member operator.

      In that case, you can say that since "a" is the name of a known namespace, the dot that follows cannot be concatenation, because a namespace name followed by a dot is simply disallowed.

      From a semantic point of view... there really was no ambiguity, provided you introduce the rule that once a namespace has been declared, the same name may not be used for a variable, class, or constant.

      Just make sure your namespace names are memorable, distinctive, and you're good to go.

    19. Re:what wrong with by Domstersch · · Score: 1

      Have you ever tried $X - > member (where $X is an instantiated class object?)

      That's not whitespace around operators. That's replacing one operator with two (minus and greater than). Of course that'll make a difference, but my point was that whitespace around the operator currently doesn't and shouldn't in the future. Don't misconstrue it. To be clear, the reason meaningless whitespace around operators is is that both of the following work the same way:

      $a->someMethod()->someOtherMethod();
      $a->someMethod()
        ->someOtherMethod();

      Now, though, you're proposing that namespaces shouldn't be allowed to have the same name as any variable, class or constant. Are you mad? You realise that name conflict resolution is what namespaces are for, right? Yet you want to make it the case that if I'm using a Date namespace, I can never have a variable or class called date/Date? That's crazy.

      The "just make sure your names are memorable, distinctive, and you're good to go" rule is what PHP currently has, with class names for instance. And it's the problem that namespaces are designed to solve, not make worse.

      --
      =w=
    20. Re:what wrong with by shish · · Score: 1

      $X = $A.$B Is a parse error

      Nope, it's taking the value of the variable who's name is stored in $B out of the $A namespace. Also, lots of code already uses "string"."another string" (no space between) for concatenation -- with . being used for namespaces, this would try and fetch the variable named "another string" from the "string" namespace...

      --
      I mod down anyone who says "I will be modded down for this", regardless of the rest of their comment
    21. Re:what wrong with by oiron · · Score: 1

      No, '.' is used because PHP is weakly typed. Whether to add or concatenate HAS to be specified by the programmer because unlike in strongly-typed languages (e.g. Java), there's no way for the interpreter to know which you want.

      Which is epic fail on the part of PHP - look at Python for comparison: >>> 'foo''bar' 'foobar' >>> 'foo'+'bar' 'foobar' >>> 3 + 5 8 To a Python guy, PHP looks more like an ad-hoc collection of hacks than a true programming language.

    22. Re:what wrong with by Anonymous Coward · · Score: 0

      No, '.' is used because PHP is weakly typed. Whether to add or concatenate HAS to be specified by the programmer because unlike in strongly-typed languages (e.g. Java), there's no way for the interpreter to know which you want.

      Bogus.

      $x = 1;
      $y = $x;
       
      $concat = "${x}${y}";
      $concat = (string) $x + $y;
      $concat = '' + $x + $y;
      $addition = $x + $y;

      For BC issues, they could keep the old parser and allow versioned opening tags.

      Free the dot!

    23. Re:what wrong with by karijes · · Score: 1

      > ...if it's more complex for the parser to understand, it's more complex for a human to understand

      Really? As example in C++: "vector<vector<int>> x". Easy to understaind, hell to parse. Or in scheme: "((foo (baz)) foo)"; easy to parse, hell to understaind ...at least to untrained brain and eyes ;)

    24. Re:what wrong with by tbannist · · Score: 1

      It means that you should use single quoted strings.

      --
      Fanatically anti-fanatical
    25. Re:what wrong with by ednopantz · · Score: 1

      javascript is an order of magnitude more annoying.

      Is there *anything* you can do in javascript that isn't an order of magnitude more annoying than doing the same thing in [insert language]?

    26. Re:what wrong with by HuckleCom · · Score: 1

      I can agree with that. The '+' is additiion -and- space in urlencoded strings. I would really like to see php start being consistent with their function naming. str_replace, strlen, strtolower ... they need to fix that shit!

    27. Re:what wrong with by moderatorrater · · Score: 1

      Agreed on the function naming. I don't find it nearly as bothersome as syntax issues, however.

  3. Another fashionable addition for PHP: by Anonymous Coward · · Score: 4, Insightful

    PHP 5.3 also adds support for local GOTOs. This langauge is so up with the times.

    1. Re:Another fashionable addition for PHP: by Fweeky · · Score: 1

      To be fair, Ruby had to wait for 1.9 to get GOTO support. It's right there if you build it using -DSUPPORT_JOKE.

    2. Re:Another fashionable addition for PHP: by lgw · · Score: 1

      GOTO remains the best wat, in most programming languages, to exist multiple loops, branch to common clean-up code before leaving a function, etc.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    3. Re:Another fashionable addition for PHP: by lgw · · Score: 4, Insightful

      Wow, can't type today. Let's try again:

      GOTO remains the best way, in most programming languages, to exit multiple loops, branch to common clean-up code before leaving a function, etc.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    4. Re:Another fashionable addition for PHP: by coryking · · Score: 3, Insightful

      Modern languages have "exit for" or "break" to bail out of a loop.

      If you have a triple nested loop in the same function, you should refactor the code and move the inner loops into another function.

      What do you mean by "Clean Up Code"? If you have so many branches in a single function, again, refactor the code and split them into multiple functions.

      See also: Code Complete

    5. Re:Another fashionable addition for PHP: by chrysalis · · Score: 5, Insightful

      GOTO is what your CPU is actually doing 80% of the time.
      You can pump up your ego by imagining that using a language without something explicitely called "GOTO" makes your code "up with the time". But what you actually do is nothing but GOTOs, just written in a different manner.

      Ironically, the VM that PHP uses is completely GOTO-based (well, you can pick several methods at compile-time, but GOTO is what a lot of distributions chose because performance is often better than CALL and it's very stable nowadays).

      Oh and even JAVA has GOTO and relies a lot on it. The compiler hides an explicit thing called "GOTO", but what you get after compilation is full of GOTO. And it's actually why apps can actually do something.

      Laughing at "GOTO" is ignorance, or just blind trolling because you read somewhere that BASIC had a "GOTO" keyword. I guess in a few years your children will laugh at those horrible "$", "$this", "->", ":" and "\" symbols, that would remind them the old time of a language called PHP. Though you are proud of them now.

      Using temporary variables like "$should_exit", dummy loops just to "break" at the right place, or named loops to work around "break" that would only exit the first loop is nothing but writing "GOTO" in an obfuscated and inefficient way. "GOTO" is not synonym for "spaghetti code" (the famous keyword always used by people blindly repeating that GOTO is bad).

      Oh and grep for "goto" in your Linux kernel or in any BSD operating system. Wow, tons of them. Really. But I guess this is just because these source codes are shits written by people who can barely write GW-BASIC, and of course none of these operating systems actually work. Glad you are there to help. Teach them how to code, tell them that their code is so passé.

      Or shut up.

      --
      {{.sig}}
    6. Re:Another fashionable addition for PHP: by chrysalis · · Score: 1

      If the programmer needs to refactor its code because of stupid restrictions of a language, the language just sucks as it makes the programmer waste time.

      Please try to make coroutines with PHP 5.2. Oh you can't? It's impossible without being horrible kludged, complex and slow? Oh, of course, without anything like GOTO or setjmp/jmplong.
      So keep refactoring your code, and think that your code would already be running if you had GOTO.

      --
      {{.sig}}
    7. Re:Another fashionable addition for PHP: by hvm2hvm · · Score: 1

      How will you get out of the loops easier if you put them in a separate function? Apart from a flag that tells you to get out of all the loops you need that flag to go from function to function. I dislike badly factored code and hate the idea of using goto often but you have to accept that it is useful in some cases. It can do some things easier than most other constructs.

      --
      ics
    8. Re:Another fashionable addition for PHP: by woot+account · · Score: 2, Informative

      See instead: Linus Torvalds

    9. Re:Another fashionable addition for PHP: by MikeBabcock · · Score: 1

      As opposed to something like:

      int f(x,j)
      {
            for (i=0; i10; i++)
            {
                  if (i==6) return -1;
            }
            return 0;
      }

      int g(x)
      {
            for (j=0; j10; j++)
            {
                  if(f(x,j) != 0) return -1;
            }
      }

      (and so on)

      I see no reason to use goto's to handle multiple loop situations; that's why we get function calls.

      --
      - Michael T. Babcock (Yes, I blog)
    10. Re:Another fashionable addition for PHP: by lgw · · Score: 4, Insightful

      Yes, for school problems, refactoring the code to make the inner loop a function is great. For real-world legacy crap code, it's often impractical. You might have 15 variables that would need to be passed into that inner loop, and you might have shop standards preventing you from passing some of those types into functions, etc, plus your boss (often rightly) object to you "refactoring" code that works today. "Refactoring" is a charmingly naive expectation for legacy crap code to begin with. And if you're not working with legacy crap code today, consider yourself lucky: you don't know how good you have it.

      And by "clean-up code" I mean: you allocate resources at the top of a function, so they must be cleaned up at the bottom of the function (and no sneaky returning from the middle of the function). That code at the bottom of the function is "clean-up code". If you have 15 possible errors in your function, you either have some unreadable mess with 15 nested if statements that hide a perfectly straightforward logic flow, *or* you branch to the clean-up code in each of the 15 error cases, making the actual logic of the function obvious.

      Of course, most coders are simply incompetant, don't even bother to check for errors, and certainly don't ensure that every resource allocated at the top is easily visually identifyable as being freed at the bottom, which is why there are so many job maintaining legacy crap code (and why Java exists in the first place).

      And of course there are languages in which "goto" is pronounced "throw" and all the clean-up happens automatically, but mostly it's inventory and payroll databases that get coded in such languages: give me legacy crap code that does something *interesting* any day! I will forever cherish the one job I had in which C++ was used correctly (not the usual typing C into a cpp file) and goto was really unnecessary, but I don't expect lighting to strike twice in my career.

      Blah, blah, Code Complete. Some of us were doing that stuff correctly long before Steve McConnell (and I'd hardly cite Microsoft as an example of a stable, secure, maintainable code base!).

      --
      Socialism: a lie told by totalitarians and believed by fools.
    11. Re:Another fashionable addition for PHP: by Jesus_666 · · Score: 1
      In PHP break can take a parameter. You exit nested loops by telling break how many loops you want to exit.

      Example:

      while (true) {
      while (true) {
      echo "inner\n";
      break(2);
      }
      echo "outer\n";
      }
      echo "end\n";

      prints:

      inner
      end

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    12. Re:Another fashionable addition for PHP: by Anonymous Coward · · Score: 0

      GOTO is what your CPU is actually doing 80% of the time.
      You can pump up your ego by imagining that using a language without something explicitely called "GOTO" makes your code "up with the time". But what you actually do is nothing but GOTOs, just written in a different manner.

      So you think that the existence of something in underlying low-level code justifies its existence in high-level code? Great, maybe for PHP's next trick it should include inline ASM and pointer arithmetic?

      Ironically, the VM that PHP uses is completely GOTO-based (well, you can pick several methods at compile-time, but GOTO is what a lot of distributions chose because performance is often better than CALL and it's very stable nowadays).

      That's not ironic. It's not even relevant. See my next point.

      Oh and even JAVA has GOTO and relies a lot on it. The compiler hides an explicit thing called "GOTO", but what you get after compilation is full of GOTO. And it's actually why apps can actually do something.

      Wow, no shit professor. Nobody said an equivalent to GOTO in the underlying implementation isn't necessary, the point was entirely that it has no place within a modern high-level langauge. And right here you've just given another example that strengthens my position.

      Laughing at "GOTO" is ignorance, or just blind trolling because you read somewhere that BASIC had a "GOTO" keyword. I guess in a few years your children will laugh at those horrible "$", "$this", "->", ":" and "\" symbols, that would remind them the old time of a language called PHP. Though you are proud of them now.

      What? No, I'm not proud of them now. Almost all of those things you've listed are poorly chosen or completely unnecessary in a language. Did you completely miss the point or what?

      Using temporary variables like "$should_exit", dummy loops just to "break" at the right place, or named loops to work around "break" that would only exit the first loop is nothing but writing "GOTO" in an obfuscated and inefficient way. "GOTO" is not synonym for "spaghetti code" (the famous keyword always used by people blindly repeating that GOTO is bad).

      PHP's break statement has a level parameter, making this entire argument null and void and highlighting your own ignorance of the subject.

      Oh and grep for "goto" in your Linux kernel or in any BSD operating system. Wow, tons of them. Really. But I guess this is just because these source codes are shits written by people who can barely write GW-BASIC, and of course none of these operating systems actually work. Glad you are there to help. Teach them how to code, tell them that their code is so passé.

      And what do OS kernels written in C and assembly have to do with PHP? Oh right, not a fucking thing.

    13. Re:Another fashionable addition for PHP: by hawk · · Score: 2, Insightful

      Although rare, there are times when GOTO is the cleanest way out.

      I recall being stunned to run across one of them writing the code for my dissertation, and noting that I was going through a *lot* of code to avoid a single, simple GOTO. Yes, I could have avoided it, but under the circumstances, the GOTO was much cleaner.

      Oddly, I don't remember the circumstances; just my sheer amazement that such circumstances actually existed.

      hawk

    14. Re:Another fashionable addition for PHP: by Anonymous Coward · · Score: 0

      Yeah - When will they add support for local GTFOs?

    15. Re:Another fashionable addition for PHP: by lgw · · Score: 2, Informative

      In you example, F() took only two arguments, and the extra processing overhead of the function call was (presumably) not a concern. There are times when one or the other of those factors is practical. If the inner loop needs 15 variables (and is modifying some of them), the code can become far less readable than a simple goto, and noticably less performant. Of course, code performance is less of an issue every decade, but multiply nested loops are the one place where it still tends to matter.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    16. Re:Another fashionable addition for PHP: by lgw · · Score: 1

      While that's nice, break(2) seems far less clear than break(outer_loop_name).

      In either case, it's just another name for goto. Just because goto can be use poorly is not a reason to avoid it when it makes sense.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    17. Re:Another fashionable addition for PHP: by Anonymous Coward · · Score: 0

      You are right, gotoâ(TM)s can be abused. But that does not mean that mean that it cannot be used to make code more clean. I do like using gotoâ(TM)s for error handling and I donâ(TM)t like using exceptions. Why would PHP be better for disallowing one particular style?

      I think that the language should not force programmers to (over)user one particular feature. My personal belif is that the way Java uses exceptions is nightmarish. I didnâ(TM)t like the way Pascal forced us single exit point in its procedures/functions. Goto in PHP will only add to the flexibility of the language and the fact that that flexibilty can be abused should not deter us from getting it.

    18. Re:Another fashionable addition for PHP: by Anonymous Coward · · Score: 0

      And of course there are languages in which "goto" is pronounced "throw"

      Zing!

    19. Re:Another fashionable addition for PHP: by DiegoBravo · · Score: 1

      Maybe Slashdot.org can apply for a free license of DansGuardian to filter some inbound traffic?

    20. Re:Another fashionable addition for PHP: by Anonymous Coward · · Score: 0

      >>GOTO remains the best way, in most programming languages, to exit multiple loops, branch to common clean-up code before leaving a function, etc.

      In Python the best way is often to raise an exception and catch it higher up.

    21. Re:Another fashionable addition for PHP: by amRadioHed · · Score: 1

      Not in the example given. The inner and outer loops are identical, what name would you use that differentiates between them?

      --
      We hope your rules and wisdom choke you / Now we are one in everlasting peace
    22. Re:Another fashionable addition for PHP: by Thuktun · · Score: 5, Insightful

      GOTO is what your CPU is actually doing 80% of the time.

      And your car's engine spends all of its time repeatedly causing small explosions with volatile petroleum.

      The driver is generally recommended to let the engine do this and not try to intervene or do it themselves.

    23. Re:Another fashionable addition for PHP: by ObsessiveMathsFreak · · Score: 4, Informative

      Goto's are useful. Labels are useful. Yes they can lead to problems, but so do things like pointers, dynamic typing, operator overloading, namespaces and automatic memory management. But they can also solve problems that are otherwise intractable, which is what the GP was trying to tell you. Dismissing them just because E. Djisktra said so is not really good enough.

      If you want an argument from authority, or just a good read, here's Donald Knuth on Structured Programming with GOTO Statements. You need to read that paper before you can have a proper opinion on the GOTO statement. Otherwise you're just adhering to dogma.

      --
      May the Maths Be with you!
    24. Re:Another fashionable addition for PHP: by Kingrames · · Score: 1

      Everyone knows that GOTO is inferior to COMEFROM.

      --
      If you can read this, I forgot to post anonymously.
    25. Re:Another fashionable addition for PHP: by speedtux · · Score: 1

      If you need to do that, there's probably something wrong with your program logic.

      And, in any case, named loops (as in Perl) are a better choice if you really need this kind of functionality.

    26. Re:Another fashionable addition for PHP: by Anonymous Coward · · Score: 0

      terrible analogy

    27. Re:Another fashionable addition for PHP: by speedtux · · Score: 1

      So keep refactoring your code, and think that your code would already be running if you had GOTO.

      Sure, it would be running, but it's easy to get code to run. It's hard to write code that can be maintained.

    28. Re:Another fashionable addition for PHP: by iluvcapra · · Score: 1

      In either case, it's just another name for goto

      That's not true; when you break out of loop, you explicitly leave the local scope of the break and return to the scope of the containing block. Break always pops scope, thus it's guaranteed that you'll never jump into the code after a declaration. Goto does not guarantee this behavior, and as a practical matter goto lets you jump into all kinds of nasty places. Every time you add a goto label, you're adding an entry point to your function and making comprehension more difficult.

      I guess you can argue the whole "programmers-misusing the-tools" side, but really gotos are quite un-ergonomic. Better to use breaks, and Exceptions in languages that support it. The only time I ever use gotos is in languages where you can't throw an exception.

      --
      Don't blame me, I voted for Baltar.
    29. Re:Another fashionable addition for PHP: by Anonymous Coward · · Score: 0

      Just because goto is a very nice construct in a low level language, such as assembler, does not mean it absolutely has to be exposed in a high level language such as PHP. Goto will, and has often been, abused by developers who are maybe not so very "leet" and "cool". In the hands of a very, very, good developer goto can be a true asset, but let's face it, PHP is used a lot by hobbyists and so forth who don't necessarily have a degree in writing software.

    30. Re:Another fashionable addition for PHP: by totally+bogus+dude · · Score: 1

      So basically you're saying GOTO is important for legacy applications that were written to make use of it and you can't afford the time or risk to refactor it. I can understand that.

      What I'm having trouble grasping is why that's an argument for adding GOTO to a language that never supported it. There's no legacy PHP code using GOTO because it didn't exist before...

    31. Re:Another fashionable addition for PHP: by Gazzonyx · · Score: 1

      FWIW, Java has goto as a reserved word, but it is currently unimplemented. However, everything else that you say is spot on.

      --

      If I mod you up, it doesn't necessarily mean I agree with what you've said, sorry.

    32. Re:Another fashionable addition for PHP: by Anonymous Coward · · Score: 0

      50 PRINT "Does PHP support line numbers?"
      60 GOTO 50

    33. Re:Another fashionable addition for PHP: by fireboy1919 · · Score: 1

      I can't tell if you're being serious, or a troll. Apparently you're idea is insightful to at least 3 people, so that's why I think it's worth responding.
      [Computer Science 101]
      GOTO remains the best way, in most programming languages, to exit multiple loops, branch to common clean-up code before leaving a function, etc.

      No it doesn't. I remains one of the worst ways for the following reasons, which are exactly the same reasons its bad in general programming practice. The logic goes something like this:

      1) When you enter the thing that you're going to, you don't know the state of the machine before that. There is no structure in place to check for, or prevent side effects (such as variables not being initialized, or their state not changing the way you expect). In addition, when you're going back through the code, it's usually quite difficult to be sure what code block depends on the "goto" code.

      2) In practice adding structure to specifically check for side effects is much more wasteful (and more likely to be filled with bugs) than just not using Goto statements, and repeating the statement multiple times without gotos.

      3) So what you do instead, to track the location that you're going to and to prevent side effects is to use some state information that you pass around to know where you've come from and where you're going within the process. Congratulations! That's a wonderful solution. Unfortunately, you didn't actually invent it. That's just object oriented programming...but without the nice syntax and niceties to make it easy to follow.

      As a former BASIC programmer (started on apple IIs and Commodore 64s), I actually started in on the move away from GOTOs with exactly this point of view.

      to exit multiple loops, branch to common clean-up code before leaving a function, etc.

      Its rather interesting that you chose these functions specifically, as they're really very specifically uses for which OOP was designed.

      to exit multiple loops

      The programming pattern where you'd use multiple loops that each have a single termination would presumably be using similar data in different ways in each loop. Otherwise, the "finish up" code would be different for each piece.
      In OOP, you'd say that they're using object properties. These are properties that are available to all of the functions in an object, so the OOP way of doing this would be something like "finishBranches()", which is about as hard as writing "goto finishBranches" but without as much risk of side effects (because everything is defined by the hopefully-compiler-verified object properties).

      branch to common clean-up code before leaving a function

      A destructor function is common clean-up code that runs when an object is destroyed. Build your destructors right, and manual clean-up is seldom needed. It keeps you from deallocating memory when there's still a constructor still hanging out somewhere.

      There are two main arguments I can think of against this:
      1) Now you might be thinking "but language X" doesn't have OOP." Not really important. OOP is a concept based mostly around the idea that program flow is about how the data is transformed and not how the program flows. It can be implemented in any Turing complete language.

      2) But "Goto" is what the computer really does.
      Not really. Modern processors keeps track of threads and more, with associated state information. There are nearly always limits on where you can GOTO. Point there is that GOTO isn't really enough. For the stability of the system, state info need to be tracked. Not to the level that humans use it, but then again, computers aren't really reading our high level languages at all, are they?

      Note that these are just the basics of why gotos are pretty much a bad idea all of the time. For a more complete intro, I highly recommend a degree in computer science.

      -Former GOTO user.
      [/ Computer Science 101]

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    34. Re:Another fashionable addition for PHP: by logfish · · Score: 2, Interesting

      I don't agree. Goto's are terrible if you want to start multithreading things, and we all know that that is going to be the future. By scoping everything, you can help separate access and help with "threadability" (if that is even a word). Whatever people say, I'm adhering to the dogma! :)

    35. Re:Another fashionable addition for PHP: by Nazlfrag · · Score: 1

      So you would deny a tool to the wise and sophisticated just so the stupid and ignorant won't abuse it? Trust me, denying the introduction of GOTO will do nothing to stop the hobbyists from continuing to unleash unholy abominations of code.

    36. Re:Another fashionable addition for PHP: by Welsh+Dwarf · · Score: 1

      One word for you: inline

      There, that takes care of your overhead.

      If you need 15 variables passed, than you probably need to:

      a) Regroup them into logical constructs
      or
      b) Ask yourself why your code is using 15 unrelated bits of data and clean your algo up.

      Sorry, but there is no place (outside asm) that a goto should be used. It's just a bug waiting to happen.

      --
      Ask 8 slackers a question, get 10 awnsers (a citation, but I can't remember from who)
    37. Re:Another fashionable addition for PHP: by cibyr · · Score: 1

      Better approach than GOTOing to cleanup code: write C++ and use RAII.

      Isn't C++ supposed to be messy, hard and inelegant? Why don't we have good support for RAII in our supposedly more modern, enlightened languages? C#'s using statement doesn't count either because it's so much more of a pain for BOTH writing the object and using it.

      --
      It's not exactly rocket surgery.
    38. Re:Another fashionable addition for PHP: by dmsuperman · · Score: 1

      Finally, somebody who isn't blindly following the herd, spouting off the same crap I get to hear over and over again because idiots are too simple to actually think things through before they put things down.

      Will you marry me?

      --
      :(){ :|:& };: Go!
    39. Re:Another fashionable addition for PHP: by risingfish · · Score: 1

      You left another modern language that supports GOTOs. It's built into C# (and of course VB).

    40. Re:Another fashionable addition for PHP: by Anonymous Coward · · Score: 0

      1) When you enter the thing that you're going to, you don't know the state of the machine before that. There is no structure in place to check for, or prevent side effects (such as variables not being initialized, or their state not changing the way you expect).

      That's a very poor blanket statement. Most of the time, you do know the state of the machine at a given point in the code. The times you don't, you should be very wary.

      In addition, when you're going back through the code, it's usually quite difficult to be sure what code block depends on the "goto" code.

      Maybe in a language that supports dynamic goto labels, but not usually. It also depends a lot on what the "goto" code is doing. It depends most on how well documented it is.

      So what you do instead, to track the location that you're going to and to prevent side effects is to use some state information that you pass around to know where you've come from and where you're going within the process. Congratulations!

      Keeping state information in general is not the same as OOP.

      The programming pattern where you'd use multiple loops that each have a single termination would presumably be using similar data in different ways in each loop. Otherwise, the "finish up" code would be different for each piece.
      In OOP, you'd say that they're using object properties. These are properties that are available to all of the functions in an object, so the OOP way of doing this would be something like "finishBranches()", which is about as hard as writing "goto finishBranches" but without as much risk of side effects (because everything is defined by the hopefully-compiler-verified object properties).

      Wow... please don't do that. Don't use object properties for loop variables. That's a terrible idea. You're no longer modeling based on data, you're kludging an object to handle program flow. You should recognize this as an error because you say something very similar later on when you're talking about OOP in non-OOP-centric languages.

      Also, I hope you realize that you're just transferring the problem. An object, if not properly designed and used, is just as unknowable as the state of local variables. Even the object itself may be indeterminate, especially for heap-based objects.

      A destructor function is common clean-up code that runs when an object is destroyed. Build your destructors right, and manual clean-up is seldom needed. It keeps you from deallocating memory when there's still a constructor still hanging out somewhere.

      This works great for resource management, and is a great idea, but is cumbersome for other common things like, say, printing out a message to tell the user something. You could create a special object that does nothing but print out a message in the destructor, but again this is abusing OOP concepts and using them to model program flow. It's not at all superior.

      But "Goto" is what the computer really does.
      Not really. Modern processors keeps track of threads and more, with associated state information.

      No, goto really is what the computer does. I don't know what you're even trying to say here. Just about every flow control construct is based on goto. Nobody disputes that. Goto does not cause hardware or operating system level errors, which is what you seem to be implying.

    41. Re:Another fashionable addition for PHP: by GleeBot · · Score: 1

      All of these concerns have easy solutions that avoid GOTO:

      1) Put state into a structure, then pass a pointer or reference to the structure. Makes the calling convention much simpler, and having all your state variables bundled up can provide unexpected benefits later. And no, it doesn't add any overhead in combination with...

      2) Use inline or file-scoped functions for inner loops. All modern compilers can optimize these easily; this is bread and butter stuff for them. (Some compilers can do global optimization, too, but it's much harder and less common.)

    42. Re:Another fashionable addition for PHP: by Thuktun · · Score: 1

      "That was, without a doubt, the worst comment ever. Rest assured, I was on the Internet within minutes, registering my disgust throughout the world."

      - Anonymous Coward

    43. Re:Another fashionable addition for PHP: by nicodoggie · · Score: 1

      GOTO remains the best way, in most programming languages, to exit multiple loops, branch to common clean-up code before leaving a function, etc.

      Wouldn't say most languages, but loads of languages are, I guess, older than Dijkstra...

    44. Re:Another fashionable addition for PHP: by DragonWriter · · Score: 1

      GOTO remains the best way, in most programming languages, to exit multiple loops, branch to common clean-up code before leaving a function, etc.

      In some cases, its probably the fastest way, though I'd be hesitant to call it the "best"; having loops use the right tests at the end should make it trivial to bail out of multiple loops in most cases, and having to use GOTO to get to "common cleanup code" before leaving a function is a pretty big code smell. In the usual case, the common cleanup code should just be after the loops and/or conditionals for which it is common, and the usual execution path should get you there without a GOTO. If the reason for a need to branch to common cleanup code is exception handling, try...finally or equivalent constructs are the clearest method.

    45. Re:Another fashionable addition for PHP: by DragonWriter · · Score: 1

      Isn't C++ supposed to be messy, hard and inelegant? Why don't we have good support for RAII in our supposedly more modern, enlightened languages?

      RAII depends on the the fact that C++ uses statically allocated objects that "go out of scope". This clearly doesn't work in languages where objects are dynamically allocated and may or may not ever be destroyed. OTOH, some "more modern, enlightened" languages have fairly elegant solutions which don't rely on object lifespans, such as Ruby's (which, as I understand it, comes from Smalltalk, which predates C++) pattern:

      Resource.open(opts) do |resource|
      .
      .
      .
      end

       

    46. Re:Another fashionable addition for PHP: by DragonWriter · · Score: 1

      And by "clean-up code" I mean: you allocate resources at the top of a function, so they must be cleaned up at the bottom of the function (and no sneaky returning from the middle of the function). That code at the bottom of the function is "clean-up code". If you have 15 possible errors in your function, you either have some unreadable mess with 15 nested if statements that hide a perfectly straightforward logic flow, *or* you branch to the clean-up code in each of the 15 error cases, making the actual logic of the function obvious.

      Or each of the errors raises an exception, and you have a clear structure of main flow, exception handling, and clean up using a try/catch/finally structure (or the equivalent in a language with different names, like Ruby's begin/rescue/ensure/end).

      (While this has some similarity to gotos, of course, its significantly different in that the mechanism used to specify which exceptions are caught by particular handlers are more sophisticated that simple labels, and because exceptions can carry data.)

    47. Re:Another fashionable addition for PHP: by DragonWriter · · Score: 1

      In either case, it's just another name for goto.

      This is true in approximately the same sense that a function call or return is "just another name for goto".

    48. Re:Another fashionable addition for PHP: by lgw · · Score: 1

      C#'s using isn't bad, really. I prefer C++ and RAII, but at least as a team lead you have a chance with C# of explaining how not to write leaks (and use searches to find mistakes).

      --
      Socialism: a lie told by totalitarians and believed by fools.
    49. Re:Another fashionable addition for PHP: by lgw · · Score: 1

      Sure, that's preferable. It's a culture shift from old-school programming, however, which makes it rare in my experience, but it's certainly the best practice.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    50. Re:Another fashionable addition for PHP: by lgw · · Score: 1

      Sorry, but there is no place (outside asm) that a goto should be used. It's just a bug waiting to happen.

      Yup, that's true for junior programmers. No one should be using goto for their first few years of professional development. As you master the art, however, the language constructs recede into the background. Goto is a tool, sometimes useful for writing good code, but easy to mis-use. Goto is not incompatible with structured programming, and contorting the Hell out a function to avoid a goto is just ritual programming without understanding.

      And of course, if you're writing C code, there's no other good option for ensuring resources are freed (though some places you'll find macros like __try, __leave, __finally which of course just expand to goto and a label).

      --
      Socialism: a lie told by totalitarians and believed by fools.
    51. Re:Another fashionable addition for PHP: by lgw · · Score: 1

      Goto is a powerful tool and easy to misuse, best avoided by junior programmers. However, contorting your cod so as to never use it, even when it makes sense, it just empty ritual.

      I did assemby programming for 5 years. It was all perfectly recognizable structured code, but all I had was goto. It's not dripping with evil or anything. Goto's that are modified by other code still make me nervous, but fortunately modern processor architectures make that useless or even impossible.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    52. Re:Another fashionable addition for PHP: by fireboy1919 · · Score: 1

      Most of the time, you do know the state of the machine at a given point in the code.

      No you don't. If you think otherwise, you haven't been programming for very long, or you have an inflated view of your own programming ability. You usually know *MOST* of what you need, but everybody always forgets something. I cite the fact that there are so few bug-free programs, and the general practice of encapsulation & defensive programming as evidence.

      Keeping state information in general is not the same as OOP.

      No it isn't. Keeping a clearly defined set of properties that you reusing over and over is. The difference between OOP and not is in the fact that your state is well defined. Feel free to disagree. I can't stop you. No use arguing a belief. I can say, though, that this is the irreducible property from which all other OOP concepts spring. You can't have OOP without this, but from this you can create all of OOP.

      Don't use object properties for loop variables.

      Don't think that object properties that are used in loops are actually loop variables. If you can do a single piece of code to finish them all out, then they aren't loop variables. You've described the problem wrong.

      Also, I hope you realize that you're just transferring the problem.

      I disagree. You start to track the flow of the program using the language syntax rather than the logic of the program, which drastically simplifies the problem. You might consider actually supporting your claims with actual reasons rather than just saying that I'm wrong if you hold an opposing view.

      printing out a message to tell the user something ...and that's when you want to start moving into using interfaces and aspect oriented programming, which is another issue altogether. It certainly isn't a reason to use gotos.

      Goto does not cause hardware or operating system level errors, which is what you seem to be implying.

      Let me just go ahead and say that. Operating systems track program state, and if you try to GOTO an area you're not allowed, most modern OSes will, in fact, throw an error and crash the program. More and more of such logic is being moved into processors as well as more multitasking-related operations are moved into the processor level.

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    53. Re:Another fashionable addition for PHP: by DragonWriter · · Score: 1

      Goto is not incompatible with structured programming, and contorting the Hell out a function to avoid a goto is just ritual programming without understanding.

      If you have to contort the hell out of a function to avoid a goto, chances are there are bigger problems with how your function is designed; or, perhaps, you are using C. If you are using C, there are definitely places where a goto is desirable, if you are using a language with a more robust set of flow control constructs, you probably should be using them. Heck, the reason most of them exist is to provide something cleaner than gotos, for the various uses where gotos are useful when you don't have more advanced constructs.

      Ultimately, its about knowing your tools: the best way to express the same fundamental logic is going to be different in an I/O bound application program written in Ruby vs. a potential processing bottleneck a computation-heavy program in C. (And if you are doing those programs with the languages reversed, your problem may be in choosing your tools in the first place.)

    54. Re:Another fashionable addition for PHP: by iluvcapra · · Score: 1

      your post is non-responsive to my argument. None of your points correspond to mine. Your post belongs as a response to GGGP.

      --
      Don't blame me, I voted for Baltar.
    55. Re:Another fashionable addition for PHP: by lgw · · Score: 1

      My post was a response to

      Every time you add a goto label, you're adding an entry point to your function and making comprehension more difficult.

      I guess you can argue the whole "programmers-misusing the-tools" side

      and I did, in fact, argue the whole "programmers-misusing the-tools" side.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    56. Re:Another fashionable addition for PHP: by Anonymous Coward · · Score: 0

      Every time you add a goto label, you're adding an entry point to your function...

      That depends on the language. Few modern languages, except assembly languages, support non-local goto. Local goto is much safer - not safe, but safer than non-local goto.

      - T

    57. Re:Another fashionable addition for PHP: by mgiuca · · Score: 1

      You seem pretty confused dude.

      The Java language doesn't have goto. The Java Virtual Machine (JVM) has goto. That's completely different.

      Saying "Java has goto but the compiler hides it" is like saying "Java has pointer arithmetic but the compiler hides it" or "Java represents strings as a pointer to a char array but the compiler hides it". All kind of true, in practice, except that none of those things are features of the Java language itself.

      I brought up those two other examples because they're deliberately hidden from you for the same reason as goto is: they make it a lot easier to make mistakes.

      There is a good reason why modern languages discourage or prohibit goto. It's been proven time and time again that it isn't worth the extra confusion. Occasionally it's more efficient or easy to use goto, which is why it shows up in projects like Linux. But that should be the exception, not the rule.

      The guy with the car analogy said it best. I just thought I'd clear it up with some more apt programming analogies.

      And no, it isn't "ironic" that PHP doesn't have gotos but its VM does. It's good language/compiler design, otherwise known as abstraction. In this case, it's "control abstraction", and you can read more specifically on this issue under structured programming.

  4. Can\'t read summary by jspenguin1 · · Score: 5, Funny

    I couldn\'t read the summary because it had an unterminated string literal.

    1. Re:Can\'t read summary by Anonymous Coward · · Score: 0

      For a moment there, thought you wrote "unterminated stray liberal" and thought I was back on fox news forum...

  5. WTF? by Anonymous Coward · · Score: 1, Insightful

    Being different to be different, aren't we?

    1. Re:WTF? by ThePhilips · · Score: 4, Interesting

      You should say "thanks" they haven't chosen something else. e.g Jam (build system; make analog) uses "!" as a "platform neutral" path separator. During evaluations for new build system I joked that I oppose jam since we do not need a "platform neutral" system - we need one for *nix and cygwin. To my surprise many supported me.

      I think their decision to use '\' is very very dumb one.

      I'm still huge fan of Objective-C in that aspect. Unlike C++, which tried to marry C and objects, ObjC took more pragmatic approach: C constructs remains C constructs and object oriented constructs got new distinctive syntax so that you can never mix up what code you are looking at.

      In that aspect, I think PHP folks would regret their decision in future: '\' isn't distinctive enough and they would need to introduce more silly syntax hacks when extending language further.

      --
      All hope abandon ye who enter here.
    2. Re:WTF? by caluml · · Score: 5, Insightful

      I think their decision to use '\' is very very dumb one.

      You've summed up my opinion concisely. That is *truly* retarded to use the (almost?) universal escape character for another reason. Almost as retarded as Microsoft going with \ for a directory separator.

    3. Re:WTF? by dascritch · · Score: 1

      Having an AZERTY keyboard, living in France, I do remember the difficulty to have \ characters on certains small keyboard in MSDOS.
      Two methods : AltGr + 8
      or Alt + 9 + 2

      And PHP group thinks it's easer to use ?
      that is soooooooooooo simple to use it instead of "::"

      --
      (Sorry my bad French) Je fais parler les Guignols de l'Info. Le pied, quoi.
    4. Re:WTF? by moderatorrater · · Score: 2, Funny

      When are you going to use the escape character outside of a string? I agree that it's dumb, and it's going to make for ugly looking code, but saying that it shouldn't be used because it's an escape character seems like an empty criticism. It's like saying that Elisabeth Taylor's personal life is messed up because she doesn't pay enough attention to her hair.

    5. Re:WTF? by shutdown+-p+now · · Score: 0

      Almost as retarded as Microsoft going with \ for a directory separator.

      It wasn't Microsoft, it was IBM. Microsoft used "/" initially, but IBM forced them to change it to "\". Partly due to the internal resistance of MS engineers to change, they've still left support for "/" in - which is why it's still there, 25 years later.

    6. Re:WTF? by BollocksToThis · · Score: 2, Insightful

      Given that / support has only been present in recent Windows versions, I have to say
        [citation sorely needed]

      --
      This sig is part of your complete breakfast.
    7. Re:WTF? by Phroggy · · Score: 1

      When are you going to use the escape character outside of a string? I agree that it's dumb, and it's going to make for ugly looking code, but saying that it shouldn't be used because it's an escape character seems like an empty criticism. It's like saying that Elisabeth Taylor's personal life is messed up because she doesn't pay enough attention to her hair.

      It's true that backslashes aren't used outside of a string... but variables ARE used INSIDE of a string. So, if you have a variable called $foo\name, you're going to be seeing strings like "Hello, my name is $foo\name\n".

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    8. Re:WTF? by billcopc · · Score: 1

      Actually what's probably going to happen is a repeat of PHP 5.0's release: people are just going to stick with the old, non-stupid version.

      How can the people behind one of most popular scripting languages in the world FAIL to see how dumb it is to use the escape-slash as anything but an escape ? It's already a character to cope with ambiguous situations, why did they go and make it irreparably ambiguous ? This is going to break a TON of scripts, for no good reason.

      what if I really want to type "$myvar\nsometexton2ndline", you know, like in lists ? will I have to double-escape my control characters ?

      If it's so damned hard for them to parse :: or :::, maybe these kids shouldn't be designing a language.

      --
      -Billco, Fnarg.com
    9. Re:WTF? by Phroggy · · Score: 1

      Given that / support has only been present in recent Windows versions, I have to say

        [citation sorely needed]

      Agreed. I think there might be some places where Windows 95 will accept / as a path separator, but I'm not aware that it was ever allowed before that, and although Windows 95 may seem like ancient history in the modern age of Vista, it's a looooong way from MS-DOS 1.0.

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    10. Re:WTF? by cheater512 · · Score: 1

      "{$foo\name}" will work just fine.

      Thats also how you do stuff like "{$class->variable}"

      Remember that double quotes are parsed, single quotes arent.
      Curly brackets in double quotes means a variable.

    11. Re:WTF? by cheater512 · · Score: 1

      As I said earlier, thats what curly braces are for.
      "{$myvar\variable}\nsometexthere"
      Thats how you use classes as well. "{$class->var} moretext\n"

    12. Re:WTF? by TLLOTS · · Score: 2, Interesting

      Not at all, there were some serious ambiguity issues that needed to be resolved.

      Take the following code:

      ----------

      # first file

      namespace Foo;

      function blarg()
      {
            echo "function";
      }

      # second file

      class Foo {
              public static function blarg()
              {
                      echo "method";
              }
      }

      # third file

      Foo::blarg(); // what does this output?

      -------

      The problem here is that calling a static method and calling a function within a namespace share the exact same syntax, so at a glance you can't be sure what will happen.

      If we assume that PHP internally does its lookups in these situations as function first, then class, then there's four possible scenario's in this situation.

      1. You have both files included at once, PHP gives a fatal error due to the ambiguity.

      2. You only have the first file (namespaced function) included, so it outputs "function".

      3. You only have the second file (static class) included, so it outputs "method".

      4. You have neither files included, but you have defined an autoload method which loads your static class file and outputs "method".

      Obviously the ambiguity is a serious issue, so you need to resolve it somehow. Either you make a special syntax for calling functions in namespaces, you change namespaces so they can only be used for classes, or you change the seperator for namespaces to something else.

    13. Re:WTF? by Tacvek · · Score: 1

      Given that / support has only been present in recent Windows versions, I have to say

        [citation sorely needed]

      Agreed. I think there might be some places where Windows 95 will accept / as a path separator, but I'm not aware that it was ever allowed before that, and although Windows 95 may seem like ancient history in the modern age of Vista, it's a looooong way from MS-DOS 1.0.

      I think it may have been accepted in the early NT systems too, some of which do date back before Win95.

      --
      Stylish sheet to fix many problems in Slashdot's D3: https://gist.github.com/801524
    14. Re:WTF? by TLLOTS · · Score: 1

      It's not so much making a parser for this syntax that's the issue, the issue is the ambiguity between functions in namespaces and static classes. See my post for further details.

    15. Re:WTF? by gnupun · · Score: 0

      Why the hell did they not choose "/" instead of "\"? This is what happens when language designers don't have design skills and any depth of experience in the CS field.

    16. Re:WTF? by dkf · · Score: 1

      That is *truly* retarded to use the (almost?) universal escape character for another reason.

      The most retarded namespace separator EVER was in Perl4. What exactly possessed Larry Wall to use ' (i.e. single quote) for that purpose as well as for uninterpolated strings, I'll never know. Nor do I know whether he shared what he was smoking at the time. But this sticks in the mind; I've written code that depended on it.

      Perl5 uses :: instead. Far saner.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    17. Re:WTF? by Anonymous Coward · · Score: 0

      Foo::blarg();

      If that is how PHP calls the static method blarg() of class Foo, then the person who made that the syntax needs to be slapped in the face, hard. I had very little respect for PHP before, but it's sunk to a new low now.

    18. Re:WTF? by Vexorian · · Score: 1
      For some reason I think using :: just because it is used by other languages would be an equally retarded idea.

      objective-C

      Bye credibility.

      --

      Copyright infringement is "piracy" in the same way DRM is "consumer rape"
    19. Re:WTF? by Firehed · · Score: 1

      Yes, but if you've looked at the existing documentation for how namespace resolution was going to be implemented with the double-colon in PHP, that was equally insane. The idea was that given
      use A::B; (or use A::B as B;)
      B::C() could run:
      Class B method C() in the global namespace
      function C() in namespace A::B
      Class B method C() in namespace A
      function C() in namespace B

      Or something crazy like that. I couldn't tell you if that's exactly the right explanation and I'm sure the order is wrong (can't tell you what the right order is though) but you can see the problem.

      Now using a backslash as a seperator is still stupid (the pipe | isn't used for anything that I can thing of, other than comparison operators, might have made sense), but at least the way they were implementing it initially, :: would be a terrible choice.

      Just being a bit more strict about name resolution would probably also have fixed the problem. Maybe requiring specifying the global NS in the use statement would have fixed it, i.e., use a::b::c as c; would have to be use ::a::b::c as c specifying whatever file declared namespace a::b::c. And then use c::d would resolve to ::a::b::c::d if the above was in place, and throw a fatal error if something wasn't already declaring the use of the c namespace.

      Dunno. For now, I'll be sticking with the standard prefix1_prefix2_classname{} until they figure it out.

      --
      How are sites slashdotted when nobody reads TFAs?
    20. Re:WTF? by Firehed · · Score: 1

      Wouldn't it be {foo\$name} ? That would be more consistent with how static variables are accessed, and I think would only cause potential visual problem if you were accessing namespaced class constants, i.e. "{foo\bar\name}" meaning namespace foo; class bar{const name='baz';} and not some random string with a unix line break.

      --
      How are sites slashdotted when nobody reads TFAs?
    21. Re:WTF? by shutdown+-p+now · · Score: 1

      Given that / support has only been present in recent Windows versions, I have to say

      It has not. It has been present since the very first DOS version that supported directories. If you don't believe me, try it in DOSemu and see it for yourself.

      Or you can read the story here.

    22. Re:WTF? by Almahtar · · Score: 1

      Why not a single ':'? As far as I know, only '::' is recognized by the parser as a token. So you get a token that isn't used otherwise in current syntax.

    23. Re:WTF? by mabinogi · · Score: 1

      Recent as in any version of windows since Windows 95?

      / is a perfectly valid path separator in Windows, and has always been in the Win32 API and underlying C runtime. The command line tools don't like it, but that's only because the interpret '/' as a switch, if they ever actually passed the parameters on to fopen() and equivalent, then it'd work.

      If you're writing modern software, and you're deliberately adding logic to use '\' as a path separator under windows, then you're wasting your time.

      However, if you're _parsing_ a path, then you do have to allow for '\', since both are acceptable.

      --
      Advanced users are users too!
  6. That's because.. by Anonymous Coward · · Score: 1, Insightful

    There's obvious drawbacks for using a period (.) as a string concatenator, it's easy to put strings together since typing a period is a lot easier than a plus (+), but this means you can't use a period for namespaces as many OO coders are used to..

    1. Re:That's because.. by SoapBox17 · · Score: 4, Insightful

      Since PHP is a weakly typed language, using + for string concatenation would introduce a number of problems. + is used numeric addition, and thus automatically converts the operands to numbers before adding them.

      So using + for string concat too would be basically impossible... When would you decide to concat the operands, and when would they be added? If you base it on the results of the string to number conversion, you get situations where the same line of code sometimes adds numbers and other times concatenates strings, or where it is impossible to concat two strings which contain only digits.

    2. Re:That's because.. by Tablizer · · Score: 1

      What about VB-style "&" for concatenation?

    3. Re:That's because.. by coryking · · Score: 1

      Personally, I get annoyed with languages like Javascript that use + for string concatenation. VB did it back in the day, and you would sometimes run into issues where you'd combine two variables and it would treat one as an integer or a decimal and do the wrong or unexpected thing. IIRC you could do this:

      Dim myInt as Variant
      Dim myStr as string

      myInt = 1
      myStr = "hi"

      myStr = myStr + myInt

      And you'd get something like "hi1.0"

      It just doesn't feel right to do the same thing in modern languages. What should be the result of this bit of javascript?


      var myInt = 1.0;
      var myStr = "hello"
      alert(myStr + myInt);

      What should that return?

      I dunno, maybe I'm full of it, but I just dont like when dynamic languages use "+" for both addition and concatenation.

    4. Re:That's because.. by moderatorrater · · Score: 1

      Case in point, javascript. Concatenating instead of adding causes a lot more bugs than anything else I've seen about the language.

    5. Re:That's because.. by Fweeky · · Score: 1

      Python: TypeError: cannot concatenate 'str' and 'float' objects
      Ruby: TypeError: can't convert Float into String

      Weak typing is the problem, not dynamic typing.

    6. Re:That's because.. by SanityInAnarchy · · Score: 1

      What should that return?

      Nothing. It would raise a syntax error. You've forgotten a semicolon.

      Fix that, and it returns hello1.0. Calling a variable "myInt" doesn't make it an integer -- it was a float from the second you added a dot.

      You haven't actually shown a case where '+' is more confusing than any other character for concatenation -- and your confusion seems to be more with the nature of dynamic typing than with that particular operator.

      (For what it's worth, almost all dynamic languages will cast integers into floats when you combine the two in an operation -- for example, 2 * 1.2 will do what you expect, whereas 5 / 2 won't round properly -- you'd want 5 / 2.0)

      Not that '+' is entirely intuitive. A better example might be:

      var a = 1;
      var b = 1;
      var c = 'hello';
      alert(a + b + c);
      alert(c + b + a);

      The second alert is probably what you were expecting: 'hello11'. The first, however, is '2hello'.

      But that's pretty contrived -- after all, how often do you really want to concatenate two numbers as strings, with absolutely no text (even whitespace) between them?

      I have to think about that arithmetic gotcha above a lot more often than numbers vs strings.

      In any case, I don't find concatenation nearly as useful as interpolation, most of the time. In Ruby, at least, interpolation is known to execute faster than concatenation. But that doesn't help you if you're using JavaScript.

      --
      Don't thank God, thank a doctor!
    7. Re:That's because.. by Kjella · · Score: 1

      What about VB-style "&" for concatenation?

      I don't remember all that much of PHP, but in a weakly typed language wouldn't that crash with bitwise and? Would in C++ at least...

      --
      Live today, because you never know what tomorrow brings
    8. Re:That's because.. by Azarael · · Score: 1

      I'd say that it's more of an architectural problem than anything. You can add and multiply strings with the the same operators in Python which also has weak typing.

    9. Re:That's because.. by coryking · · Score: 2, Insightful

      Calling a variable "myInt" doesn't make it an integer -- it was a float from the second you added a dot.
      First, duh. Second, are you sure it will return "hello1.0" and not "hello1.00" or "hello1"? I'm not, I could test to find out, but that makes my point. It adds ambeguity to the language and makes me think about something I really should be thinking about. To use your example, what does the following result in?


      function blah(arg1) {
              var blah = "10" + arg1 + 5 + "hi";
      }

      alert(blah("hi"));
      alert(blah(1));
      alert(blah("1"));

      My example isn't as contrived as yours. What if blah() was in some other JS file. It could be easy to trip the function up based on what you pass in.

      Using "." for string concatenation at least gives both you, the code reader, and the compiler a hint at what you mean. That way the compiler can barf if you do something silly like concatenate an integer with a string. Using "+" for both addition and concatenation just makes more work for both parties.

      In any case, I don't find concatenation nearly as useful as interpolation, most of the time. In Ruby, at least, interpolation is known to execute faster than concatenation. But that doesn't help you if you're using JavaScript.

      I agree with this statement. I much prefer how Ruby and Perl do it... just toss the variables into your string and it will interpolate them.

      BTW, I'm not too familiar with Ruby. Does it pull the same trick Perl does and use a different operator for string comparison?


      if($myStr eq "hi") { print "hi";}

    10. Re:That's because.. by Anonymous Coward · · Score: 0

      I have to say he one hing I do like about vbscript i concat with "&".

    11. Re:That's because.. by ultranova · · Score: 1

      Personally, I get annoyed with languages like Javascript that use + for string concatenation. VB did it back in the day, and you would sometimes run into issues where you'd combine two variables and it would treat one as an integer or a decimal and do the wrong or unexpected thing.

      Yeah. Maybe there should be some way to tell the computer what kind of data some variable is supposed to hold - something like "integer i", or "int i" for short ?

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    12. Re:That's because.. by tdelaney · · Score: 1

      Strong vs weak, static vs dynamic typing

      http://www.artima.com/weblogs/viewpost.jsp?thread=7590

      Plus add explicit vs implicit (explicit almost always means static, implicit can be either).

    13. Re:That's because.. by Tablizer · · Score: 1

      I don't remember all that much of PHP, but in a weakly typed language wouldn't that crash with bitwise and? Would in C++ at least...

      Those operators are not used enough in modern times to justify dedicated characters in my opinion. They should be library function calls.
         

    14. Re:That's because.. by adrianmsmith · · Score: 1

      I agree. However PHP already has that bug; it uses == for both string comparison and numerical comparison.

    15. Re:That's because.. by shutdown+-p+now · · Score: 1

      That's all well and good, but "." was one of the worst choices of string concatenation operator to pick, because it had long had a very different meaning in most other languages out there (and I don't just mean OOP ones - "." is a traditional way to access fields of records in functional languages, too - see any one from ML family). They could have used "~", or "$", or, if they were so keen on dots, ".." like Lua (though that's a poor choice too, as it has often been used before to define ranges).

    16. Re:That's because.. by acidrainx · · Score: 1

      If you don't know the type of the variable you're using I'd say you have more of an architectural issue than anything else.

    17. Re:That's because.. by Anonymous Coward · · Score: 0

      Why can JavaScript and Ruby deal with it just fine? Simply provide a to_int method on strings and a to_string method on ints.

    18. Re:That's because.. by billcopc · · Score: 1

      Just because you don't use them, doesn't mean they're useless. I use bitwise operators all the time, it's called LOGIC and that's what branching is built upon.

      Would you rather use a half-dozen nested IFs ? Or and($somecond,and($somecond2,and($someothercond,... ?

      If I wanted a literate language, err... well I'd use something other than PHP!

      --
      -Billco, Fnarg.com
    19. Re:That's because.. by cheater512 · · Score: 1

      Thats a fun one to type.

      Try using it to concatenate 5 variables together and you'll get the idea.

    20. Re:That's because.. by Tablizer · · Score: 1

      This appears to be degenerating into a "my preferences should trump your preferences" fight. Language designers of popular languages have it rough: damned if they do and damned if they don't.

    21. Re:That's because.. by Anonymous Coward · · Score: 0

      Obviously. No weakly typed languages support + for string concatenation. Except python. Oh and ruby. And javascript. And...

      I'm sorry, what was your point?

    22. Re:That's because.. by retiman · · Score: 2, Interesting

      I don't know what you mean by "weakly typed language" as it has several different meanings*, but I think being or not being weakly typed doesn't have anything to do with it.

      The fact is that PHP automatically and forcefully converts operands into the correct type with the '+' operator (is this what you mean by weakly typed?). That is, "5" + 5 = 10, so all operands are converted to numerics.

      Incidentally, Java, will do this the other way, as "5" + 5 = "55". All operands to + get converted to String ("5" + obj is the same as "5" + obj.toString). Curiously, nobody is quick to call Java a weakly typed language.

      The exception, in Java's case, is the rule that + will always concatenate:

      5 + "5" = 55 // Java
      "5" + 5 = 55 // Java
      5 + 5 + 5 + "5" = 155 // Java

      Any time a String is encountered, Java will decide it is a concatenation operation (never addition). If you want to use the + operator for addition, you'll have to make sure all the operands are of some numeric type.

      For PHP, the original developers decided that it would be much more useful to always be able to add instead of concatenate. For example:

      "b" + 5 = 5 // PHP; b gets converted to numeric value of 0

      Of course, they could have the opposite rule so that if a numeric is present, then you must add; otherwise the operation is a concatenation. My opinion (and theirs probably) is that this rule would be terribly confusing, so they used the . operator for concatenation.

      On the flip side, my opinion is also that having "b" + 5 evaluate to 5 is also terribly confusing! There was nothing stopping them from making PHP behave like Java in this case (and still have PHP be "weakly typed", whatever that means).

      Unfortunately, it's way too late now, as there is already a ton of code exploiting this messy design decision.

      * Some people take weakly typed to mean types are associated with values instead of variables, for example.

    23. Re:That's because.. by T-Ranger · · Score: 1

      There is a difference between & and &&. & is a bitwise operation and && is a logical one. Which are different. Given that PHP has an AND (which has a different precedence then &&, I grant), it would not be much a stretch to drop both & and && in favor of a (new) bit_and() function and just using AND with parenthesizes. bit_and() could also work across platforms with different word lengths, too (or throw an exception).

    24. Re:That's because.. by Anonymous Coward · · Score: 0

      i don't see how it's impossible: you could just look at the operands. if they're both numbers, you add. if both are strings (surrouded by quotes), you concatenate. if you want to add two strings, explicitly convert them to a number. how is that impossible?

    25. Re:That's because.. by SanityInAnarchy · · Score: 1

      Second, are you sure it will return "hello1.0" and not "hello1.00" or "hello1"?

      Actually, I was wrong -- looks like Javascript doesn't have integers, only floats. Which makes it even simpler. In Ruby, it would have done pretty much exactly what I described.

      It adds ambeguity to the language and makes me think about something I really should be thinking about.

      No one speaks Lojban. Not many people program in Lisp.

      I don't think ambiguity is necessarily bad. It is a source of potential errors, but it's not difficult to avoid them -- and it's an easy thing to internalize about a language.

      My example isn't as contrived as yours.

      It's actually exactly as contrived as mine. Find me a real use case where you need to concatenate a string, an argument, an integer, and then a string.

      It turns out, this almost never happens in the real world. There simply aren't that many times you need to put a number into a string -- or at least, that has been my recent experience with Javascript.

      With Ruby and Perl, even moreso, since I almost never concatenate strings. In Ruby, the example you wrote would probably be written like this:

      "10#{arg1+5}hi"

      That's a pretty clear hint -- I'm using '+', and I'm using a numeric, so I probably want arithmetic, not concatenation.

      BTW, I'm not too familiar with Ruby. Does it pull the same trick Perl does and use a different operator for string comparison?

      No. Ruby generally doesn't coerce types when doing a comparison. That is:

      >> '5' == 5
      => false
      >> 5 == '5'
      => false
      >> 5 == 5
      => true
      >> '5' == '5'
      => true

      You can, of course, force the issue:

      >> '5'.to_i == 5.to_i
      => true
      >> '5'.to_s == 5.to_s
      => true

      I guess the biggest difference to understand here is that Perl is, at least semantically, a dynamically typed language -- no matter which operator you choose, 5 is '5', and vice versa. Similarly, in Perl, the empty string and the number zero are both treated as false -- Perl doesn't even bother to have an explicit boolean type.

      Ruby is actually a statically typed language. It just also happens to be implicitly typed. If I say

      a = 5

      in Ruby, that value of 5 is an Integer (specifically a Fixnum) -- moreover, since Ruby numeric types are immutable, that 5 will never change. When I do this:

      a += 1

      I'm actually not changing the value of that 5. I'm just changing which object the variable 'a' happens to point to.

      In other words, it's those references -- those actual names (like 'a') -- which are typeless. Actual Ruby objects are, in fact, statically typed. Of course, Ruby is flexible enough to let you do crazy shit like:

      class Foo
      def class
      Bar
      end
      def is_a? obj
      obj.is_a?(Bar) ? true : super
      end
      def kind_of? obj
      obj.kind_of?(Bar) ? true : super
      end
      ...
      end

      and thus frustrate anyone's attempt to force you to rely on static typing -- any object can pretend to be anything it wants, and there is no absolutely reliable way of telling what it is, or what methods it has.

      But ultimately, that's all a big lie. You can fool just about every part of the language, but really, it's a Foo, not a Bar.

      I am not encouraging crazy shit like that, although it's occasionally useful (ActiveRecord AssociationProxies pretending to be arrays, for example) -- but it is fun to see just how much rope Ruby will give you:

      NilClass.class_eva

      --
      Don't thank God, thank a doctor!
    26. Re:That's because.. by The_Noid · · Score: 1

      A big difference is that when in Java you assign the result of your operation to an int, and the operation results in a string, you get a clear compile error telling you exactly what went wrong.
      In php you don't get a compile error, and thus errors of this type are very hard to find.

    27. Re:That's because.. by erayd · · Score: 1

      Those operators are not used enough in modern times to justify dedicated characters in my opinion. They should be library function calls.

      Sheesh, when was the last time you did any serious PHP dev? Haven't you ever noticed how the whole bloody thing is *completely* crammed full of bitwise operations designed to make development more efficient? Have you never had to maintain code, or written code, that uses the same approach?

      As an example, let's compare PHP's implementation of curl_setopt() and error_reporting(). With error_reporting(), you just pass it a pile of stuff with bitwise:

      error_reporting(E_ALL & ~E_NOTICE);

      The above code will switch on all error reporting options *except* E_NOTICE. To do the same thing without the use of bitwise operators results in something like curl_setopt(). Every single option needs to be individually set, and you end up with a huge long list of calls to curl_setopt() for something that should be a one-liner.

      To clarify this point, here's what error_reporting() would have to look like to achieve the same thing as the above example if bitwise operators were removed:

      error_reporting(E_ERROR, true);
      error_reporting(E_WARNING, true);
      error_reporting(E_PARSE, true);
      error_reporting(E_NOTICE, false);
      error_reporting(E_CORE_ERROR, true);
      error_reporting(E_CORE_WARNING, true);
      error_reporting(E_COMPILE_ERROR, true);
      error_reporting(E_COMPILE_WARNING, true);
      error_reporting(E_USER_ERROR, true);
      error_reporting(E_USER_WARNING, true);
      error_reporting(E_USER_NOTICE, false);
      error_reporting(E_RECOVERABLE_ERROR, true);

      That, in a nutshell, is a perfect example of just why bitwise operators are still very much a valid language function! There are also many other uses which I won't get into here, but needless to say they're far from dead. I use them many, many times per day in the course of my work, and I doubt there are many (if any) serious PHP developers who wouldn't agree with my opinion on this.

      --
      Forget world peace, bring on -1 pointless
    28. Re:That's because.. by erayd · · Score: 1

      It's not a bug. == is supposed to be used for weakly-typed comparisons, and === for strongly-typed ones. If you care about type, just use === and everything will be fine - that's *exactly* what the operator is there for!!

      --
      Forget world peace, bring on -1 pointless
    29. Re:That's because.. by Just+Some+Guy · · Score: 1

      You can add and multiply strings with the the same operators in Python which also has weak typing.

      Python is strongly typed. PHP assumes you mean to do math and casts everything to a number:

      echo "4" * 5;
      20

      Python assumes nothing, and performs a string operation since the left value is a string:

      >>> "4" * 5
      '44444'
      >>> "4" * "5"
      Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      TypeError: can't multiply sequence by non-int of type 'str'

      It never implicitly casts between dissimilar types (meaning you can still add floats and ints, but can't add an int and a str).

      --
      Dewey, what part of this looks like authorities should be involved?
    30. Re:That's because.. by Anonymous Coward · · Score: 0
      I think they are suggesting

      error_reporting(bit_and(E_ALL, ~E_NOTICE));

      which wouldn't be so bad.

    31. Re:That's because.. by Tetsujin · · Score: 1

      I think they are suggesting

      error_reporting(bit_and(E_ALL, ~E_NOTICE));

      which wouldn't be so bad.

      It kind of would be, actually...

      But what might be better in the context of a high level language would be to not use bit fields for sets of options - but rather, have distinct types used to represent sets of options...

      For instance, in a set of binary-combinable options, you can almost use the "+" operator to combine options. The only reason you can't is because of the danger you'd wind up adding an option twice - or for sets of options that overlap and use the same bits for different things (usually for efficiency, or else to indicate that "option X" also implies "option Y" by necessity...)

      So you could use the "+" operator, basically, as long as the datatype used to implement the bit flags is designed such that it's really a bit set operation and not an addition... If you wanted to be more computer sciencey about it you could instead use some kind of set combination operator or a concatenation operator...

      I think in PHP there's not really much point to bitwise operators... But in languages where I can control how my data is stored, that's another matter...

      --
      Bow-ties are cool.
    32. Re:That's because.. by Tetsujin · · Score: 1

      Oh yeah, and the other option to consider is named function arguments:

      error_reporting(E_ALL = true, E_NOTICE = false);

      This is nice 'cause it gives you a lot of flexibility in how you call things. And then if you want to operate on sets of values you'd pass to a function, you can store the options in an associative array and flatten it out as arguments to a function call later...

      Of course the downside is that this isn't as memory-efficient as something like a bit field... Even in a language like PHP, storing a number is more efficient than storing a mapping from (non-interned) symbols to (arbitrary-type) values...

      --
      Bow-ties are cool.
    33. Re:That's because.. by Anonymous Coward · · Score: 0

      Javascript is a very weakly typed language, yet it uses + for string concatenation and a . for it's namespace separator.

      I wish PHP would morph into a more strongly typed language. I've been doing some Java lately and little things like typecasting are nice features to have in a language.

    34. Re:That's because.. by SoapBox17 · · Score: 1

      Weakly typed means variables have no type to speak or, or they are every type.

      In PHP "5" and 5 are the same thing, there is no difference between them as far as the language is concerned. It is a string and an int, that's the very nature of a weakly typed language. That is what makes them "easy" all conversions are automagic.

      That means in PHP you can do "5" + 5 and the answer should be "10" and 10. It is impossible to know when I give you "5" + 5 + "5" in PHP whether I meant concat or add or some combination.

    35. Re:That's because.. by Anonymous Coward · · Score: 0

      If you don't know the type of the variable you're using I'd say you have more of an architectural issue than anything else.

      While I agree with that view, if you're writing library code in a typeless language, you usually cannot know what's going to be passed into your functions without jumping through inconvenient hoops.

      - T

    36. Re:That's because.. by aesiamun · · Score: 1

      Java does as well as long as you don't instantiate String objects:

      String test = "Hello";
      String test2 = "Hello";

      These are equal using '=='.

      String test = new String("Hello");
      String test2 = new String("Hello");

      These fail the '==' test but test.equals(test2) passes

    37. Re:That's because.. by retiman · · Score: 1

      Weakly typed means variables have no type to speak or, or they are every type.

      This is one definition of "weakly typed" that I hear a lot. Except most folks tack on the fact values *do* have types (otherwise, you're looking at assembly where everything has type bit string or brainf*ck or forth or what have you). The other definition, which I believe is apt, is that the language provides many implicit conversions.

      In PHP "5" and 5 are the same thing, there is no difference between them as far as the language is concerned. It is a string and an int, that's the very nature of a weakly typed language. That is what makes them "easy" all conversions are automagic.

      That means in PHP you can do "5" + 5 and the answer should be "10" and 10. It is impossible to know when I give you "5" + 5 + "5" in PHP whether I meant concat or add or some combination.

      Here is the difficulty. I think you are conflating two different ideas:

      a) Variables do not have types, but values do.
      b) "Lots of" implicit conversions exist in the language*.

      For example, "5" and 5 definitely *are* different as far as the language is concerned. To convince yourself of this, try evaluating is_string(5) and is_int("5"). You can easily be convinced that is_string(5) will always output FALSE, and is_string("5") will always output TRUE. Thus values must have types associated with them. However, the output of is_string($foo) depends on the value of $foo (not the variable).

      With that said, it is correct that PHP will make "easy conversions" "automagically". But this illustrates that PHP definitely is converting a value of some type A to a value of some different type B. And most importantly, PHP knows if a value has some type A or B.

      Okay, now that my pendantic ramblings are out of the way, this is significant because under the hood, PHP can detect if $foo or "5" or whatever is a string. Thus it can make the result of $foo + $bar + $baz be a concatenation if any of $foo, $bar, or $baz are strings, and it can make it an addition if none are strings (or it can add until it finds a string, or whatever).

      This can happen because PHP is a typed language, and it doesn't particularly matter if PHP was dynamically typed, statically typed, "weakly typed", "strongly typed", "duck typed" or whatever.

      So anyways, it *is* possible to use + as both a concatenation and addition operator in a meaningful way. However, to use it the way I have suggested would break existing code. Furthermore, since I haven't really followed PHP development for a while, I can't say if the community would even welcome such a change (if no code needed to be updated).

      * Exactly how many implicit conversions the language must offer to you before you call it weakly typed I do not know. Java offers some implicit conversions, but people call it strongly typed. Ruby offers a lot, but not as many as PHP, and so people argue about whether or not it is weakly typed. Scala offers programmer defined implicit conversions, so I do not even know what to think about weak typing in that case, which is why the term means so little to me.

    38. Re:That's because.. by shutdown+-p+now · · Score: 1

      Java's mistake is that they confuse identity (reference) equality and value equality. "==" is value equality for primitive types, but is identity equality for reference types; and value equality for the latter is "equals".

      This is treated properly in Python and VB, which always use "=" to mean value equality (and disallow its use for types where it's meaningless), and always use "is" to mean identity equality (again, only where it is meaningful). That is good language design.

    39. Re:That's because.. by SoapBox17 · · Score: 1

      Everything you said is true, and I believe it is correct. But I think in a language where variables (as you said, not to be confused with values) have no types it would be nigh impossible to code bug-free situations dealing with user input. All user input is strings, and there are no types on variables, so you have to remember to do explicit conversions and the parser/compiler doesn't provide any warnings when you fail to do so.

  7. But in PHP for Windows by Anonymous Coward · · Score: 5, Funny

    It'll be /, just to keep things interesting.

    1. Re:But in PHP for Windows by Anonymous Coward · · Score: 1, Funny

      I thought they chose \ to make windows users feel like at home..

  8. I have to say they are working really hard.... by A+beautiful+mind · · Score: 5, Insightful

    ...to make PHP the most retarded computer programming language on the planet.

    --
    It takes a man to suffer ignorance and smile
    Be yourself no matter what they say
    1. Re:I have to say they are working really hard.... by FooAtWFU · · Score: 5, Informative

      Oh, they've been at it for a while now ;)

      --
      The World Wide Web is dying. Soon, we shall have only the Internet.
    2. Re:I have to say they are working really hard.... by ThePhilips · · Score: 1

      Hm... Thanks for the link. Enlightening reading.

      Now I'm slowly getting why people even bother to use Python for Web. Pretty much natural choice for all who can't (or refuses) to grok Perl, yet want to have a real language at their disposal.

      I used PHP around year 2000. It was simple like toy. But it seems that its developers didn't realize that the language did outgrow the sandbox they were living in. Also - the responsibility they carry before all the web developers who invested time into learning PHP.

      It seems that the PHP developers had chosen path of M$VB.

      --
      All hope abandon ye who enter here.
    3. Re:I have to say they are working really hard.... by thc4k · · Score: 1

      ... on collecting every bad design choice in one place, to serve as a warning to others. Php has beem the prime source for how-not-to's for ages now, and still manage to come up with new stuff .. respect!

    4. Re:I have to say they are working really hard.... by -noefordeg- · · Score: 1

      Seriously...
      That link compares PHP to Perl.

      I spit on Perl and so does everybody else I know. Had it at least been Python, Java or something, but Perl?!

      My biggest gripe with PHP now, is the lack of support for good IDE with -GOOD- debugging capabilities. God damn !"#%@-Zend...

    5. Re:I have to say they are working really hard.... by Just+Some+Guy · · Score: 1

      For the record, I grok Perl just fine, but fell in love with Python because it felt like "Perl done right". I don't avoid Perl because I have to, but because I can. I just mentioned that because a lot of people really seem to believe that Python is for people who can't handle anything else.

      --
      Dewey, what part of this looks like authorities should be involved?
    6. Re:I have to say they are working really hard.... by VGPowerlord · · Score: 1

      Having used both PHP and Perl for years, some of the arguments presented in that paper are highly misleading.

      For example, the part about exception handling in Perl... because the author doesn't appear to actually understand the difference between general error handling and exceptions. Note that I'm ignoring what it actually compiles down to, because the article is dealing with language constructs, not machine ops.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    7. Re:I have to say they are working really hard.... by SanityInAnarchy · · Score: 1

      Pretty much natural choice for all who can't (or refuses) to grok Perl, yet want to have a real language at their disposal.

      That's flamebait.

      Perl, I can tolerate. PHP, I can't. But Python has a lot of things to like.

      I think it's got more to do with using whatever language you're comfortable with for whatever application you have to write. Sometimes, you run into a wall of sheer unsuitability -- you don't want to write an OS kernel in Perl. But server-side Web development is actually quite forgiving about choice of language -- about the only technical requirement is standard input and output.

      --
      Don't thank God, thank a doctor!
    8. Re:I have to say they are working really hard.... by Kent+Recal · · Score: 1

      I just mentioned that because a lot of people really seem to believe that Python is for people who can't handle anything else.

      Doh, are people really thinking that?
      In reality python is just as much java done right as it is perl done right. Remember python (and ruby FWIW) are higher level languages than java. Not the stuff that your average PHP or Perl monkey is going to grasp without a steep learning curve.

    9. Re:I have to say they are working really hard.... by SanityInAnarchy · · Score: 2, Insightful

      That link compares PHP to Perl.

      And pretty soundly shows Perl to be as good as or better than PHP, in some fundamental ways.

      I spit on Perl and so does everybody else I know.

      You apparently don't know a lot of people who actually understand Perl.

      --
      Don't thank God, thank a doctor!
    10. Re:I have to say they are working really hard.... by Chandon+Seldon · · Score: 1

      fell in love with Python because it felt like "Perl done right"

      If it just had lexical closures and the ability to declare and statically check variable names, I'd totally agree with you. As it is, it's basically just like PHP - Perl with useful features *removed*.

      --
      -- The act of censorship is always worse than whatever is being censored. Always.
    11. Re:I have to say they are working really hard.... by ThePhilips · · Score: 1

      Pretty much natural choice for all who can't (or refuses) to grok Perl, yet want to have a real language at their disposal.

      That's flamebait.

      Unintentional. I wrote it that way since Perl has been polarizing people: some love it, some hate it.

      But frankly, if you look back in the times of PHP inception, Python wasn't there yet. It was still some toy language made by some guy called van Rossum to be used as educational tool. Perl was pretty much de facto language for Web. PHP provided templates for web pages what allowed to put some designers to do work without much understanding by using plain copy-pasting.

      Now you already can't choose/change language easily as you could in past. Service libraries and frameworks - as per project requirements - pretty much define what language one would use. You wouldn't want to start every new project from ground zero. (N.B. The topic here is namespaces in PHP. The whole point of namespaces is to facilitate development of components.)

      CGI days (only technical requirement is standard input and output) are long gone. You gonna end up with huge performance problems unless you would use something more modern and advanced than trivial piping. PHP, as something running inside web server, also put some nails into CGI coffin.

      --
      All hope abandon ye who enter here.
    12. Re:I have to say they are working really hard.... by encoderer · · Score: 1

      What, exactly, was enlightening?

      That PHP5 made great leaps forward by implementing a true object model?

      Or the fact that PHP5, while good, was not the end-all-be-all that could fix every issue anyone has ever had?

      Because if you actually read the link, that's the conclusion the author presents.

      If you used PHP in 2000 then you probably used 3.x, or, maybe, an early 4.x version.

      Not sure if you realize, but the language was rewritten from scratch for the 4.x release. So much so that it's really a different language entirely. So you either used the last release of the predecessor of modern PHP, or you used the very first version of a language.

      Now tell me: Do you really think that makes you qualified to pass judgment on, arguably, the most widely-used language on the internet?

    13. Re:I have to say they are working really hard.... by gbjbaanb · · Score: 1

      Now tell me: Do you really think that makes you qualified to pass judgment on, arguably, the most widely-used language on the internet?

      Show me where he criticised javascript and I'll accept that he's unqualified to pass judgement on the most widely-used language on the planet.

      I understand Perl is the 2nd (in North America)(3rd overall otherwise).

    14. Re:I have to say they are working really hard.... by encoderer · · Score: 1

      Actually, I said "arguably, the most widely-used language on the internet"

      And according to, you know, actual facts...

      http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

    15. Re:I have to say they are working really hard.... by MikeBabcock · · Score: 1

      I too noticed PHP around 1999 - 2000 and found it very nice to use compared to Cold Fusion and other languages at the time.

      I've since moved on to Python for almost everything, Zope in particular being a very powerful web development language.

      --
      - Michael T. Babcock (Yes, I blog)
    16. Re:I have to say they are working really hard.... by chromatic · · Score: 1

      Excel is probably the most widely-used programming language on the planet.

    17. Re:I have to say they are working really hard.... by MikeBabcock · · Score: 1

      And Windows is the mostly widely used OS on the Internet. McDonald's is the largest restaurant chain in the world. Any questions?

      I don't see how mass appeal has anything to do with quality.

      --
      - Michael T. Babcock (Yes, I blog)
    18. Re:I have to say they are working really hard.... by gbjbaanb · · Score: 1

      I used Evans Data survey (you need to pay for it, but its widely popular amongst CIOs:

      Dynamic languages are certainly popular. Almost 70 percent of the 1,200 developers surveyed by Evans Data for its most recent Global Development Survey currently use JavaScript, the most popular dynamic language, with fifteen percent more planning to adopt it. PHP is used by just over a third of developers, and Perl has captured about a quarter of developers (though Perl is much more popular in North America, with 36 percent spending at least some of their time using it).

      I guess it depends on the methodology, I'm a C++ dev, but even I use javascript occasionally.

    19. Re:I have to say they are working really hard.... by Jesus_666 · · Score: 1

      Wouldn't that article also make the point that C, C++, C#, Python, Ruby, Java and everything else that isn't Perl are retarded as well. That article's sole argument is "Perl does it differently so it must be wrong", which applies to everything, even different versions of Perl.

      Given the fact that Perl is notorious for allowing scripts indistinguishable from line noise I'd reconsider considering it a reference for good language design.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    20. Re:I have to say they are working really hard.... by Jesus_666 · · Score: 1

      If we're already nitpicking, the GP never said "scripting language" and HTML is used more often that JavaScript, I'd think.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    21. Re:I have to say they are working really hard.... by arilian · · Score: 1

      What it isn't already. No wait that's python. I just missed an indent, there goes the planet.

    22. Re:I have to say they are working really hard.... by Grant_Watson · · Score: 1

      If it just had lexical closures...

      Technically it has them-- it just has no syntax to let you modify the captured variables, which of course makes them dramatically less useful.

    23. Re:I have to say they are working really hard.... by DiegoBravo · · Score: 1

      Interesting link, but the arguments are too similar to the classical die-hard C programmers that never did learn OO principles, kind of:

      "you can create objects with structures and function pointers"
      "several c-toolkits are already object oriented -for example, X-intrinsics, so we don't need this C++ crap".

      Also, note that most (if not all) of the rant about the silly OO-constructs in PHP5 apply to Java... so the conclusion is that Perl is better than Java in OO support.

    24. Re:I have to say they are working really hard.... by chromatic · · Score: 1

      Close over a single-element array, then modify the first element of the array.

    25. Re:I have to say they are working really hard.... by chromatic · · Score: 1

      Given the fact that Perl is notorious for allowing scripts indistinguishable from line noise...

      1957 called. It wants its joke (about APL) back.

      (I believe you meant to say "Perl is notorious for almost never breaking backwards compatibility.")

    26. Re:I have to say they are working really hard.... by SanityInAnarchy · · Score: 2, Interesting

      CGI days (only technical requirement is standard input and output) are long gone.

      Well, not really. It still works. Your biggest complaint:

      You gonna end up with huge performance problems unless you would use something more modern and advanced than trivial piping.

      That is a vertical scaling concern. If vertical scaling is that important to you, consider using C, instead.

      Not that it's unimportant. I'm just saying -- if all we had was CGI, there's no reason we couldn't still throw hardware at the problem.

      No, I was talking about things like FastCGI, or even more relevantly, in-application webservers. It turns out, talking HTTP really isn't that hard. Ruby has, by my count, six separate in-application webservers supporting the common Rack API.

      Throw a load balancer like nginx in front of them, and what do you need Apache for? Other than old apps which were tied too closely to it -- some mod_php (though those mostly tend to work with php as fcgi), and especially some mod_perl -- but that's about it.

      In other words: HTTP itself is the new CGI. And that still gives you plenty of flexibility about what you choose for an implementation language.

      Now you already can't choose/change language easily as you could in past. Service libraries and frameworks - as per project requirements - pretty much define what language one would use.

      Not many project requirements dictate specific frameworks -- and they shouldn't.

      Services, maybe, but honestly, any service that needs such a huge library that you wouldn't port it to a better platform is too complex a service, and also too rigid a library.

      --
      Don't thank God, thank a doctor!
    27. Re:I have to say they are working really hard.... by Jesus_666 · · Score: 1

      (I believe you meant to say "Perl is notorious for almost never breaking backwards compatibility.")

      Ah, so that's the root fault.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    28. Re:I have to say they are working really hard.... by mike_sucks · · Score: 1

      Heh heh heh. Yeah. Just when you think it couldn't get any worse...

      Still, this gives me new hope that human creativity hasn't yet reached its limit - it's not easy finding such new depths.

      /Mike

      --
      -- "So, what's the deal with Auntie Gerschwitz et all?"
    29. Re:I have to say they are working really hard.... by chromatic · · Score: 1

      The root fault is probably compatibility with Awk's global variables, combined with regular expressions.

    30. Re:I have to say they are working really hard.... by renoX · · Score: 1

      >>I spit on Perl and so does everybody else I know.
      >You apparently don't know a lot of people who actually understand Perl.

      Of course, everyone who know and dislike Perl are just those who don't "understand it".
      *Sigh*, will you stop making excuse??
      You free to like Perl, but me the more I know Perl, the more I dislike it!

    31. Re:I have to say they are working really hard.... by doom · · Score: 1

      I spit on Perl and so does everybody else I know.

      Wow, you're a cool hepcat, daddio. I want to hang with you and your friends. They must be really smart, they say just what all the smart people are saying.

    32. Re:I have to say they are working really hard.... by doom · · Score: 1

      I think the root fault is letting people make lame excuses for writing badly structured, undocumented code (the language made me do it!).

    33. Re:I have to say they are working really hard.... by chromatic · · Score: 1

      That doesn't help, but there are definitely language features which help people structure, abstract, and encapsulate code well. Lexical variables, automatic memory management, namespaces, higher-order functions, sane numerics, safe string handling, genericity, pervasive polymorphism, and hygenic macros are all good examples. You don't need any of them to write good code, but they do help.

    34. Re:I have to say they are working really hard.... by SanityInAnarchy · · Score: 1

      You apparently don't know a lot of people who actually understand Perl.

      Of course, everyone who know and dislike Perl are just those who don't "understand it".

      I didn't see that. I said you apparently don't know a lot of people who actually understand Perl.

      I know people who understand Perl and are indifferent. I know people who understand Perl and love it. I know people who never learned much Perl, and are indifferent.

      I don't actually know people who hate Perl. Those I hear from most often hate it for things like "line noise", which shows a bit of snobbery and an unwillingness to explore deeper.

      Of course, this argument is a lot more powerful when applied to Javascript...

      --
      Don't thank God, thank a doctor!
    35. Re:I have to say they are working really hard.... by Anonymous Coward · · Score: 0

      Perl is not the language I would use if I wanted a sane OO environment...

      It's a hacked on afterthought.

    36. Re:I have to say they are working really hard.... by renoX · · Score: 1

      >I don't actually know people who hate Perl

      Well, I do: it's not so much about the line noise which I dislike but because I consider Perl to have a poor design which makes everything that should be simple convoluted, so it's a time waster compared to "sane" scripting language such as Ruby or Python(*) and I'm stuck at work having to maintain or write new Perl scripts as Ruby&Python aren't allowed.

      *:though I'd prefer that Ruby&Python provide a 'use strict' mode as Perl do, except that it should be on by default.

    37. Re:I have to say they are working really hard.... by SanityInAnarchy · · Score: 1

      I consider Perl to have a poor design which makes everything that should be simple convoluted

      On the contrary, I see Perl as an incredibly simple, transparent design. Particularly the object system -- objects are just hash references associated with modules, and this is absolutely bare to the user.

      Contrast this to Ruby -- perhaps it's implemented as a hash, but instance variables cannot be accessed like a hash without some extra work.

      Perl inheritance was simple, multi-inheritance through the @ISA array. If there's a way to change the inheritance of a class in Ruby, I don't know how -- and Ruby only supports single inheritance. (Yeah, I know, mixins -- but you can't exactly un-include mixins either.)

      I currently use Ruby, and I don't really want to go back to Perl, I'm just saying -- the complaint you have is actually the opposite of my experience. Ruby has simpler syntax, but there are things which are much harder to do than in Perl.

      I'd prefer that Ruby&Python provide a 'use strict' mode as Perl do, except that it should be on by default.

      Absolutely. In fact, there's one thing I really miss here: Local variables.

      Sure, they exist, but there is no syntax for pre-declaring them, and no way to error if they aren't pre-declared. That would catch some obvious typos.

      There's also the issue that sometimes (but not always), attempting to access or set a certain local variable will actually call the accessors on the current object. You can force that explicitly, but it seems like it would lead to subtle bugs.

      All of which could be solved easily by forcing locals to be predefined, and at least warning when they aren't.

      That's the one thing I'd actually want to port from Perl to these other languages.

      All that said, I'm still not going back to Perl, but I certainly don't hate it.

      --
      Don't thank God, thank a doctor!
  9. While at it... by Shados · · Score: 1

    While at it, they should have picked a page from the W3C and made namespaces full, compliant URIs.

    That would have been epic! /sarcasm.

  10. yet another wtf by larry+bagina · · Score: 3, Interesting

    The rfc claims that typing "**" is easier than typing "%%" or "^^".

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

    1. Re:yet another wtf by Anonymous Coward · · Score: 1, Insightful

      All I can say is that "\" is a key combination of a right hand key with AltGr on a German keyboard. How is that easy to type? "::" is Shift-. on all keyboards that I know of.

    2. Re:yet another wtf by Mental+Maelstrom · · Score: 2, Funny

      AltGr + Plus [the key right of number 0] on Estonian layout also. This is so discriminatory! :P

      We should use a character present on most keyboard layouts. I propose the use of the Space-key for this purpose.

    3. Re:yet another wtf by Televiper2000 · · Score: 1

      This sounds similar to some programmers complaining about case sensitivity. If there is a typo risk in typing the same same character two or three times in a row ala ::: or ** how in the world are you having any success with the other 20,000,000 characters you're stringing together?

      --
      New! Device Legs: These legs will help your poor OEM installed product escape any hamfistedness it may encounter. Ava
    4. Re:yet another wtf by e4g4 · · Score: 1

      The rfc [php.net] claims that typing "**" is easier than typing "%%" or "^^".

      But it is! ... if your right shift key is broken...

      --
      The secret to creativity is knowing how to hide your sources. - Albert Einstein
    5. Re:yet another wtf by wizactive · · Score: 0

      Yeah, I only need to press 3 buttons to get \ (shift+alt+7) instead of 2 with : and I still don't like the look of the \ separator in code.

      --
      wiza
  11. A long overdue addition by DontLickJesus · · Score: 2, Insightful

    As a developer who primarily works with C#/.Net, with a little PHP on the side, IMO this addition is long overdue. It would be nice to have a more standard separator, but when I RTFA they seem to have a just reason for it, and it's using semantics that PHP coders are used to. I will happily adjust myself in this ONE manor in order to reap the MANY benefits of namespaces.

    Just my 2 cents.

    --
    Where genius and insanity become confused true wisdom is found
    1. Re:A long overdue addition by FooAtWFU · · Score: 5, Funny

      I will happily adjust myself in this ONE manor

      While you're livin' it up at your stately manor, I'm coding PHP out of my garage, you insensitive clod!

      --
      The World Wide Web is dying. Soon, we shall have only the Internet.
    2. Re:A long overdue addition by Shados · · Score: 4, Insightful

      Thats all good. I personally feel its just easier to avoid PHP altogether and not have to adjust to all of the language's quirks for little to no benefits from other offerings. Simpler that way.

    3. Re:A long overdue addition by Anonymous Coward · · Score: 0

      Garage? Hey, fellas, the garage. Well, ooh la-di-da, Mr. Frenchman.

  12. The BASIC of the 21st century by mangu · · Score: 5, Insightful

    I once did a lot of work on PHP. Today, when people ask me for upgrades I just migrate it to Python.

    This unfortunate choice of the escape character for namespace separator is stupid, but seems almost irrelevant to me. How many nails do they need in the PHP coffin to bury it?

    1. Re:The BASIC of the 21st century by rawg · · Score: 1

      and I'm migrating them over to Ruby on Rails or Merb. PHP is lame.

      --
      The above is not worth reading.
    2. Re:The BASIC of the 21st century by Dragonslicer · · Score: 5, Funny

      PHP is far from dead. PHP5, with support for real OO, was a huge improvement. There's been a lot of hard work put in to PHP in the last few years to make it a much more viable modern programming language.

      Then I see people suggesting \ for a namespace separator, and I wonder what happened to all the people that put so much work into making PHP5 good, and why we can't get them back.

    3. Re:The BASIC of the 21st century by mangu · · Score: 2, Insightful

      I wonder what happened to all the people that put so much work into making PHP5 good, and why we can't get them back.

      The last one was seen downloading a Ruby On Rails development environment.

    4. Re:The BASIC of the 21st century by bjtuna · · Score: 0

      So, when people ask you for minor upgrades on their existing PHP websites, you rewrite the whole thing in Python. Do you really? I'm not buying it.

    5. Re:The BASIC of the 21st century by Anonymous Coward · · Score: 0

      Well, it's apparent that they rejected double-colon ("::") because they didn't want folks to be confused with DECnet node names.

    6. Re:The BASIC of the 21st century by Anonymous Coward · · Score: 0, Flamebait

      Notice how he said "when people ask me", meaning he's just yet another college guy who has done a few pages for some club or whatnot and therefore thinks he's hot shit. He has obviously never worked in a professional development environment, where the technology used to create the web front end is largely totally irrelevant as that layer is given so little control that anything will work. I get happy just thinking about this guy then he leaves his college with his worthless degree, getting hit right in the face when he comes out and realizes that web developers are the IT world's equivalence to fluffers in porn.

    7. Re:The BASIC of the 21st century by mangu · · Score: 1

      I don't do minor upgrades, there are other people for that. When a major upgrade is needed, let's say from version "2.7" to "3.0" they call me.

    8. Re:The BASIC of the 21st century by Anonymous Coward · · Score: 0

      Since PHP is so widely spread:

      I'm just waiting for some nutcase to develop a "sensible programming language to PHP" compiler.

      That would make things even more interesting. =)

    9. Re:The BASIC of the 21st century by faraway · · Score: 2, Funny

      I don't do minor upgrades, there are other people for that. When a major upgrade is needed, let's say from version "2.7" to "3.0" they call me.

      Wow. So you're the guy that does those small changes huh? They usually call me for "3" to "4". I write it all in machine language for optimized speeds and job protection.

    10. Re:The BASIC of the 21st century by mweather · · Score: 2, Interesting

      It's not that hard to convert existing websites into Django, Pylons or TurboGears apps. Usually it's much faster than familiarizing yourself with the PHP code enough to make the needed changes.

    11. Re:The BASIC of the 21st century by Saint+Stephen · · Score: 3, Funny

      in other words you're incapable of maintaining code and you rewrite the same thing for them in a different language...

    12. Re:The BASIC of the 21st century by chrysalis · · Score: 3, Insightful

      PHP ? Real OO? Thanks for the great joke.
      How can I add methods to Number? Ehm you know, the class used for numbers... In order to write 3.times() for instance... ah, it doesn't exist? Ok, so how can add methods to strings? Impossible, strings aren't objects either?

      Stop kidding.

      Why do PHP programmers use classes for? Just to avoid collisions between two functions with the same name when files are included. Really... very few PHP code instanciates more than one object per class.

      Introduction of namespaces might limit this.

      But there's something else that PHP miss: a "static" keyword.

      Guess how very large source code like OS kernels or demos have been built in C or assembler, without namespaces, without classes, without symbols like \, but without coders constantly fighting about names collisions?

      The reason is file-local symbols, ie. the static keyword in C (and local symbols in assembler). Only export (ie. make non-static) what you need to use in other files. As a bonus, it helps the compiler in order to optimize the code.

      --
      {{.sig}}
    13. Re:The BASIC of the 21st century by Anonymous Coward · · Score: 0

      Give the guy a break. He's a web developer. They only know one language and one framework, and they all think their solution is superior and that everything should be done using it.

    14. Re:The BASIC of the 21st century by kestasjk · · Score: 1

      Dare I ask; what's wrong with \ as a namespace separator?

      --
      // MD_Update(&m,buf,j);
    15. Re:The BASIC of the 21st century by dkf · · Score: 1

      Mod parent up please, Funny. (I don't want to remember DECnet...)

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    16. Re:The BASIC of the 21st century by tepples · · Score: 1

      I once did a lot of work on PHP. Today, when people ask me for upgrades I just migrate it to Python.

      How long would it take you to rewrite something as big as MediaWiki or phpBB in Python?

    17. Re:The BASIC of the 21st century by neoform · · Score: 1

      I keep hearing people recommend python over php, I've given python a whirl several times now, but the severe lack of documentation on proper web programming for python is keeping me from actually switching.

      No, I don't want to use a framework. Yes, I want a full book outlining proper coding practices for web programming. No I have no found such a thing.

      --
      MABASPLOOM!
    18. Re:The BASIC of the 21st century by Anonymous Coward · · Score: 0

      As a, primarily, web developer, I have to object ;-) While most of my work day is spent coding PHP (4.1, because the boss wants it so *shudder*) and JavaScript, I'm also competent in Java, can get and actually have gotten by in C, C#, C++, Python, Perl, Haskell, Lisp, ScriptFu, Prolog and probably a few others, just like anyone else who has groked how programming works _in_principle_. We're not all Monkeys with typewriters, some of us can do good software no matter what the language, which is just a tool.

    19. Re:The BASIC of the 21st century by Anonymous Coward · · Score: 0

      package ubpackage    ertiarypackage
      extpackage

      But seriously, everything else uses it...what's wrong with:

      package.subpackage.tertiarypackage.nextpackage

      Picking something like '/' just indicates that they're trying to be different for the sake of being different.

    20. Re:The BASIC of the 21st century by Adam+Jorgensen · · Score: 2, Informative

      Erm... You sir, are a twit... Seriously... Yes, there are a lot of crap PHP coders out there. And yes, there is a lot of awful PHP code out there. As is always the case though, that is not the be all and end all. There is actually good PHP code out there, there are actually good PHP coders out there. Describing PHP as the BASIC of the 21st century is actually quite ridiculous and merely illustates that your encounters with the langauge have been limited to bad experiences rather than good ones. Also, your rant about the static keyword (Which PHP does have but which is used in a different fashion) is compltely IRRELEVANT because you are comparing apples (C) and potatoes(PHP). Just because PHP looks like C does not mean that it is C. Please reapply to the Department of Mental Affairs for a functioning brain...

    21. Re:The BASIC of the 21st century by Anonymous Coward · · Score: 0

      But there's something else that PHP miss: a "static" keyword.

      Not so.

    22. Re:The BASIC of the 21st century by Anonymous Coward · · Score: 0

      But there's something else that PHP miss: a "static" keyword.

      http://us2.php.net/manual/en/language.oop5.static.php

    23. Re:The BASIC of the 21st century by Anonymous Coward · · Score: 0

      static is a keyword in PHP fyi.

    24. Re:The BASIC of the 21st century by Anonymous Coward · · Score: 0

      Why do PHP programmers use classes for? Just to avoid collisions between two functions with the same name when files are included.

      Are you joking? Do you seriously understand OO on such a pedestrian level? Have you heard of code clarity? Have you heard of inheritance? Have you heard of design patterns? Have you heard of loosely coupled code, polymorphism, coding to an interface? Anything? Do you even know what OO is? Seriously, your misinformation is freakin ridiculous. PHP's not my thing either but don't deliberately spread mistruths. It shows your lack of intellectual honesty.

    25. Re:The BASIC of the 21st century by Dragonslicer · · Score: 1

      PHP ? Real OO? Thanks for the great joke. How can I add methods to Number? Ehm you know, the class used for numbers... In order to write 3.times() for instance... ah, it doesn't exist? Ok, so how can add methods to strings? Impossible, strings aren't objects either?

      Sorry, by "real" I meant "useful". Obviously PHP is not a pure OO language, or even primarily OO like Java.

      In many cases, all you need classes for is as a convenient grouping of functions and an array/hash. The system I work on, though, has quite a few abstract classes with several child classes, and it works just about exactly like Java.

      As several people have already said, I don't know why you think PHP is missing the "static" keyword. PHP supports static function variables as well as the static properties and methods of OO.

    26. Re:The BASIC of the 21st century by skeeto · · Score: 1

      Some of the responses to your post claim that there is a static keyword in PHP, which is true in the OO sense. But this is not the static you were talking about: there are actually two of them.

      In C, the static keyword serves two different purposes depending on the context. A static variable inside of a function means the variable is not allocated on the call stack, but rather in the static (hence the name) data segment of memory. This is handy for preserving values across different calls of the function, but also responsible for making many functions non-reentrant. It's almost global variable because the variable is bound for the entire life of the process. This is exactly what the static keyword in OO languages do. The variable is not stored on the heap with the object, but in a static segment shared by all instances of the object, and also allowing it to be accessed without an instance of the object.

      The second meaning of static, which is what you are talking about, is really a directive to the linker. When the keyword is applied to a global variable, it tells the linker to not link the variable to any other global variables outside the source file (no external linking), even if the variables share the same name. This allows files to also act as namespaces, and lets C programmers hack away with few naming collisions. PHP does not have this version of static and, as you said, requires classes to make these namespaces.

    27. Re:The BASIC of the 21st century by skeeto · · Score: 1

      Oops, meant to post this thing up one level.

    28. Re:The BASIC of the 21st century by skeeto · · Score: 1

      This isn't the same static the parent post was talking about, which is the static PHP actually doesn't have. I explain it here.

    29. Re:The BASIC of the 21st century by skeeto · · Score: 1

      This isn't the same static the parent post was talking about, which is the static PHP actually doesn't have. I explain it here.

    30. Re:The BASIC of the 21st century by skeeto · · Score: 1

      This isn't the same static the parent post was talking about, which is the static PHP actually doesn't have. I explain it here.

    31. Re:The BASIC of the 21st century by skeeto · · Score: 1

      As several people have already said, I don't know why you think PHP is missing the "static" keyword. PHP supports static function variables as well as the static properties and methods of OO.

      This isn't the same static the parent post was talking about, which is the static PHP actually doesn't have. I explain it here.

    32. Re:The BASIC of the 21st century by Anonymous Coward · · Score: 0

      Not to rain on your parade, but if you were part of "some of us can do good software no matter what the language", you wouldn't be working in web development, especially not with PHP. Web developers tend to get a bad reputation, and it's for a good reason. It's easy to get in to, and it's easy to put something together without really knowing what you are doing. At the first sight of problems, they blame the tool/language/framework used, mostly because it's foreign and they lack the ability to pick something up quickly.

      Now, I'm not saying that this is you, but if you are a competent and experienced developer and still work in development, there's at least one thing you are missing: ambition; anyone can get by in web development. You could say that 99% of all web developers give the remaining 1% a bad rep.

    33. Re:The BASIC of the 21st century by nidarus · · Score: 1

      PHP ? Real OO? Thanks for the great joke. How can I add methods to Number? Ehm you know, the class used for numbers... In order to write 3.times() for instance... ah, it doesn't exist?

      OK, and how do you do this (add methods to existing classes) in C++ or Java? What, there's no simple way to do it? And... you do know that both of those (incredibly popular, OOP) languages have non-object basic types?

      Or maybe you're just one of those Smalltalk snobs. Wait... it's probably not it, because you apparently don't see the point of OOP at all, except for modifying basic types (which is usually a BAD idea, even if your language supports it).

      And, FYI, there are many PHP-based projects that do use OOP. For example, CakePHP and its ilk, and I understand that Joomla has gone OOP as well (drupal is still implements its own crazy system though). What's more, since many web frameworks use OOP, the average PHP programmer has a very good chance of using "real" OOP as well.

    34. Re:The BASIC of the 21st century by DocHoncho · · Score: 1

      ask, and ye shall receive:

      http://haxe.org/

      --
      Celebrity worship is a poor substitute for Deity worship and costs more to boot.
  13. Backslash! by SEWilco · · Score: 3, Funny

    Just make sure they name it a backslash in the documentation, not a slash.

    1. Re:Backslash! by ari_j · · Score: 1

      They can't do that, sorry. PHP developers are the kind of people who already call / a "backslash." Maybe a "double backslash," and then it can have its own theme song by ZZ Top.

    2. Re:Backslash! by berbo · · Score: 1
      We'll have to create a new website for PHP news:

      backslashdot.org

  14. Well now we all know what trouble this is going .. by 3seas · · Score: 4, Funny

    ... to cause for windows servers...

    imagine what directories will be deleted due to a typo!

  15. F\ck by vawarayer · · Score: 1

    F\ck :P

  16. Well, That Does It! by maz2331 · · Score: 0, Flamebait

    OMFG - this addition is just so horrid that everyone's going to give up on PHP and start coding Web apps in C++ through CGI interfaces again. /Sarcasm

    Seriously, who cares what charater they are using? Developers are smart enough to adapt.

    1. Re:Well, That Does It! by Anonymous Coward · · Score: 0

      OMFG - this addition is just so horrid that everyone's going to give up on PHP and start coding Web apps in C++ through CGI interfaces again. /Sarcasm

      Seriously, who cares what charater they are using? Developers are smart enough to adapt.

      I would love to agree with you and formerly would have done but judging by some of these comments... *shudders*

    2. Re:Well, That Does It! by Zontar+The+Mindless · · Score: 3, Insightful

      It's not just developers, it's things like IDEs which highlight anything starting with '\' as an escape sequence.

      Which - since nearly every other common programming or scripting language uses '\' to mark the beginning of an escape sequence - is something you might reasonably expect.

      Come to think of it, so does PHP... ooops...

      --
      Il n'y a pas de Planet B.
    3. Re:Well, That Does It! by TheRaven64 · · Score: 1, Funny

      There are lots of valid reasons for hating any given language, but syntax is rarely one of them. (Lisp excepted)

      --
      I am TheRaven on Soylent News
    4. Re:Well, That Does It! by larry+bagina · · Score: 2, Interesting

      This isn't the first (or last) time PHP developers have implemented a stupid workaround rather than fixing problems with the language/runtime/interpreter/parser/scanner.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    5. Re:Well, That Does It! by Anonymous Coward · · Score: 1, Funny

      You mean "language\runtime\interpreter\parser\scanner".

    6. Re:Well, That Does It! by msuarezalvarez · · Score: 1

      Syntax is perfectly good grounds for hating a language.

    7. Re:Well, That Does It! by encoderer · · Score: 1

      Oh please.

      When I write this:

      function foo() {}

      it highlights the word "function" in blue.

      Somehow, miraculously, when I type:

      $x = "function foo() {}";

      The IDE knows that this isn't a function declaration. And, lo and behold, so does the PHP interpreter.

      Now tell me why you think an IDE will have trouble differentiating:

      $x = 'this isn\'t hard';

      and

      $x = myNamepace\myClass::myFunction();

    8. Re:Well, That Does It! by Anonymous Coward · · Score: 0

      Any IDE that colors anything starting with \ as an escape sequence free of context is just lazy. Usually, this is only done inside of a string. Furthermore, a good editor should know what is and isn't an actual escape sequence. For example, vim doesn't color escape sequences in single-quoted strings under PHP because PHP doesn't evaulate them (except \').

    9. Re:Well, That Does It! by Phroggy · · Score: 1

      Download a minor update to your IDE, and you should be fine.

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    10. Re:Well, That Does It! by Anonymous Coward · · Score: 0

      You mean "language\\runtime\\interpreter\\parser\\scanner".

  17. \ instead of :: ? by AdmiralXyz · · Score: 1

    This means eternal war!

    --
    Dislike the Electoral College? Lobby your state to join the National Popular Vote Interstate Compact.
    1. Re:\ instead of :: ? by hvm2hvm · · Score: 1

      Hmm, somehow watching through a lot of Doctor Who episodes today has made your comment extremely funny.

      --
      ics
  18. other issues by adamruck · · Score: 4, Insightful

    Maybe they could starting fixing the noun-verb vs verb-noun problems instead.

    --
    Selling software wont make you money, selling a service will.
    1. Re:other issues by mdmkolbe · · Score: 1

      I speak an subject-object-verb language you insensitive clod. RPN is the One True Way.

    2. Re:other issues by dascritch · · Score: 1

      or (needle,array) / (array,neddle) confusion

      Even with years of coding, I can't remember exactly function names or attributes, which is blaming when PHP.net site is down.

      I bet having better naming/call conventions will save them wagons of bandwith !

      --
      (Sorry my bad French) Je fais parler les Guignols de l'Info. Le pied, quoi.
    3. Re:other issues by Fweeky · · Score: 1

      Hey now, you know what happens when you start treating one as being better than the other.

  19. Today is a Wonderful Day by redink1 · · Score: 5, Funny

    The number of days that an old, crusty Perl developer can laugh at another language are few and far between.

    Thank you, PHP.

    1. Re:Today is a Wonderful Day by siride · · Score: 3, Interesting

      Perl once used "'" to separate package name parts. Still does for backwards compatibility. Really annoying. Oops! I love Perl, btw.

    2. Re:Today is a Wonderful Day by Krishnoid · · Score: 1

      Oops! I love Perl, btw.

      'Oops'? Don't you mean D'oh ?

    3. Re:Today is a Wonderful Day by Anonymous Coward · · Score: 0

      Wait a minute, what exactly are you complaining about now?

      1) The fact that ' was once used to separate package name parts, even though it isn't anymore tody
      2) The fact that the Perl developers realised this wasn't a good idea and changed it
      3) The fact that for the sake of not breaking old scripts, the syntax is still understood by Perl

      I'll agree that it wsn't a good idea to use ', but surely, it's acceptable to make honest mistakes as long as you realise them later on and fix them? Requiring perfection right from the start just won't work, ever.

  20. so what's the problem here? by Tumbleweed · · Score: 1

    Is the problem that they chose something 'different' than what everyone else uses, or is there a real technical reason behind the snarkiness? I think it's a good thing they even considered the issues involved, though I'd disagree with the 'ease of typing' issue - once your fingers leave the home row, you dramatically increase the chances of a typo. People who aren't touch typists have some pretty serious misunderstandings about typing ease. (Hello, Apple keyboard designers, I'm looking at you.)

    1. Re:so what's the problem here? by mysidia · · Score: 5, Informative

      The problem is not merely that it is different.

      The problem is they chose the ESCAPE character as a namespace separator.

      This is even worse than using $ as the namespace separator.

      Because of the problems it causes syntax highlighters, the problem it causes to programmer sanity when storing identifier names in a string.

      The problem it causes when searching through and sanitizing code.

      For example, since \ has a special meaning in the context of a regular expression, searching and replacing using regular expressions just got very painful.

      Copy and paste no longer works for searching and substituting.

      Refactoring just became a major bitch.

    2. Re:so what's the problem here? by mdmkolbe · · Score: 1

      The "\" is also an escape character in just about every language out there including PHP. Thus as one of the articles notes the following is misleading: spl_autoload_register(array("Foo\tBar", "loader")). The "\t" is a tab and not a module separation. There are plenty of other characters they could have chosen (e.g. maybe "/" or "::" or even "|" (*)) so in the absence of a really good explanation why those others are worse than "\", it sounds like a crazy design choice. Generally speaking overloading your escape character is a bad idea (**).

      (*) I do not know PHP so those characters may have their own problems.

      (**) The first person to put "ESC" on the keyboard royally messed up terminal encodings for ever after.

    3. Re:so what's the problem here? by coryking · · Score: 2, Interesting

      1) "/" - used by almost all languages in regex expressions. I wouldn't want to pollute that namespace.
      2) "::" - Awesome. Many other languages do this. I think this is already taken for PHP, but I dont know PHP well enough
      3) "|" - Pipe has a very specific meaning on the command line and I'd hate to pollute that. Plus it looks ugly.
      4) "~" - Any reasons this wouldn't work?
      5) "." - Again, awesome. Many other languages use this.
      6) "!" - Used
      7) "&" - Ugly, used.
      8) "," - Why not? Does any language use the comma for anything? Might be kinda ugly though "$var = My,Class($arg1);"

    4. Re:so what's the problem here? by Tumbleweed · · Score: 1

      OMG, an informative reply on Slashdot! I think you're my hero for the day. :)

      Thanks for the info. This really DOES look like an asinine decision.

    5. Re:so what's the problem here? by sabernet · · Score: 1

      Or even something more visually interesting like '~>', ':>' or '-->' for readability.

      But for your #5 point, PHP uses . for concatenation. That would get ugly.

    6. Re:so what's the problem here? by Anonymous Coward · · Score: 0

      how about @? I don't know any language other than cyclone using @ character for anything.

    7. Re:so what's the problem here? by sabernet · · Score: 1

      @ signs are for arrays in Perl. Not sure if it's used for anything in PHP since it uses $ for both var and array declarations.

    8. Re:so what's the problem here? by mdmkolbe · · Score: 1

      Yes, but it's not so important whether other languages use (1) or (3) as much as whether they are used by PHP. Actually it more whether they are used by PHP in a potentially conflicting way. That is, if regex's and pipelines can't in the context as a namespace then "/" and "|" should still be just fine.

    9. Re:so what's the problem here? by laddy · · Score: 1

      PHP uses @ to suppress warnings from functions.

    10. Re:so what's the problem here? by kaens · · Score: 1

      @ is used for:

      * Decorators in Python
      * Annotations in Java
      * Address operator in Delphi
      * Instance variables in Ruby
      * Arrays in Perl
      * Suppressing warnings in PHP (wtf.)

    11. Re:so what's the problem here? by Tetsujin · · Score: 1

      1) "/" - used by almost all languages in regex expressions. I wouldn't want to pollute that namespace.

      Don't forget little things like division... But if you can get over that conflict, then using slash is nicely analogous to path separators at the shell...

      2) "::" - Awesome. Many other languages do this. I think this is already taken for PHP, but I dont know PHP well enough

      I think somebody said it's already used for class static methods. I don't understand why that can't be the same syntax as namespace references, though...

      3) "|" - Pipe has a very specific meaning on the command line and I'd hate to pollute that. Plus it looks ugly.

      Most scripting languages don't make any effort at all to avoid "polluting" shell conventions... Unless you're dealing with a language where the syntax really is mergeable with shell syntax (harder than it might sound - believe me, I've tried.) I don't think there's much point in worrying about that.

      But regardless - pipe character is already bitwise OR, I believe.

      4) "~" - Any reasons this wouldn't work?

      Bitwise negation operator. Otherwise, I'm not sure...

      5) "." - Again, awesome. Many other languages use this.

      String concatenation operator in PHP.

      8) "," - Why not? Does any language use the comma for anything? Might be kinda ugly though "$var = My,Class($arg1);"

      Technically, in C it's a command sequencing operator (For instance, "for (x=0, y=0; x parseably unambiguous but that doesn't necessarily mean they're not confusing...)

      --
      Bow-ties are cool.
    12. Re:so what's the problem here? by Tetsujin · · Score: 1

      how about @? I don't know any language other than cyclone using @ character for anything.

      My biggest problem with that:

      "some_module@x" reads "some module at x"...

      When in fact, it's "x" at "some module"... Basically, the operator represents the same thing as scope resolution, but the order of the arguments is backwards relative to how it'd usually be handled in programming languages...

      Something along the lines of the Japanese particle "no" would be great... :D

      --
      Bow-ties are cool.
    13. Re:so what's the problem here? by doom · · Score: 1

      The first person to put "ESC" on the keyboard royally messed up terminal encodings for ever after.

      Have you ever used a keyboard without an ESC key? The old DEC rainbows at Stanford all had "ESC" scribbled in black marking pen over the F11 keys.

  21. And Python is better? by Anonymous Coward · · Score: 0, Troll

    OK, yes Python is better than PHP but they're both a pain in the ass for the web/text based world of web development. I mean really, both PHP and Python are not that much easier to use than just writing a program in C/C++. Things like regular expressions are stupidly annoying to use (compare to Perl or Lua+LPeg). I don't even get the point of Python because it's a slow scripting language with almost all the verbose complexity of a compiled language. Just weird.

    Unfortunately there aren't a lot of options. Perl isn't all that great because while it's awesome at the usability and text processing part it's not so good from a structured design point of view. It's difficult to design complicated software in Perl. Plus Perl is basically dead since they decided to start that idiotic Perl 6 project that will never be finished (and even if it is I'm sure it will suck).

    My personal choice would be something like Lua with LPeg and a nice large supporting library. I know the Kepler project does work in this space but their stuff isn't anywhere near as nice as what is available in PHP and Perl API's. Their designs are just odd because they approach things from a Lua point of view instead of a web developer point of view.

    1. Re:And Python is better? by eric2hill · · Score: 1

      You could write your web application in C++ but I'm not sure if anyone other than you would be able to understand it in 5 years... :)

      --
      LOAD "SIG",8,1
      LOADING...
      READY.
      RUN
    2. Re:And Python is better? by Chandon+Seldon · · Score: 1

      Unfortunately there aren't a lot of options. Perl isn't all that great because while it's awesome at the usability and text processing part it's not so good from a structured design point of view. It's difficult to design complicated software in Perl. Plus Perl is basically dead since they decided to start that idiotic Perl 6 project that will never be finished (and even if it is I'm sure it will suck).

      Can you *please* stop spreading this anti-Perl FUD?

      Perl5 is neither the unmaintainable mess that Perl4 was, nor is it "dead" because Perl6 is being worked on. Considering the important things about a HLL (maturity, library quantity and quality, expressiveness), Perl5 continues to be one of best options out there.

      --
      -- The act of censorship is always worse than whatever is being censored. Always.
    3. Re:And Python is better? by epine · · Score: 1

      Perl suffers from first mover syndrome. It was drawing upon many established Unix conventions, most of which were unreasonably parsimonious with syntax, though one's definition of "unreasonable" changes in a big hurry coding over a 2400bps dial-up terminal.

      PHP's approach was to hit the sweet spot on inception, deal with the short-sightedness later. They managed to bind the design variable "now" to web coding practices circa 1997. I don't think the exorcist exists who can expel that legacy.

      I don't actually mind PHP all that much when I'm slumming, and let's not forgot a scalable application or two has been successfully coded in the language, e.g. MediaWiki, which does not have the reputation of being a cesspool of security oversights.

      Late 1996, Internet Explorer ships with VBScript enabled. Standards of sanity were pretty subjective for a couple of years as the internet entered the wormhole. At that point in time, PHP would have received a AAA credit rating, no questions asked.

      It's not clear to me that if PHP sucks because is was designed too quickly, that Perl6 will also suck because it is being designed too slowly. I missed a step there in the inference chain. Larry Wall has lived through the language fads since Kieth Richards starred in 22 grams.

      Lest we forget, the same meme of "after so long, it will suck anyway" was widely applied to Postgres and Firefox and to a certain degree, Debian Sarge.

      I'm actually kind of interested to see how a language designed by a war vet turns out.

      Meanwhile, I thought I would learn some Lua, but then it turns out that Lua requires a heap, which I can't justify and don't wish to incorporate into my embedded project design.

    4. Re:And Python is better? by Phroggy · · Score: 1

      It's difficult to design complicated software in Perl.

      Hogwash. You just have to self-impose some rules, since Perl doesn't impose them for you.

      Plus Perl is basically dead since they decided to start that idiotic Perl 6 project that will never be finished (and even if it is I'm sure it will suck).

      Go ahead and ignore Perl 6 for now; I am. Perl 5 is still being actively developed; they're not making major announcements like "OMG we've invented namespaces!" because Perl 5 is already a perfectly adequate language. Perl isn't a hot new buzzword, but that doesn't mean it's dead.

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    5. Re:And Python is better? by speedtux · · Score: 1

      Things like regular expressions are stupidly annoying to use (compare to Perl or Lua+LPeg).

      Huh? Perl uses regular expressions extensively, and many other languages have adopted Perl's regular expressions.

      I'm sorry you don't "get" regular expressions, but they are probably the biggest success story of text processing ever: powerful, concise, efficient, and theoretically well understood. They are also a fundamental part of computer science.

    6. Re:And Python is better? by jspenguin1 · · Score: 1

      but then it turns out that Lua requires a heap, which I can't justify and don't wish to incorporate into my embedded project design.

      You want a high level language that doesn't use a heap? That's going to be a little hard to come by. I've used Lua, and I have to say it's very memory efficient. The newest version even has an incremental garbage collector so you don't get long pauses while it runs. Sure, it uses more memory than C or assembler, but it's totally worth the extra memory. You can even strip out the compiler and just leave the bytecode interpreter.

    7. Re:And Python is better? by hotfireball · · Score: 1

      Dude, who is using regular expressions these days? "Oh, we have a problem and we can use regexp to fix it!" â" well, now they do have two problems. I do not have any problems with text processing and especially web, using Python. If you use XML, then probably Python or Ruby or Groovy are the only best choices among scripting languages.

      Perl?.. Hahahaha!..

    8. Re:And Python is better? by chromatic · · Score: 1

      If you use XML, then probably Python or Ruby or Groovy are the only best choices among scripting languages.

      Unless your XML contains Unicode....

    9. Re:And Python is better? by hotfireball · · Score: 1

      Unless your XML contains Unicode....

      All XML is in unicode. What's wrong with Unicode anyways? It works for years to everybody.

    10. Re:And Python is better? by chromatic · · Score: 1

      Variable-width encodings are what's wrong with Unicode, but I meant that current stable versions of Ruby do not handle Unicode well, and I believe that Unicode handling in Python 2.x is suboptimal. (I haven't used Unicode in Python 2.x, and I understand that Python 3 is much better in that regard.)

    11. Re:And Python is better? by hotfireball · · Score: 1

      Ruby's Unicode (and not only this) sucks, yes. Well, to be honest, I said about Ruby more like to be nice to Ruby community. :-) But in fact, there are no problems handling Unicode in Python at all. I am doing it like 7+ years so far. Syntax could be better though, but it works rock stable and reliable. Besides, I am Unicode-freak and believe that other encodings must disappear (not yet for SHIFT-JIS though, because Japanese gov is too slow in this), but still I think I know what I am talking about. :-)

    12. Re:And Python is better? by doom · · Score: 1

      Can you *please* stop spreading this anti-Perl FUD?

      No, they probably can't. Mindless recitation is how they prove their intelligence.

      Perl5 is neither the unmaintainable mess that Perl4 was, nor is it "dead" because Perl6 is being worked on.

      If anyone here happens to like obnoxious jokes, try: "Perl6 is a scheme for turning Perl5 into a sane language by keeping Larry and Damien busy with something else."

      Anyway, yeah, the perl 5.10 release had some interesting new features, and CPAN activity is running higher than it was during perl's supposed hey day. Perl's death has been greatly exaggerated.

  22. Phalanger by shutdown+-p+now · · Score: 1

    It's interesting to see what the Phalanger guys are going to do now. They've already been using ":::" as a namespace separator for their .NET/CLR language extensions, as the next most logical choice. And now this.

    On the whole, though, this is probably just as bad as using "." for string concatenation (it was sort of okay for Perl because back then it wasn't yet used ubiquitously as a member access operator, but for PHP, it was a dumb choice). Backslash has a near-universal meaning as an escape character for several large language families now (all curly-braces family languages - C/C++/Java/C#/EcmaScript, and almost all modern popular scripting languages - Python, Ruby, Lua...). It's even used as the same in PHP, given that it is also a curly-braces language. Reusing it outside string literals in an entirely different capacity is not a good idea (especially when other languages of the family have already applied different meaning to backslash outside string literals - in C# and Java it's used to escape Unicode characters in identifiers).

    1. Re:Phalanger by mysidia · · Score: 1

      C# and Java it's used to escape Unicode characters in identifiers

      Ok.. I was wrong there IS something worse than using the ESCAPE character to delineate namespaces.

      Allowing unicode characters in identifiers is SICK and not to be encouraged by any programming language or any compiler for any reason, as the issues are even more widespread than with this PHP issue.

      The need to ever escape the unicode character in identifier name should be ample evidence to that effect.

    2. Re:Phalanger by msuarezalvarez · · Score: 1

      Allowing unicode characters in identifiers is SICK and not to be encouraged by any programming language or any compiler for any reason, as the issues are even more widespread than with this PHP issue.

      How anglocentric of you... One can easily see from your post that you never need anything outside of ASCII to properly spell any word you would sensibly use as a variable name; that puts you in a very small minority.

      Seriously: what issues are you referring to?

    3. Re:Phalanger by shutdown+-p+now · · Score: 2, Insightful

      Allowing unicode characters in identifiers is SICK and not to be encouraged by any programming language or any compiler for any reason, as the issues are even more widespread than with this PHP issue.

      Why, exactly? English is not the only language spoken in the world, you know, and programmers in many countries feel more at ease naming identifiers using their native language rather than trying to come up with an English translation with their limited knowledge of English. In fact, when people who don't know English well are forced to use English names in identifies, the mistranslations that result can often be very confusing - take it from someone who has to deal with such code daily. And most languages in the world require at least a few letters not in ASCII.

      By the way, have you seen Fortress programming language? You know, the one that not only allows Unicode, but uses its fully in the core library, including all standard mathematical operators (with their normal meaning). It is surprisingly readable.

      Unicode is used throughout for several years now. Programming languages are pretty much the only place where ASCII still holds, but ever since Java, this has been relaxing more and more - and rightly so. Look back 30 years - do you remember all that code written in all-uppercase because many computers of that time simply didn't have lowercase letters? And it's all gone now, because there's no longer any need to account for such machines - they don't exist anymore. Restrictions on plain ASCII only are heading the same way, and for the same reasons. All editors support Unicode now, so it is used already, and it will be used more and more.

  23. Easier on which keyboard layout? by Anonymous Coward · · Score: 5, Insightful

    How is it possible for even American developers to be this clueless. Which characters are convenient to type depends entirely on the keyboard layout that is used. Case in point, $ is insanely painful to type on Scandinavian layout.

    If your choice of characters used in your programming language is affected by how easy/hard it is to parse the code, you probably shouldn't be involved in developing a programming language.

    1. Re:Easier on which keyboard layout? by jez9999 · · Score: 0

      If you program in PHP, you probably shouldn't be programming. :-)

    2. Re:Easier on which keyboard layout? by MartinSchou · · Score: 1

      Why is $ more difficult than say ... {}, [] and ~? \ is the same. Piping several times is the same kind of pain as | is an [Alt Gr] modified key. As is @.

      Seriously - why is one [Alt Gr] modified key worse than any of the others?

    3. Re:Easier on which keyboard layout? by Nik13 · · Score: 1

      As much as I think \ was a stupid choice, I don't think the keyboard layouts are the real issue here.

      In fact, I think many keyboard layouts themselves are to blame when it comes to programming. Or at least they're due for an upgrade of sorts, as they are a relic from the typewriter era and not meant for programming specifically (and plain suck at it)

      Case in point: the canadian french keyboard layout. Every useful symbol you might use several times per line i.e. <>{}/\'"@ and such, are *all* moved to strange locations to make place for accents. For example, /\| are all moved to where the tilde is supposed to be -- to the left of the "1" key. Don't ask me where the tilde went either! Many common chars require you to use "alt char" too (@ is alt char+2). It's like 3x as much effort writing code with that wretched keyboard layout... It even makes everyday computing tasks suck. I see people who only used that keyboard layout their whole life still struggle with it on a daily basis...

      It's sadly less work to write the whole thing with a plain old en-us keyboard layout, then go over it again, and put in accents where you need them if you're localizing some stuff.

      So if we start avoiding to use characters that might be a pain to type on certain keyboard layouts, then we'd pretty much rule out every single character out there unfortunately.

      --
      ///<sig />
    4. Re:Easier on which keyboard layout? by EvilIdler · · Score: 1

      AltGr is on the right side only. Shift works the same on either side of the keyboard.

    5. Re:Easier on which keyboard layout? by Anonymous Coward · · Score: 1, Funny

      Never mind. I won't call you.

    6. Re:Easier on which keyboard layout? by Tom · · Score: 2, Interesting

      I couldn't agree more. When I read this my only thought was "what the fuck?". On a German Mac keyboard, \ is Alt+Shift+7. I think on Linux and Windos it's something equally retarded.

      Will the people who made PHP a good programming language please fork it and take it away from the clueless morons who have taken over?

      --
      Assorted stuff I do sometimes: Lemuria.org
    7. Re:Easier on which keyboard layout? by TeknoHog · · Score: 1

      I'm Finnish, and I use a UK keyboard layout. I'm not much of a programmer, but simply using a unix command line is easier without the AltGr combinations. For typing Finnish text I obviously switch the layout.

      --
      Escher was the first MC and Giger invented the HR department.
    8. Re:Easier on which keyboard layout? by Tom · · Score: 4, Insightful

      This line from the IRC discussion says it all:

      [16:24:51] bjori: switch to US layout ;)

      --
      Assorted stuff I do sometimes: Lemuria.org
    9. Re:Easier on which keyboard layout? by Anonymous Coward · · Score: 0

      Since Scandinavian developers are so brilliant, they can stop using our clueless languages and start their own.

      If Americans are so painful to work with, don't work with us. We won't miss you.

    10. Re:Easier on which keyboard layout? by Phroggy · · Score: 1

      Will the people who made PHP a good programming language please fork it and take it away from the clueless morons who have taken over?

      As a Perl programmer, I have to laugh at your suggestion that somebody ever made PHP a good programming language. Read this and this.

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    11. Re:Easier on which keyboard layout? by Vexorian · · Score: 1

      You probably don't code in ANY language? The first thing I learned in programming was how to type \ in a spanish keyboard [Alt gr]+[Â], ok not the first one, the first one was [] the second was {}...

      --

      Copyright infringement is "piracy" in the same way DRM is "consumer rape"
    12. Re:Easier on which keyboard layout? by Anonymous Coward · · Score: 1, Informative

      But we did start our own language, PHP was created by Danish-Greenlandic programmer, so I'd say it is very Scandinavian.

    13. Re:Easier on which keyboard layout? by rbanffy · · Score: 1

      On the other hand, Scandinavian programmers will probably learn other better languages. See? There is always a bright side.

    14. Re:Easier on which keyboard layout? by iron-kurton · · Score: 1

      Obviously, the only solution is to use letters as separators. I vote for uppercase A, since it's a completely useless character, AND everyone has it on their keyboards

      --
      Change is inevitable, except from a vending machine -- Robert C. Gallagher
    15. Re:Easier on which keyboard layout? by Tom · · Score: 1

      Actually, I laugh at people who wage wars over programming languages. ;-)

      PHP is good for what it was designed for. If you disagree, just don't use it. Fine with me. :-)

      --
      Assorted stuff I do sometimes: Lemuria.org
    16. Re:Easier on which keyboard layout? by Just+Some+Guy · · Score: 1

      In all fairness, otherbird was being sarcastic to highlight the attitude of others. He then goes on to tell others why this isn't a good idea:

      [16:24:51] <@otherbird> bjori: switch to US layout ;)
      [16:24:57] <@johannes_> I like ::: more than \ if it's only about bikeshed color ...
      [16:25:20] <@otherbird> johannes_: if ~20% of users can't use it, we can't have it
      [16:25:26] <@otherbird> simple as
      [16:25:48] <@otherbird> Derick: we heard from 3 nationalities on-list that had problems with it

      --
      Dewey, what part of this looks like authorities should be involved?
    17. Re:Easier on which keyboard layout? by Anonymous Coward · · Score: 0

      >How is it possible for even American developers to be this clueless
      we're not. we just don't give a FF

    18. Re:Easier on which keyboard layout? by Tetsujin · · Score: 1

      Actually, I laugh at people who wage wars over programming languages. ;-)

      PHP is good for what it was designed for. If you disagree, just don't use it. Fine with me. :-)

      Bah! Pansy... You just have no passion for programming!

      --
      Bow-ties are cool.
    19. Re:Easier on which keyboard layout? by MartinSchou · · Score: 1

      Then use [Ctrl]+[Alt]+[key] - that's the same thing. But seriously, I've never had a problem with those keys, and I'm programming daily.

  24. All languages by symbolset · · Score: 1

    ... are just another language. They all do the same stuff and 95% of what you want to do happens in the library anyway, so the language is just a framework for iterating your library calls or instantiating your objects if you prefer. They all have corners of stupidity you have to work around - some more than others, but what does it matter really?

    --
    Help stamp out iliturcy.
    1. Re:All languages by Just+Some+Guy · · Score: 1

      They all have corners of stupidity you have to work around - some more than others, but what does it matter really?

      Write the equivalent of a list comprehension or generator function in COBOL, then get back to us.

      --
      Dewey, what part of this looks like authorities should be involved?
  25. Re:HOLY FUCKING SHIT!?!?! by coryking · · Score: 4, Informative

    Except you just made a typo. It is "\" instead.

    Either way, most languages use either "." or "::" for namespaces

    # perl looks like
    use My::CPAN::Module qw();
    my $instance = My::CPAN::Module->new("junk");

    # c# looks like
    using System.Windows.Controls;

    System.Windows.Controls.ListBox box = new System.Windows.Controls.ListBox();

    # c++ looks like (I think)
    namespace Blah::Blah;

    # php will now look like
    $object_instance = new My\PEAR\Module("myvar");

    I'll leave the "looks" of PHP's method to the reader.

  26. Classes, namespaces, and subnamespaces by janwedekind · · Score: 4, Informative

    Looking at the IRC discussion it seems that they didn't have much of a choice.

    1. Re:Classes, namespaces, and subnamespaces by shutdown+-p+now · · Score: 1

      Not really. I fail to see how the problems they faced were any different from those facing C++ - which has been happily using "::" for both classes and namespaces (and aptly called it "scope resolution operator" - because that's what it really is, in C++).

    2. Re:Classes, namespaces, and subnamespaces by Toonol · · Score: 1

      Forget "\", they should have used "-==-"

      I don't think that is a reserved sequence of characters. It would have made the source code more interesting.

    3. Re:Classes, namespaces, and subnamespaces by iluvcapra · · Score: 1

      If you're doing that, you might as well make it ^_^ or :)

      --
      Don't blame me, I voted for Baltar.
    4. Re:Classes, namespaces, and subnamespaces by ccoder · · Score: 1

      All I can say .... is wow!  Thanks for the link to the discussion.  I might just look for another language with a sharp direction change from its previous roots.

      Just because a few people think its cool on IRC doesn't make it so.

      --
      "During times of universal deceit, telling the truth becomes a revolutionary act" -- George Orwell
    5. Re:Classes, namespaces, and subnamespaces by janwedekind · · Score: 1
      Incidentally I also was wondering what the situation is in other languages. I am using Ruby and C++. In Ruby this is not an issue since namespaces and classes are capitalized. The IRC discussion references a Wiki entry with an example highlighting the problem. I've translated the example to C++:

      #include <iostream>

      using namespace std;
      namespace foo {
      void bar(void) { cout << "func" << endl; }
      };

      class foo {
      public:
      static void bar(void) { cout << "method" << endl; }
      };

      int main(void)
      {
      foo::bar();
      return 0;
      }

      Trying to compile the example with g++ gives a strange result. While the class-definition successfully hides the namespace, the two method definitions seem to clash at the linking stage.

      /tmp/ccXa637g.s: Assembler messages:
      /tmp/ccXa637g.s:181: Error: symbol `_ZN3foo3barEv' is already defined

      Myself I would try a lot of other things before using a backslash as separator though. The syntax is out of the ordinary (compared to other languages) and it's likely that it'll cause problems elsewhere.

    6. Re:Classes, namespaces, and subnamespaces by shutdown+-p+now · · Score: 1

      It's surprising that g++ even compiled it, since you can't use the same identifier for two different things in the same scope - which includes both classes and namespaces, among other things. Allowing for duplicate identifiers in the scope is always asking for trouble unless they are by lexical convention in two different non-intersecting sets anyway (such as the case with Ruby capitalization).

    7. Re:Classes, namespaces, and subnamespaces by 1110110001 · · Score: 1

      $x--==-1; // valid PHP

  27. Re:Gripe Moan Bitch and Holler! by SUB7IME · · Score: 3, Insightful

    Scripting languages are for those of a weak mind and poor technical skills and the singular lack of the ability to plan a system out before you write one line of code.

    Or for projects that need to be compiled at runtime. But, nice magnanimity.

  28. Re:Gripe Moan Bitch and Holler! by aftk2 · · Score: 1

    Ahaha...this comment cracked me up. You must not do any client work, huh.

    --
    concrete5: a cms made for marketing, but strong enough for geeks.
  29. .NET / WPF is going this way by coryking · · Score: 2, Interesting

    At least in a sense. You can map a .NET namespace to an XML namespace. Say you have namespace that is:

    Shados.Awesome.Controls

    You can map that into:

    http://www.shados.com/controls

    In c# you'd plunk this into your AssemblyInfo.cs file:
    [XmlnsDefinition("Shadows.Awesome.Controls","http://www.shados.com/controls")]
    And thus add it to your XAML code:


    <UserControl xmlns="http://www.microsoft.com/xml/something"
    xmlns:shadow="http://www.shados.com/controls">
    <shadow:AwesomeControl x:Name="myControl" param="aParam" />
    </UserControl>

    You can even get multiple .NET namespaces to map into a single XML namespace.

  30. Re:Gripe Moan Bitch and Holler! by Anonymous Coward · · Score: 0

    Sure, why not, right? Let's reinvent the wheel EVERY FUCKING TIME we write the specs for a language. We don't want anyone getting comfortable now. Shit, let's make sure we use EBCDIC encoding for PHP7, too -- hey, don't complain, it's a scripting language! That's the deal!

    You are a narrow-minded BUFFOON, sir.

  31. Re:HOLY FUCKING SHIT!?!?! by mweather · · Score: 1, Funny

    Yeah, you don't need insight to know the developers were high as a kite.

  32. Other suggestions by lepidosteus · · Score: 3, Interesting

    For additionnal fun, read this: http://wiki.php.net/rfc/namespaceseparator

    Looks like they considered stuff like :> and :) as separators for namespace. Seriously.
    Also, they don't give any malus for tybe-ability to \ while on most european keyboards it's a lot harder than any other suggested separator. Way to go !

    1. Re:Other suggestions by mAriuZ · · Score: 1

      maybe they should use /. as namespace separator

      --
      developer http://flamerobin.org
  33. Well... by Tablizer · · Score: 1

    You know what they say:

    If you don't like it, you can go fork yourself.
           

    1. Re:Well... by VoltageX · · Score: 1

      It's probably about time to fork PHP.

      --
      "Anonymous could not immediately be reached for further comment." - International Business Times
  34. Re:Gripe Moan Bitch and Holler! by siride · · Score: 0, Flamebait

    Let me know when C has closures and introspection. Sure, you can do it, but the result is so ugly and messy it severely obscures the meaning of the code. That, my friend, is the problem with C. Unless you really really need that last ounce of performance, or you are writing systems software, C is almost never a good choice.

  35. \ vs / by fahrbot-bot · · Score: 1
    From the TFA:

    \ looks a lot like / and is easy to accidentally flip, especially for unix users

    Um, that should be "especially for DOS / Windows users". Unix was here first dumb asses

    Furthermore, using the character, that just about every other programming language uses for the escape character, as an operator (or separator) is just plain stupid -- I'm also talking to you Microsoft, but that horse has definitely left the barn...

    --
    It must have been something you assimilated. . . .
  36. What about Eval? by coryking · · Score: 3, Funny

    Now do you have to escape your namespaces before passing them through eval?

    eval("$instance = new My\\Super\\Class(\"blah\"););

    Since they now are using the escape character for namespaces, I wonder what kinds of security implications this might have? What happens when a PHP program for some reason evals() some user input that doesn't properly escape the namespaces?

    1. Re:What about Eval? by moderatorrater · · Score: 1

      They get a server that's now a spambot, just like any other program that evals user input?

    2. Re:What about Eval? by prockcore · · Score: 2, Insightful

      You'd have to do that anyway, because you used double quotes, "$instance" is going to get evaluated and your eval will fail anyway.

    3. Re:What about Eval? by Just+Some+Guy · · Score: 1

      What happens when a PHP program for some reason evals() some user input that doesn't properly escape the namespaces?

      An experienced programmer cries.

      --
      Dewey, what part of this looks like authorities should be involved?
    4. Re:What about Eval? by Gavagai80 · · Score: 1

      You have to escape the $ as well, and include a closing quote. But as Rasmus says, "If eval() is the answer, you're almost certainly asking the wrong question."

      --
      This space intentionally left blank
  37. The real question is by Anonymous Coward · · Score: 0

    The real question is: will they admit their mistake and correct it before it destroys the community?

    The linked blog showing the example: spl_autoload_register(array("Foo\tBar", "loader")); highlights the fact that this is an epic blunder that will fracture the community.

    The language designers who spent only "hours" debating the solution need to swallow their pride and admit they made a mistake. Then they should take public comments on how to solve the problem, and put it to a popular vote among the user community.

  38. Re:Gripe Moan Bitch and Holler! by maxume · · Score: 1

    I took it as an extremely well crafted troll.

    --
    Nerd rage is the funniest rage.
  39. yuck by ColoBikerDude · · Score: 1

    Stupid choice. I guess I will just endeavor to avoid namespaces altogether.

    Does this mean that writing "eval" statements in regular expressions would have to be triple-escaped then?

    preg_replace("/oldtext/e", "ns\\\pick_new_text()");

    That makes my head hurt.

    1. Re:yuck by coryking · · Score: 1

      Yikes. What about IDE's that let you search your code using regular expressions? The ones I've used all support using escape codes as part of the package.

      So now if I want to search my code for all references to a particular namespace, I might have to escape the damn namespace characters! /my\\namespace\\is\\cool/

      Do a search and replace: /my\\namespace\\is\\cool/\\my\\namespace\\sucks/g

      What if I do a search/replace and forget to escape a namespace that starts with \n: /my\\namespace\\is\\cool/\\my\namespace\\sucks/g

      Oops!!

    2. Re:yuck by prockcore · · Score: 1

      So use preg_replace_callback.

      Why would it need to be triple-escaped anyway? The replacement parameter isn't parsed as a regex.

  40. WTF with PHP is dumb by Anonymous Coward · · Score: 0

    This is terrible or it is a joke?, I knew PHP is just an ugly hack and not a language. PHP desperately need a good language designer or better PHP people go with Perl or Python.

  41. PHP sucks, but it has a very important niche by laddiebuck · · Score: 1

    There is no language in which it is faster to prototype small algorithmically intricate scripts (for straightfoward stuff, I use the shell). This used to be a great boon (and amusement) in college, where the homework assignment that people slaved on for a day or two in Java or C++ or C would take me less than 2 hours to do (typically right before the deadline too).

    Merely due to its built-in hashtable and the wide variety of functions to manipulate it, it is quick, natural and painless to churn out algorithms in PHP.

    Oh yes, for other things, it sucks. For big projects, I like C or python.

    1. Re:PHP sucks, but it has a very important niche by LighterShadeOfBlack · · Score: 1

      Just curious, but why do you use PHP over Python for those tasks? I'm not trying to start a language war here but since you clearly know and use Python I find it surprising you would choose PHP over it. Python also has good hashtable and list support and, unlike PHP, doesn't confound the two.

      Perhaps the strongest advantage I've found Python has over PHP in this particular niche however is it's interactive mode - PHP's is still totally hamfisted (despite recent improvement) and drops you out at the slightest error.

      Like I said, I don't want to turn this into a holy war. It just struck me as an unusual conclusion to reach from someone who uses both langauges.

      --
      Spelling mistakes, grammatical errors, and stupid comments are intentional.
    2. Re:PHP sucks, but it has a very important niche by Shados · · Score: 1

      Is there any modern language that -doesn't- have a built-in hashtable and functions to manipulate them?

    3. Re:PHP sucks, but it has a very important niche by msuarezalvarez · · Score: 2, Informative

      Give Haskell (or ML, Scheme, Lisp and friends) a try: using PHP to prototype algorithmically intrincate stuff is simply absurd.

    4. Re:PHP sucks, but it has a very important niche by Jesus_666 · · Score: 1

      True. You could call PHP the best bad language - while it's ugly and inconsistent it's also the best tool for quick and dirty scripts that doesn't require several years of dedicated study to use effectively.

      Virtually any complex datatype can be implemented with a hierarchy of arrays (read: hashtables) and doing so requires no effort whatsoever. That's immensely useful when you quickly need to do something with complex data but don't want to spend any time working out a class tree to represent it. You just happily throw stuff into nested arrays and immediately have everything just as you need it.

      Of course that approach is not suitable for larger projects, but for quick one-off scripts or simple text-format-to-text-format compilers it's very useful.


      If someone forked PHP and reworked it to reduce the ugliness while retaining its advantages like the extremely flexible arrays we could end up with a rapid prototyping language with a deservedly good reputation. And, probably, a glacially slow runtime.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    5. Re:PHP sucks, but it has a very important niche by Jesus_666 · · Score: 1
      None that makes it as easy as PHP. In PHP, arrays and hashtables are identical and writing to nonexistant fields just means that field is created. That enables you to quickly construct complex data structures without much code. (In fact, the only thing recogizable as a function call is used to create new arrays.)

      Example:

      $foo = array(1, 2, 3);
      $foo['spaceBear'] = array('foo' => 'yesterday', 'bar' => -439);
      $foo['spaceBear']['tenderloin'] = $foo;
      print_r($foo);

      prints:

      Array
      (
      [0] => 1
      [1] => 2
      [2] => 3
      [spaceBear] => Array
      (
      [foo] => yesterday
      [bar] => -439
      [tenderloin] => Array
      *RECURSION*
      )

      )

      Of course classes would be cleaner but PHP-style arrays are very coding-time efficient. This trade-off might very well be worth it if you only write a quick script that won't be used in a real product and thus doesn't justify spending much time on it.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    6. Re:PHP sucks, but it has a very important niche by Shados · · Score: 1

      arrays and hashtables are identical and writing to nonexistant fields just means that field is created

      You mean, like in every dynamically typed language out there?

    7. Re:PHP sucks, but it has a very important niche by mvdwege · · Score: 1

      In PHP, arrays and hashtables are identical and writing to nonexistant fields just means that field is created.

      The nineties called, they want their Perl back.

      Mart

      --
      "I know I will be modded down for this": where's the option '-1, Asking for it'?
    8. Re:PHP sucks, but it has a very important niche by iluvcapra · · Score: 1

      You actually bring up one of the reasons I stopped using php. One day I was trying to put elements onto an array by assigning items to a particular subscript, and then pop them off as like a queue, but it never seemed to get the right order. Then I recognized that when I was doing $arr[$i] = $item, at some point $i was changing from (integer) a string of "(integer)", and so I was making a hastable of strings -> items instead of an ordered list.

      I picked up Ruby and it was a revelation -- these people actually use a different object for dictionaries and arrays! And of course you can insert/remove items without using anything resembling a function syntax.

      --
      Don't blame me, I voted for Baltar.
    9. Re:PHP sucks, but it has a very important niche by laddiebuck · · Score: 1

      I have used ML. ML is nice when you want to create beautiful, elegant, compact, thoughtful code. Code that you are proud of writing, code that takes a mental effort to understand again later, and code that is almost always right the first time once it passes the damn compiler.

      As such, it also takes about twenty times longer to write than the PHP equivalent.

      There's a reason I wrote quick and dirty. Jesus_666 in this thread seems to be of the same mind as I am, if you want more perspective. PHP is, due to its peculiar syntax and particular functions, better suited to (often inelegant) rapid prototyping than other languages I know.

    10. Re:PHP sucks, but it has a very important niche by msuarezalvarez · · Score: 1

      I have used ML. ML is nice when you want to create beautiful, elegant, compact, thoughtful code. Code that you are proud of writing, code that takes a mental effort to understand again later, and code that is almost always right the first time once it passes the damn compiler.

      If it is taking you a great mental effort to understand the code later, you should probably be writing better code...

      As such, it also takes about twenty times longer to write than the PHP equivalent.

      Maybe your training in ML is not that good. Which is not that unusual, since most people are not trained in functional programming, let alone---say---in dealing with an expressive type system.

      There's a reason I wrote quick and dirty. Jesus_666 in this thread seems to be of the same mind as I am, if you want more perspective. PHP is, due to its peculiar syntax and particular functions, better suited to (often inelegant) rapid prototyping than other languages I know.

      I was responding to someone who uses PHP to prototype algorithmically intrincate stuff. I honestly doubt you can do that in a "quick and dirty" way.

    11. Re:PHP sucks, but it has a very important niche by Jesus_666 · · Score: 1

      I know, Ruby contains enough sugar to ruin your teeth, but it requires more time getting used to than PHP. As far as the more basic things are concerned, PHP is a rather unsurprising language - and php.net makes for an extremely useful (perhaps even unparalleled in a cost-free environment) reference.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    12. Re:PHP sucks, but it has a very important niche by Jesus_666 · · Score: 1

      They can have. Most of PHP's target demographic doesn't want to spend the time to learn Perl.

      PHP is to scripting languages what pre-.NET Visual Basic was to GUIs: Easy to write messy code in but also very easy to pick up and fast to work with even without special skills. Also, php.net serves as an excellent reference for when you just want to get things done with the minimal amount of research neccessary. Not even the inconsistencies PHP is notorious for can balance that out.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    13. Re:PHP sucks, but it has a very important niche by iluvcapra · · Score: 1

      PHP is "unsurprising" in the sense that it's obsequious; it smiles and agrees when in fact it doesn't understand what you mean. I know it's great when you need to write the drupal plugin (god help you), but I'd never elect to use it over Ruby; it just does too much DWIM.

      --
      Don't blame me, I voted for Baltar.
    14. Re:PHP sucks, but it has a very important niche by alien_life_form · · Score: 2, Funny

      In fact, not to start a language war, I think his language of choice should be Perl.

      Cheers,
      alf

    15. Re:PHP sucks, but it has a very important niche by alien_life_form · · Score: 1

      You mean like Java, C#, C and C++? Unless they all go by the "ancient" tag by now, or you are using non standard definitions of "language" or of "built in".

      Cheers,
      alf

    16. Re:PHP sucks, but it has a very important niche by Shados · · Score: 1

      Java and .NET most definately have hashtables built in. My definition of "built in" means "can be used with the default libraries". And it is there, along with most data structures you'll ever need.

    17. Re:PHP sucks, but it has a very important niche by alien_life_form · · Score: 1

      [...] My definition of "built in" means "can be used with the default libraries".[...]

      Your definition seems overly large to me. By this token, database access becomes a "built in" also, as does networking, XML parsing... you name it.

      What about "hash tables as native data types"?

    18. Re:PHP sucks, but it has a very important niche by Anonymous Coward · · Score: 0

      Would use Python, but I still don't like that white-space stuff what is going on in Python. And this for many years. But I'm still waiting for Ruby to get a decent compiler/JIT or whatever...

    19. Re:PHP sucks, but it has a very important niche by laddiebuck · · Score: 1

      I didn't say it would take me a great mental effort. Merely that it would. Few enough tasks require our mental effort these days that it's worth noting if one does. I don't shy from mental effort in my field either (mathematics).

      My training in ML has little to do with it. It is fine; I like and admire the elegance of the concepts, it is easy to use them. It simply takes a very little discipline and thought to write ML code. It takes no thought at all to write PHP code, which is why it is faster to use it (not to mention weak typing). You don't have to think for even a moment about data structures in PHP.

      Yes, the person you would have been replying to was me, the OP. I don't care that you doubt it, I just care that you think it impossible or impractical, which might mislead others who know nothing about the issue.

    20. Re:PHP sucks, but it has a very important niche by msuarezalvarez · · Score: 1

      I know it is not impossible or impractical. You can write arbitrarily complex code in assembler or actual machine code. I wrote a compiler from (a subset of) Pascal to the language used by dc (see the manpage for dc if you do not know what I am talking about) years ago, which is a Turing complete language...

      My point is, it is not desirable to code in PHP.

    21. Re:PHP sucks, but it has a very important niche by laddiebuck · · Score: 1

      My point is, it is not desirable to code in PHP.

      Speak for yourself. This is simply a preference. A lot of people might find it very convenient to use PHP; although hopefully they realise how very limited and ugly the language is. I don't care that it's ugly when I blaze out quick code; and I have enough discipline in my coding habits that I don't care about many of its weaknesses.

      The dc language is often called reverse Polish, I forget why. I first read about it in the K&R C book.

    22. Re:PHP sucks, but it has a very important niche by msuarezalvarez · · Score: 1

      Reverse polish notation is simply postfix notation, as as such it is not a language---simply a notational convention---Wikipedia has some details. The dc language, which indeed uses a postfix notation, is a fully-fledged language, with control structures, explicit handling of external memory and (rudimentary) IO capabilities.

    23. Re:PHP sucks, but it has a very important niche by mvdwege · · Score: 1

      In other words: PHP is the language for complete morons that shouldn't be let anywhere near a keyboard, let alone be allowed to program.

      Sorry if this sounds harsh, but I ran into yet another piece-of-shit-typical-PHP-weenie code today[1], and my tolerance for this abortion of a 'programming language' and its moronic practitioners hit a low.

      [1] Using index.php on a heavily loaded server to implement virtual hosting; using mysql_escape_string to construct SQL queries from _POST variables. Guys like that should have their hands cut off at the wrist.

      Mart

      --
      "I know I will be modded down for this": where's the option '-1, Asking for it'?
    24. Re:PHP sucks, but it has a very important niche by Jesus_666 · · Score: 1

      The niche exists so something had to fill it. We ended up with PHP - imagine what would've happened if the morons' language of choice would've been Perl (probably with some kind of framework only 10% of people bother to configure correctly). As clueless people tend to abuse each and any mechanism a language has to offer we can be happy Perl didn't end up being everyone's darling.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
  42. Re:Gripe Moan Bitch and Holler! by Anonymous Coward · · Score: 0

    This is the typical bastard that thinks is a real programmer, let me tell you that there are more complex systems right now in scripting languages than in C. Get a life stupid.

  43. Re:Gripe Moan Bitch and Holler! by mdmkolbe · · Score: 1

    Anything you can do in ANY scripting language ... you can build faster, smaller and better programs in C.

    And anything you can build in C, I can more quickly build smaller, better and more reliable in Haskell. I guess by your logic the pansy type system of C/C++ is only for those of weak mind and poor technical skills.

    (*) I know C++ people like to think they have a strong type system. And relative to some languages it is, but compared to the full Hindley-Milner, System-F Glory of the Haskell type system C++ doesn't stand a chance. Of course even Haskell is weak compared to systems like Agda.

  44. secret by binaryseraph · · Score: 1

    surely slashdot had nothing to do with this ;) /.

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

      it's a conspiracy i tell you! :P

  45. Re:HOLY FUCKING SHIT!?!?! by Anonymous Coward · · Score: 1, Informative

    Umm C# would be.


    using System.Windows.Controls;

    ListBox box = new ListBox();

  46. Why here? by neiljt · · Score: 1

    Just take this to backslashdot.org pls. Thank you. Sheesh.

  47. Easy to fix this by sfjoe · · Score: 5, Funny

    Since PHP is open source, someone will make a fork with a different separator and the dumber of the two choices will wither away.

    --
    It's simple: I demand prosecution for torture.
    1. Re:Easy to fix this by FlyingGuy · · Score: 1

      Ohhh that would be fucking brilliant now wouldn't it.

      Lets have a little pissing ware over a single character and fork the the thing. This is gonna work REAL well, the dev's that build the software are all going to suddenly start contributing to your fork? Not bloddy likely since they are the ones who made this call.

      --
      Hey KID! Yeah you, get the fuck off my lawn!
    2. Re:Easy to fix this by thetoadwarrior · · Score: 1

      Actually there is no harm and it may result in an improvement in the "main" PHP. If it doesn't then those that want to use the alternative can.

      In my dream world PHP would start fresh and quite making lame_method_names() that are veryInconsistent() and just pick one damn format and stick with it.

      I'd also like to see -> replaced with . and . should be changed to + or &. Really, if they're gonna pick \ for ease of typing then why are we still using ->?

      I've enjoyed using PHP (more so in the past) but it's always looked unprofessional and feels like a chore to code more than the other languages I've dealt with because you either need an excellent IDE or the ultimate memory thanks to its absolute lack of consistency.

    3. Re:Easy to fix this by FlyingGuy · · Score: 1

      Most scripting languages look horrid IMO, but I don't even really like the look of C, it is far to easy to write unreadable code, and don't even get me started with C++ since I think operator overloading is the most asshat idea to come down the pike since Haskel. Complex code, even when well written is hard enough to decipher, much less code that looks like a SQL statement.

      But all that is really beside the point. If you look at the utility of PHP it is pretty damn good, you don;t have to be a rocket scientist to get something useful done and if the architects decide that using a a "/" is beter then using "::" or something like "->>" or some other such nonsense, then just go with it, it is really just not that big of a deal.

      There are lots of things I would like changed in lots of languages, but chances are that aint happening anytime soon unless I go out and invent my own scripting language. I could more then likely do a pretty damn good job of it, but the last thing the world needs is yet another scripting language.

      --
      Hey KID! Yeah you, get the fuck off my lawn!
    4. Re:Easy to fix this by shish · · Score: 1

      Parent was modded funny due to wishful thinking typo: "wither away" should have been "flourish"...

      --
      I mod down anyone who says "I will be modded down for this", regardless of the rest of their comment
    5. Re:Easy to fix this by Anonymous Coward · · Score: 0

      No, history shows the dumbest choice will win. Exhibits: MySQL, Windows, Linux (over FreeBSD), Qwerty.

    6. Re:Easy to fix this by mAriuZ · · Score: 1

      yes is true that i like to have strong opinions and yes i could be
      wrong in most of them
      but when all the comunity screems at the namespace issue i think
      core developers should be more diplomatic and offer the good solution not
      close the eyes and wash the hands and go forward

      an semisolution would be an php.ini variable
      like
      NAMSPACE_SEPARATOR="::"
      so if you have an issue with your classes can be reset to "\" or
      whatever with ini_set

      i think it's easy to be done if i look at the patch that created the
      backslash separator issue
      http://pear.php.net/~greg/backslash.sep.patch.txt

      --
      developer http://flamerobin.org
  48. Number of characters?! by Sentry21 · · Score: 1

    Oh yeah, because you know, I'd rather type one character than two to namespace when I'm using mysql_real_escape_string() and its ilk.

    A huge part of the reason I hated PHP coding (and why I've stopped) was because it's just a shit-ton to write. There's just a lot of typing that needs doing. I'm a fan of descriptive function names, but there_comes_a_point_where_its_too_fucking_much().

    Compared to languages like Ruby or Python, PHP requires you to type more to do less, worse. I've never met a developer who liked PHP over another language, and the only people I know who like PHP like it because it's all they know, or because they make money off its idiocies (like teaching long, complicated classes on how to write PHP).

    This is just another step towards PHP not being taken seriously... more.

    1. Re:Number of characters?! by 3247 · · Score: 1

      Just leave out mysql_real_escape_string, then. I mean, who's gonna enter strings where it would be needed anyway?'; DELETE FROM important_data_table;

      The same trick works for htmlspecialchars.<script src="http://example.com/maliciousscript.js"></script>

      --
      Claus
    2. Re:Number of characters?! by mkiwi · · Score: 1
      I'm a fan of descriptive function names, but there_comes_a_point_where_its_too_fucking_much().

      In Objective-C:
      [ThisIsMyObjectName everyMethodNameIsKindaLikeThis:thisIsMyArgument]

      It's a good practice. You end up needing to comment only the functional aspects of your code rather than what all the syntax or variables are. It's like a built-in commending system. Even when I code in Java I use that naming convention. Why you ask? Because I want people to be able to read my code and when I take a break I want to remember what I was writing.

      This assumes, though, that you comment your code :-)

    3. Re:Number of characters?! by iluvcapra · · Score: 1

      Let it also be said, that with Objective-C, a good IDE with message name completion makes the long typing manageable.

      --
      Don't blame me, I voted for Baltar.
  49. Re:Gripe Moan Bitch and Holler! by SanityInAnarchy · · Score: 1

    You can write smaller, more compact & light weight server side programs in C then you can for just about anything else.

    You obviously haven't seen just about anything else. I present Sinatra as Exhibit A:

    #!/usr/bin/env ruby
    require 'rubygems'
    require 'sinatra'

    get '/' do
    'Hello, world!'
    end

    Show me how that's done in C, so that I can laugh in your face.

    If you're talking about performance, you have a point. Unfortunately, it's not a very good one. Programmers are expensive. CPU isn't. And the Web is one place where, if needed, you can simply throw more CPU at the problem.

    "Smaller" and "more compact" are properties which are much more useful when applied to the source code, not the result.

    Scripting languages are for convenience, nothing more nothing less.

    Yes. High-level languages are for convenience.

    C is a high-level language.

    I'm not kidding. C was a tough sell over assembly at the time. It was actually sold on a lie -- that function calls were cheap. The original Unix spent over half its time in function calls -- but by then, it was too late. People had realized the benefit of high-level languages, and no one wanted to go back to assembly for a whole OS.

    Now it's happening again, and you are the crusty old get-off-my-lawn programmer who would still be writing in assembly, if you'd been around when C was the hot new thing.

    Native binary languages for *nix system have all the same goodies in them just written at lower levels

    Which, by definition, means they don't have the same goodies.

    Come back when C can do closures. Or reflection. Or lazy evaluation. Or transparent, opportunistic threading.

    These things are useful because they're high-level. If C natively supported them, C would become quite a lot higher-level. As it turns out, you'd have to do quite a lot of low-level work to get these in C, which would defeat the purpose -- or you'd have to build a layer on top of C to handle it for you.

    I work with such a layer. It's called Ruby.

    and you have to do a little work, or god forbid, some memory management

    I have no problem doing memory management, if there's a point. If it has, y'know, any relevance to the problem at hand.

    But malloc and free have absolutely nothing to do with rendering HTML, parsing RSS, talking SQL to the database, or any of the other things I'm actually doing.

    Sure, they're called behind the scenes, but that's not the point -- so is MOV, CALL, JMP, and so on. Just why is it that you like C, and not assembly?

    Scripting languages are for those of a weak mind and poor technical skills and the singular lack of the ability to plan a system out before you write one line of code.

    When was the last time you were employed? Scripting languages are for those on a budget and a deadline.

    For that matter, what have you done in LISP? If it's the higher-level people who have the "weak mind", it should be easy for you to grok macros, reflection, lambda closures, and iterators, right?

    And if you can plan the entire system out before you write one line of code, great, congrats to you.

    Except I'll be halfway through implementing it while you're planning it out ahead of time, and I'll be able to actually react when the requirements change. I doubt your superior mind can actually see into the future and predict new things you might have to add.

    One more cheap shot before I go -- When you have to port your 32-bit C app to 64-bit, how much did you have to change? It's possible it just recompiled, but for most real-world C apps, it takes at least some effort. And that assumes you've stuck to the subset of POSIX which is reliably implemented everywhere, so you don't have to port between OSes.

    I

    --
    Don't thank God, thank a doctor!
  50. Technological debt, anyone? by zedeler · · Score: 1

    Then I see people suggesting \ for a namespace separator, and I wonder what happened to all the people that put so much work into making PHP5 good, and why we can't get them back.

    The answer is right there under your nose.

    Inability to make up for poor design keeps the good people away. This is just another day in PHP-land.

    I personally threw in the towel when I found out how fatally flawed the magic constant __FILE__ is and how unwilling the PHP developers are to do anything about it.

    Anyone wanting a different view on this, try Googling "technological debt".

  51. PHP the self isolated group think by mlwmohawk · · Score: 1

    I had a coule extension in PHP, but they eventually got pulled. No biggie, I guess, but my experience with PHP was not pleasant.

    I don't want to bash the project because there are a number of very good people on it, but there is a tendency to operate in isolation and the team sort of falls into a click. They'll make decisions on IRC and you don't hear about it until they screw with your extension. It is run by a relatively small group of people who don't think much bigger than that.

    So, when they come up with an obviously brain-dead boner like this, no one should be surprised.

  52. Just downloaded mod_python by thetoadwarrior · · Score: 1

    I've never fully got into Python as I felt my hands were full with PHP, Javascript and Java but the PHP guys keep doing stupid shit and the more I've gotten into Java the more unprofessional PHP felt and I think this is the straw the broken the camel's back.

    I really get the impression sometimes that they're not interesting in making a good language. They're happy with the fact it's an easy language that a lot of web developers use purely because it's easy to knock out a few scripts. I want something more than a language that panders to half-wits.

    I'll see how I get on with Python and if, need be, I can always fall back to using JSP.

  53. Re:HOLY FUCKING SHIT!?!?! by Anonymous Coward · · Score: 0

    In C++ you use

        namespace Blah::Blah {


            class Foo { ... };

        }

    to define stuff in a namespace, and

        using namespace Blah::Blah;

    to import names from another namespace.

    Common Lisp uses blah:identifier for public symbols and you can also write blah::identifier (with two colons) to access private names of a package if you know what you're doing. The default package for a source file is set by (in-package blah)

  54. Re:Gripe Moan Bitch and Holler! by Anonymous Coward · · Score: 0

    It's a damn shame this post was modded troll. Slashdot used to have a lot of actual software designers, and not these scripting language lightweights who need every safety-net in the book to save them from themselves. A quick hint to the weak sisters out there: programming language selection isn't going to turn you into a competent designer. Crutch features like VMs, GCs, etc. just prevent you from learning your craft with no long-term benefit.

  55. Yet another symbol to mess PHP source code with by chrysalis · · Score: 1

    PHP source code is already cluttered with symbols like ->, : and $ (and those horrible $this-> everywhere...) and now \ ...

    Really, PHP code is ugly. Why does PHP need this, while Ruby is way more elegant without missing any feature?

    --
    {{.sig}}
  56. Re:HOLY FUCKING SHIT!?!?! by Anonymous Coward · · Score: 1, Funny

    I understand they messed up parsing foo::bar as one method... so why not just do namespace:::foo::bar ? ::: is still far from standard, but less god awful than "\".

    If ::: means something in the PHP universe (I set the language down years ago), then they could do ":.:" and make both C# and Perl programmers happy in one swoop!

  57. Once more into the breach by symbolset · · Score: 1

    The Tao gave birth to machine language. Machine language gave birth to the assembler.

    The assembler gave birth to the compiler. Now there are ten thousand languages.

    Each language has its purpose, however humble. Each language expresses the Yin and Yang of software. Each language has its place within the Tao.

    But do not program in COBOL if you can avoid it.

    - The Tao of Programming

    --
    Help stamp out iliturcy.
  58. Re:Gripe Moan Bitch and Holler! by FlyingGuy · · Score: 1

    Pray tell, what absolutely needs to be compiled at run-time?

    --
    Hey KID! Yeah you, get the fuck off my lawn!
  59. Re:Gripe Moan Bitch and Holler! by shutdown+-p+now · · Score: 1

    Or for projects that need to be compiled at runtime. But, nice magnanimity.

    I don't know what the trollish GP meant by "scripting languages", but then I'm not sure what you mean by them, either. So, do tell - what difference does it make whether a language is "scripting" or not when it needs to be compiled at run-time? Java is compiled at run-time in JSP, C# is compiled at run-time in ASP.NET - and I haven't heard anyone calling those two "scripting", at least.

  60. Re:HOLY FUCKING SHIT!?!?! by shutdown+-p+now · · Score: 1

    In C++ you use

    namespace Blah::Blah {
    class Foo { ... };
    }

    to define stuff in a namespace

    No, you don't. C++ does not let you nest identifiers when defining a namespace, so you have to do full nesting by yourself:

    namespace Foo {
    namespace Bar {
    class Baz { ... };
    }
    }

  61. It's all a joke by Roger+W+Moore · · Score: 0

    I think the whole thing is a joke by the developers. I mean look at the table of evaluation criteria in one of the linked articles: '**' is easier to type than '^^'? Using '\' has the best parse-ability? Plus they did not even evaluate '::'. Come on - when things are this crazy it's usually a joke...I hope!

    1. Re:It's all a joke by ESqVIP · · Score: 2, Interesting

      '**' is easier to type than '^^'?

      It is, once you consider some people have dead keys. Typing "^^" can become wildly different depending on what OS you're using, and result in weird behavior. On some systems/applications, the two carets are printed at once and you're back to normal editing. On others, the first one is written, but the other remains in dead-key mode. I've seen systems where this would just print a single caret (possibly coupled with a beep). Then the only reliable way on those keyboard layouts to type that symbol is to press caret, space, caret, space -- four key presses (not counting any shifting you might need to get to the caret character) for an operation which might become very common.

      Using '\' has the best parse-ability?

      Well, an unambiguous, single-character token is often easier to parse than a double-character token which might conflict with a single-character one.

      Plus they did not even evaluate '::'.

      That's what they were originally using. The problem is that they already use it for static method invocation, so there would be problems when class names and namespaces clashed. And then for some reason they decided they wanted to allow that to happen, rather than (for example) not allowing classes to have the same name as namespaces and mitigating that by using different naming conventions for both.

      But then again, the backslash isn't very easy to type either -- I'm daily switching between three different computers. On each one of them, the backslash key is in a different position. Seriously.

    2. Re:It's all a joke by corychristison · · Score: 3, Insightful

      :: is already used for static methods on classes... it would be harder to implement the differentiation of :: for namespaces and :: for static methods... especially if people started to use classes with the same name as a namespace (which is likely if all modules get their own namespace)

      I actually think that '\' is appealing for what it will be used for. The one thing I first though of was SomeModule\new_object::test_function();

      Wouldn't it try to evaluate the '\n' as a \n new line? I suppose it will be out of the double quite string scope so it could be alright... could get messy if eval()-ing code, though.

    3. Re:It's all a joke by ParanoiaBOTS · · Score: 1

      '**' is easier to type than '^^'?

      It is, once you consider some people have dead keys. Typing "^^" can become wildly different depending on what OS you're using, and result in weird behavior.

      Yes but we are talking about a very, very slim minority here are we not? No offense intended but it seems like your whole point is hinging on the absolute minority of people out there. I can't think of any systems off hand that do this

      Using '\' has the best parse-ability?

      Well, an unambiguous, single-character token is often easier to parse than a double-character token which might conflict with a single-character one.

      I will give you that

      But then again, the backslash isn't very easy to type either -- I'm daily switching between three different computers. On each one of them, the backslash key is in a different position. Seriously.

      So spend the $5 and get a new keyboard? Unless your keyboard is physically, permanently attached. Then again we get into the very, very minority. This argument seems to me alot like that coming from people that are STILL using IE6: Me: Why don't you upgrade? Them: Upgrading is too hard Me: You mean hitting a single button (yes install an update) and waiting for a few minutes is too hard? And because you are too lazy to update we have to go out of our way to be backwards compatible...

    4. Re:It's all a joke by ESqVIP · · Score: 2, Informative
      I don't like to make assumptions about others, but you seem to believe that the majority speaks exclusively English.

      Yes but we are talking about a very, very slim minority here are we not? No offense intended but it seems like your whole point is hinging on the absolute minority of people out there. I can't think of any systems off hand that do this

      According to Wikipedia, the circumflex accent is "used in written Croatian, Esperanto, French, Frisian, Norwegian, Romanian, Slovak, Vietnamese, Romanized Japanese, Romanized Persian, Welsh, Portuguese, Italian, Afrikaans, Turkish and other languages".

      I don't know the keyboard layouts used by all of them, but I'd bet most (if not all) of them use a dead key for both the caret and the circumflex rather than including additional keys, and Portuguese and French have a reasonable number of speakers. Plus there are those who, despite not speaking one of these languages, still have dead keys (for example on US-International). What's the layout used by the people who speak Spanish in the US? If it's US-International, that should be a sizable part of the population even in an English-speaking country.

      So spend the $5 and get a new keyboard?

      Um, no, not always possible. I know this comment went more into my particular problems, but still I saw similar complaints on Reddit. I guess people in other countries also have the same issues of every now and then having to deal with other layouts.

    5. Re:It's all a joke by Requiem18th · · Score: 5, Informative

      And this is (one of) the many reasons PHP sucks:

      Java:
      Attribute/Method access: foo.bar
      Static method access:    Foo.bar
      Package access:          foo.bar.baz

      C#:
      Attribute/Method access: foo.bar
      Static method access:    Foo.bar
      Namespace access:        foo.bar.baz

      Python:
      Attribute/Method access: foo.bar
      Static method access:    Foo.bar
      Module access:           foo.bar.baz

      PHP:
      Attribute/Method access: $foo->bar
      Static method access:    Foo::bar
      Namespace access:        foo\bar\baz

      --
      But... the future refused to change.
    6. Re:It's all a joke by Haeleth · · Score: 1

      ...um, what exactly is the point you're trying to make? That PHP sucks because it isn't C#, Java, or Python? Languages do have different syntax. Deal with it.

      C++:
      Attribute/method access: foo->bar, foo.bar
      Static method access: foo::bar
      Namespace access: foo::bar::baz
       
      Perl:
      Attribute/method access: $foo->bar
      Static method acccess: Foo::bar
      Namespace access: Foo::Bar::baz

      PHP sucks because it's poorly designed, encourages bad programming practice, and makes good programming practice difficult. The syntax, however, isn't particularly out of the ordinary.

      (I do agree that \ is a very bad choice, though. The keyboard I'm typing this on doesn't even have a backslash key -- I have a choice of Fn-Z or Compose-/-/, neither of which is very easy to type. Thankfully I don't use PHP, so the problem won't arise.)

    7. Re:It's all a joke by Haeleth · · Score: 4, Insightful

      So spend the $5 and get a new keyboard? Unless your keyboard is physically, permanently attached. Then again we get into the very, very minority.

      "People with laptops" is a very, very tiny minority?

    8. Re:It's all a joke by supersnail · · Score: 1

      If you live anywhere on continental Europe "\" is not an easy character to type.

      On French, German, Swiss, Belgian keyboard the little b*st*d is an "alt gr" key.

      Not too much of a problem until you have someone on the phone. Just try holding down the "Alt Gr" and
      the "" key at the same time as holding a telephone receiver!

      Curse you insensative anglo saxons!

      --
      Old COBOL programmers never die. They just code in C.
    9. Re:It's all a joke by caluml · · Score: 1

      That post does show quite well what a silly decision it is. Standardise. Change a few things at a major revision to make stuff logical, well thought out. I can't see the logic to this decision at all.

    10. Re:It's all a joke by Requiem18th · · Score: 1

      Ok, I should have been more explicit. My complaint is that there isn't a good reason for using three diferent syntax where one would have been enough nor there is a good reason to use "$" only for variables but not on classes or namespaces.

        I know, it allows us to have a variable, a class and a namespace with the same name but we don't really do that anyway, we use different naming conventions, etc.

      --
      But... the future refused to change.
    11. Re:It's all a joke by Anonymous Coward · · Score: 0

      My complaint is that there isn't a good reason for using three diferent syntax where one would have been enough

      How about, "re-using operators obscures the nature of the operation, making code harder to read"?

      I'm not a PHP fanboi but claiming that there is no good reason to use different syntax for different things is just dense.

    12. Re:It's all a joke by Anonymous Coward · · Score: 0

      how about learning programming and quit assuming every developer is a stupid monkey?

      ok, most of the developer I know are, but that is more a cause than a result

    13. Re:It's all a joke by Anonymous Coward · · Score: 0

      When was the last time you programmed->inC?

    14. Re:It's all a joke by poot_rootbeer · · Score: 1

      Plus they did not even evaluate '::'

      For better or worse, they couldn't. In PHP, the '::' token is already reserved for derefencing the members of a static class.

      Come on, everybody. There's no shortage of legitimate reasons to ridicule PHP, but "doesn't use all the same punctuation as a few other programming languages" isn't one of them.

    15. Re:It's all a joke by ParanoiaBOTS · · Score: 1

      So spend the $5 and get a new keyboard? Unless your keyboard is physically, permanently attached. Then again we get into the very, very minority.

      "People with laptops" is a very, very tiny minority?

      People with laptops typically have a removable keyboard

    16. Re:It's all a joke by Fallingcow · · Score: 1

      Ok, I should have been more explicit. My complaint is that there isn't a good reason for using three diferent syntax where one would have been enough nor there is a good reason to use "$" only for variables but not on classes or namespaces.

      "$" is used on an instance of a class.

      As in:

      $user = new userClass;
      $user->load($_REQUEST['id']);
      echo "Hello " . $user->firstName;

      (yes, I'm passing a raw form request to what is probably a database. Before someone bitches about how bad PHP programmers are, let me assure you that this imaginary class contains automatic, imaginary input verification and scrubbing, and will turn control over to an imaginary error-handling class in the event of a hypothetical datatype mismatch on an integer SQL row ID)

    17. Re:It's all a joke by ncc74656 · · Score: 1

      So spend the $5 and get a new keyboard? Unless your keyboard is physically, permanently attached. Then again we get into the very, very minority.

      "People with laptops" is a very, very tiny minority?

      People with laptops typically have a removable keyboard

      It's not typically intended to be removed by the user, so it's not easy to remove. Besides, even if it is easily removable (which it usually isn't), it's usually not something for which you would just pop down to Fry's, pick up a random keyboard, and drop it in...a given notebook keyboard will usually fit only a small handful of different models.

      --
      20 January 2017: the End of an Error.
    18. Re:It's all a joke by GleeBot · · Score: 1

      PHP:
      Attribute/Method access: $foo->bar
      Static method access: Foo::bar
      Namespace access: foo\bar\baz

      To be fair, C++ is pretty stupid about this, too. Not quite as stupid, but that's clearly where they're drawing the inspiration for the first two cases.

    19. Re:It's all a joke by Requiem18th · · Score: 1

      "$" is used on an instance of a class.

      I know that, but that "$" is still superfluous the same could be achieved by writing:

      user = new UserClass;
      user->load(_REQUEST['id']);
      echo "Hello {user->firstName}";

      Oh and interpolation makes a dedicated concatenation operator irrelevant but I'm not complaining about that.

      --
      But... the future refused to change.
    20. Re:It's all a joke by mounthood · · Score: 1

      Set "magic_namespaces" on to use a dot. Done and done.

      I just started some PHP forms and learned that PDOException doesn't inherit from Exception, and most errors don't throw exceptions anyways, so error handling is really bad. It's common to see PHP database errors, but I always thought it was lazy programmers.

      --
      tomorrow who's gonna fuss
    21. Re:It's all a joke by Requiem18th · · Score: 1

      Google has never heard of magic_namespaces what are those?.

      --
      But... the future refused to change.
    22. Re:It's all a joke by Jraregris · · Score: 1

      According to Wikipedia, the circumflex accent is "used in written Croatian, Esperanto, French, Frisian, Norwegian, Romanian, Slovak, Vietnamese, Romanized Japanese, Romanized Persian, Welsh, Portuguese, Italian, Afrikaans, Turkish and other languages".

      I don't know the keyboard layouts used by all of them, but I'd bet most (if not all) of them use a dead key for both the caret and the circumflex rather than including additional keys, and Portuguese and French have a reasonable number of speakers.

      On a Norwegian keyboard hitting the caret one time gives you a dead key, the second time it gives you two carets. As does all the other dead keys.

    23. Re:It's all a joke by Anonymous Coward · · Score: 0

      C++:
      Attribute/method access: foo->bar, foo.bar
      Static method access: foo::bar
      Namespace access: foo::bar::baz

      FWIW, foo.bar and foo->bar are also valid C++ for static member access (for an instance variable, not a class name). You probably know that, but a reader unfamiliar with C++ might infer that only operator :: is valid. The distinction is irrelevant for the GP's post, as all the example languages contrasted with PHP use . for everything.
      - T

    24. Re:It's all a joke by badkarmadayaccount · · Score: 1

      Funny thing is, mine's got two, one next to the spacebar, one next to enter. This is on an old FSC AMILO L1300, and its the same on my new Pi 2530. I think one of those is a legacy key that got reused, and they think they can out it wherever they want.

      --
      I know tobacco is bad for you, so I smoke weed with crack.
    25. Re:It's all a joke by badkarmadayaccount · · Score: 1

      What I'd like to know is how to change the keyboard on a laptop without shelling out a ton o' $$$ and/or voiding your warranty. Any takers?

      --
      I know tobacco is bad for you, so I smoke weed with crack.
    26. Re:It's all a joke by Anonymous Coward · · Score: 0

      We don't really care about the other languages. They had their own evolutions and their own reasons. PHP had already a different symbol for Attribute or static access, so it makes sense to have another one for the namespace.
      Anyway it is impossible to please everybody whatever the decision is. And I agree this decision.

  62. Re:Gripe Moan Bitch and Holler! by SUB7IME · · Score: 1

    Just as nothing needs to be precompiled, nothing needs to be compiled at runtime, either. That said, some things are more amenable to one or the other.

  63. Why PHP -- WHY!?!? by xceinstein · · Score: 1

    I have been a PHP developer since the 3.0 days, and I really like PHP. But the people making the decisions and Zend now are making the wrong ones! How am I supposed to promote my language with idiotic syntax like this? As much as I wanted namespaces, I don't think I will use them now. The syntax is just dumb and confusing -- not that PHP source code is all that "pretty" anyway! Maybe I should go back to a real programming language like Java, C# or ObjC -- *sigh*. Too bad they don't make a mod_ecmascript. I kinda like the Javascript syntax. For python people -- I HATE, HATE, HATE the fact that there are no opening and closing indicators for control blocks! -- maybe it is something you get used to.

    1. Re:Why PHP -- WHY!?!? by gbjbaanb · · Score: 1

      They do (sortof).

      See here for a bit of a discussion of the topic, including a link to mod_wxjs an whitebeam.

      Ps. Indentation is your friend, even with scope indicators, you still want to code scope blocks with indentation, otherwise its a bitch to read. python just removed them as they should be redundant.

    2. Re:Why PHP -- WHY!?!? by xceinstein · · Score: 1

      I agree wholeheartedly with indentation! I even do the block identifiers around single statements within a control block just to keep everything consistent. I still like the identifiers -- guess I am old school. I grew up on Pascal, which is VERY structured and probably explains my desire to have the identifiers. I see where you are coming from though, probably just takes some getting used to. As far as the mod_wxjs, have you ever used it?

    3. Re:Why PHP -- WHY!?!? by gbjbaanb · · Score: 1

      mod_wxjs, no. I've not used it. I'm not a web server developer really. However, I do think its a sensible thing, whilst you cannot re-use all your client-side code, that's no reason not to reuse some of it and also to have client and server code written in a single language (there's quite a few benefits to that).

      As we have all these client-side javascript compilers that give great performance there's even less reason not to use it on the server too.

      I grew up on Pascal too! I really think everyone else should, its the perfect introduction to a serious development career.

  64. Various grumbles - but mostly this is UGLY by userw014 · · Score: 1

    They screwed up IDE compatibility. "\" should get a "-1" instead of a "+1". I also think that the difference between one and two characters for a token object token is largely irrelevant. What does "typeability" mean? Proximity to the center of the keyboard and "shift"-iness? Mostly, I think it looks UGLY.

  65. Re:Gripe Moan Bitch and Holler! by SUB7IME · · Score: 1

    I didn't use the term "scripting languages," and I can't answer for the GP since we clearly don't see eye to eye. I have no problem with run-time compiled languages; I use them.

  66. Following in the tradition of paamayim nekudotayim by kopo · · Score: 1

    Following in the tradition of paamayim nekudotayim (::), I'm going to propose that the name for the new operator be lokhsan achori (\).

  67. Re:Gripe Moan Bitch and Holler! by chrysalis · · Score: 1

    Let me know when PHP has threads.

    --
    {{.sig}}
  68. Stupid by alfredbaudisch · · Score: 1

    Well, I program in PHP for almost 9 to 10 years, I did the full programming from small to huge projects and now I can say I am getting ashamed of PHP day by day. And WTF? Even for me, with experience, \ is pretty ugly and stupid. As someone already pointed this is the global scaping character, which even PHP uses. Why not :: ? PHP is already a mix of C, C++ and Java, :: would mix like candies.

    1. Re:Stupid by Shados · · Score: 1

      Well, technically its not :: in Java, and C doesn't have namespaces. So -if- you consider PHP a mix of C/C++/Java (I wouldn't, but meh), it wouldn't fit all that good to use "::".

    2. Re:Stupid by alfredbaudisch · · Score: 1

      Actually it is a mix, but without the "true" objects of Java, as you can still program procedural or oop. And as we already use "::", extending to Namespaces would be the better other than a stupid "\", fitting with C++.

  69. Re:Gripe Moan Bitch and Holler! by Anonymous Coward · · Score: 0

    Slashdot still has a lot of those "actual" software designers, you know, the ones who assume that because you're not writing in C or Java you must be some kind of moron?

  70. Re:HOLY FUCKING SHIT!?!?! by Phroggy · · Score: 1

    ...they could do ":.:" and make both C# and Perl programmers happy in one swoop!

    I can't speak for C# programmers, but I can assure you that Perl programmers would ridicule them far more for using ":.:" than for using "\".

    --
    $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
    $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
  71. Re:Gripe Moan Bitch and Holler! by nicklott · · Score: 1

    Scripting languages are for convenience

    Oh noes! God forbid computers might make life easier...

  72. Re:Gripe Moan Bitch and Holler! by NoOneInParticular · · Score: 1

    If you're talking about performance, you have a point. Unfortunately, it's not a very good one. Programmers are expensive. CPU isn't. And the Web is one place where, if needed, you can simply throw more CPU at the problem.

    Snicker. You've just offloaded your incompetence to a small army of IT personnel that now needs to keep a farm of servers running 24x7. That army is expensive, the datacenter that needs to be used is expensive. The programmer is just a one time expense.

  73. ...And yet... by Anonymous Coward · · Score: 0

    JavaScript manages it just fine. It's also weakly typed. eval() is a big help.

  74. Oblig. Bender by OldManAndTheC++ · · Score: 2, Funny

    Yeah, screw those guys! I'll make my own PHP -- with blackjack! and hookers!

    --
    Soylent Green is peoplicious!
    1. Re:Oblig. Bender by Anonymous Coward · · Score: 0

      In fact, forget the PHP!

    2. Re:Oblig. Bender by badkarmadayaccount · · Score: 1

      You should know better young^H^H^H^H^Hold man! You forgot - "In fact, forget the PHP. And the blachjack."

      --
      I know tobacco is bad for you, so I smoke weed with crack.
  75. Is that a joke? by euice · · Score: 1

    That's basically how they came to this decision:

    PHP Developer A: Hey, when I'm inside a namespace, my code does not do the same thing as outside! I tried to fix it but because we are using :: alredy for separating classes and their members, it would just slow PHP down even more. Lets just switch the separator, I vote for \^^H\\^H^H "\\"

    PHP Developer B: I see, the hardest part now is to agree on the separator, but I'm sure I can come up with a chart that makes your \"\\\\\" win.

    ...

    I'm loosing my words here, they tried to solve a problem without even bothering to check if someone else solved it already.

    Or in direct words to the PHP Team: Please *%/$@ at least USE GOOGLE, and you'll find other languages where :: or . or whatever WORKS JUST FINE.... AND FAST...

    But OTOH maybe that'll make others switch away from PHP... Or while they're at it, from Windows... And from SUV's... *sigh*

  76. PHP it was nice knowing you by Anonymous Coward · · Score: 0

    Good bye!

  77. LOL! A smiley as namespace seperator. by Qbertino · · Score: 1

    Yeah, they actually had a smiley as seperator on the list. Now that might have been just as weird, but at least it would have been funny. They should've taken that.

    --
    We suffer more in our imagination than in reality. - Seneca
  78. Re:Gripe Moan Bitch and Holler! by FlyingGuy · · Score: 1

    Exactly..

    Most of these scripting languages were designed to extend base languages and make them more accessible to more people. The days of writing in assembler except for the most abstract and lowest level bits and parts are long over, although I do still enjoy writing in assembler simply because it makes me think down to the level of the machine and understand the costs of doing something one way or the other.

    I have found that the various scripting languages out there are an outgrowth of someone who programmed in a lower level language and simply either got bored with it ( completely understandable ) or wanted to wrap all of the low level functions they had designed into something more accessible, hence all the various scripting languages have their roots firmly planted in the soil of C.

    Now none of that means that you have to write this stuff in C, you could write them in pretty any of the lower level languages that have compilers that generate native binaries. Writing a good interpreter is not by any means trivial, it is hard work.

    So to the root of my diatribe, I would wager that most of the people bitching about the architects of PHP using the backslash as a name space separator could not even begin to write something like PHP and yet they feel so qualified to raise their collective voices in protest and condemn the decision of dev's who quite obviously do so, to be nothing more then pretentious and self aggrandizing and thusly they should be regarded with scorn and ridicule.

    As to me, yup I am in the over 50 crowd who's shoulders others stand on and I also stand on the shoulders of others who's are broader then my own.

    --
    Hey KID! Yeah you, get the fuck off my lawn!
  79. The dot is dead by arilian · · Score: 1

    The dot has been fired. Long live the slash.

  80. Forty years down the road by Master+of+Transhuman · · Score: 2, Insightful

    with 4GB RAM machines with TB hard drives - and we're still worrying about "the number of characters".

    Oh, please. Fucking nerds.

    For the last forty years, we've been constrained by one pointless limitation after another, not to mention the complete inability of a PC to discern what is an identifier and what is command syntax if it has fucking SPACES in it.

    Get your heads out of your asses.

    And learn to type.

    "Number of characters" - Jesus Baron von Christ!

    --
    Richard Steven Hack - This sig is TOO GODDAMN SHORT TO DO ANYTHING USEFUL WITH! MORONS!
  81. And just to add to that by Master+of+Transhuman · · Score: 2, Informative

    calling a computer programmer a "software engineer" is like calling a crack whore a "courtesan".

    There's no "engineering" involved for ninety nine percent of them.

    --
    Richard Steven Hack - This sig is TOO GODDAMN SHORT TO DO ANYTHING USEFUL WITH! MORONS!
  82. PHP is a whacky domain-specific PL. Get over it. by Qbertino · · Score: 1

    Oh, the bitching and the whining I hear and read.
    Cut it out allready.

    PHP is a whacky PL. It allways has been, ever since it derived from Perl. Which explains quite a bit. And while I don't like the solution of using a backslash as namespace seperator and the totally off-the-mark easyer-to-type criterion (Something like 80% of the non-trivial PHP appliations are developed with non-english keyboards) and the utter bullshitting criterion table they've come up with - the solution they've presented is as good as any other. They probably also have technical reasons (xpath type stuff comes to mind) to do it this way. And no matter which way they'd have done it, it allways would've hurt someones feelings.

    And let's be honest: As batshit crazy PHP is allready, wether or not namespace delimiters are well chosen really matters squat.

    And as for the poo-flinging: You people just go on ranting about how PHP is crappy, imature and oh-so-dead in the water.
    Meanwhile Joomla, Drupal, Typo3, Cake, Symfony, Prado, ZendFW and EZ Publish carry on getting the job done. And gaining market share.

    --
    We suffer more in our imagination than in reality. - Seneca
  83. Not surprising by glwtta · · Score: 1

    Yeah, PHP does a lot of things "with a twist".

    --
    sic transit gloria mundi
  84. Re:Well now we all know what trouble this is going by glwtta · · Score: 2, Insightful

    Yeah, and if you are running PHP on a Windows server, do you really need any more trouble?

    --
    sic transit gloria mundi
  85. Re:Gripe Moan Bitch and Holler! by siride · · Score: 1

    I didn't say PHP was great. But there are other "scripting" languages out there that do quite well and do have threads. Functional and dynamic languages like Lisp and co. have many of the features of scripting languages, but are technically compiled and perform quite well. Also, the threading models in C and C++ is extremely limited and easy to get wrong.

  86. quoting hell by belmolis · · Score: 1

    This sounds like a terrible idea to me. It will produce quoting hell for anybody using a form of Unix or Unix-inspired tools on the code. I've worked with flat databases with tagged fields where the field separator is line-initial backslash, and this is such a pain in the neck that the first thing I usually do is convert it to something else.

  87. Remember? by speedtux · · Score: 1

    Remember, if it's more complex for the parser to understand, it's more complex for a human to understand.

    What's easy for computers to parse (e.g., deeply nested S-expressions) is often very hard for people to parse. And what's easy for people to understand (like English) still defeats machines. So, please, stop making up facts.

  88. Re:Gripe Moan Bitch and Holler! by Jack9 · · Score: 1

    Ruby is the VB of the scripting world (I though it was funny)

    http://www.infoq.com/interviews/Languages-Ted-Neward

    --

    Often wrong but never in doubt.
    I am Jack9.
    Everyone knows me.
  89. Re:Gripe Moan Bitch and Holler! by SanityInAnarchy · · Score: 1

    Snicker. You've just offloaded your incompetence to a small army of IT personnel that now needs to keep a farm of servers running 24x7.

    s/incompetence/work. After that... so what?

    That army is expensive, the datacenter that needs to be used is expensive.

    It's really not.

    The programmer is just a one time expense.

    Absolutely not, especially in web development. Do you think Google would still be in business if they stopped developing after Version 1.0? Have you noticed that YouTube is able to react to something as small as an XKCD comic, in order to deliver new features?

    No, programming is an ongoing expense. So you want to develop in something maintainable, and in something that can scale, even if you can't scale yet.

    Oh, and horizontal scaling is more important than vertical scaling, for pretty much all web apps. Vertical scalability is what you're assuming is important -- squeezing more out of every cycle of a single machine. Horizontal scaling is about making sure that you can simply throw more servers at the problem, and your app will actually be able to run concurrently on multiple cores, and on multiple machines, without falling over.

    Also: Programmer time is never going to get cheaper. Hardware does all the time, thanks to Moore's law. Unless that trend stops, my position in this argument will only get stronger every year.

    --
    Don't thank God, thank a doctor!
  90. Re:HOLY FUCKING SHIT!?!?! by Kindaian · · Score: 1

    Unreadable!

  91. Wonderful analogy! by MarkusQ · · Score: 3, Interesting

    GOTO is what your CPU is actually doing 80% of the time.

    And your car's engine spends all of its time repeatedly causing small explosions with volatile petroleum.

    The driver is generally recommended to let the engine do this and not try to intervene or do it themselves.

    Spot on. Dead on target and a car analogy. You rock.

    --MarkusQ

  92. Re:Gripe Moan Bitch and Holler! by SanityInAnarchy · · Score: 1

    Could have pointed to a timecode. Seems to be about 19 and a half minutes in.

    I wasn't wanting to start a flamewar of language vs language. I'll defend a lot of features of Ruby, and I'll point out fundamental flaws in it...

    But I think we can agree that web services should almost never be written in C, when there's any higher-level option.

    --
    Don't thank God, thank a doctor!
  93. When I proposed dropping the $ from variable names by mAriuZ · · Score: 1

    They told me that is not such an great idea
    http://marc.info/?t=122174931400009&r=1&w=2
    and i agree that it will break things but it would make php more friendly to java script programmers
    I don't know if they researched the solutions to this issue from other programming languges:python , perl , ruby , pascal ....

    --
    developer http://flamerobin.org
  94. PHP may be a weird language.... by alien_life_form · · Score: 1

    ...but ist architects smoke REALLY good stuff.

  95. No ease of typing on German keyboards either by FlameWise · · Score: 1

    QWERTZ representing from Germany, and I must say that it's not easy to type \ here:

    On Windows machines, you type the right-hand side "Alt" and "?" for a \. If you're on a laptop without a right-hand side "Alt" key you're going to need documentation on how to get a \. With a bit of luck it's Function-Alt-?.

    On Mac machines it's a lot easier: You type Alt-Shift-7, except where the \ symbol is very likely printed on your Windows keyboard, on Mac none of the Alt-combinations are.

    On german HP UNIX keyboards it used to be worse than that, but maybe they've changed their layout now.

    \ is a bad choice also because it is used as a quotation character in a LOT of languages.

  96. This has to be a joke! by guysmilee · · Score: 1

    This has to be a joke! Are the php people idiots ... people love and crave familiarity ... and where i am from "::" is a scope operator. Maybe the lazy buggers don't like lexing for two characters instead of one. Java suceeds because it is familiar, C# same, etc etc ... use your GD heads!

  97. oh php by Anonymous Coward · · Score: 0

    fuck the world!

    oh my god! why not use comma , as namespace separator??!!

    we can kill follow syntex: define('a', 'a'); define('b', 'b'); echo a,b;

    and assign comma to namespace...

  98. PHP devels worried about clarity and code length? by mr_mischief · · Score: 1

    They have a serious consideration about character count for a two-character operator vs. a one-characters operator which will be used in a minority of lines of code? This is from the people who put entire APIs for a few dozen optional libraries in the global namespace in the first place rather than working out separate namespaces? This is the same language with the functions "mysql_real_quote", "mysql_query", "imagetruecolortopalette", "xsl_xsltprocessor_transform_to_xml", "htmlentities" and "html_entity_decode", right? They can't even decide how the the words in multi-word function names will be joined.

  99. Re:Gripe Moan Bitch and Holler! by Anonymous Coward · · Score: 0

    $876.58 adds up. Leasing four servers rather than six is negligible, but leasing 400 rather than 600 easily covers the salary and overhead for the guy who makes it possible.

  100. for whom do they design the language? by wikinerd · · Score: 1

    <humour>
    From the chatlog:

    is there some problem with \ and notepad?
    [...]
    no there isn't
    [...] [...] [...]
    So \ it is.

    No wonder why many prefer a snake, a gemstone, or a mollusk byproduct.
    </humour>

  101. They need to rename the language. by argent · · Score: 1

    They absolutely need to rename the language.

    I suggest Beginner's All-purpose Scripted Internet Code, or "BASIC".

  102. Re:HOLY FUCKING SHIT!?!?! by Anonymous Coward · · Score: 0

    Either way, most languages use either "." or "::" for namespaces

    That's cute, but unfortunately irrelevant. Both of those are already in use in PHP's syntax, and changing them would substantially break backwards compatibility. That is why they had to choose between the other unused characters.

  103. Internationalizing programming languages by Anonymous Coward · · Score: 0

    Allowing unicode characters in identifiers is SICK and not to be encouraged by any programming language or any compiler for any reason, as the issues are even more widespread than with this PHP issue.

    How anglocentric of you... One can easily see from your post that you never need anything outside of ASCII to properly spell any word you would sensibly use as a variable name; that puts you in a very small minority.

    Seriously: what issues are you referring to?

    I can relate to both sides of this issue, personally... I mostly speak English myself but when it comes to computer languages, I would ideally like any I design to have good potential for international appeal without forcing foreign programmers to do things like use programming constructs with English names or ASCII symbols...

    But the issues to which he refers, I believe, have to do with the various ways certain glyphs can be encoded in Unicode - for instance, as a letter plus an accent mark, versus a pre-composed version of the letter with the accent mark (as a single code-point)... Handling cases like that (which are basically invisible to the user) requires more aggressive Unicode processing in the language interpreter. I think there's other, similar cases as well. And then there's the problem of making sure that characters that should not be valid parts of a symbol name are not - for instance, each language's equivalent of the quoting characters, different Unicode variants of the mathematical operators, etc...

    Basically, allowing the full range of Unicode to be used in identifiers raises the standard of complexity for handling the computer language significantly - and doing so is only moderately worthwhile, IMO, if it's not one's intention to move forward with properly internationalizing the language itself. (For instance, should a word in katakana be equivalent to the same word in hiragana? Should the antiquated version of a Chinese glyph be considered equivalent to the modern variant? And if different natural languages have different rules for what Unicode code points are "equivalent", how do you deal with that?)

    Finally, there's the problem of characters that look identical, but aren't. For instance, certain Greek or Cyrillic characters that look the same as particular Roman characters, but are in fact distinct in Unicode. (This is less of a practical problem, though, and more a new way to obfuscate code...)

    The problem is similar to the problem of handling caps-insensitive name matching, and with similar implications, but on a much larger scale. (Basically, you would attempt to translate the input to some canonical form for matching - but keep the original version around for debugging purposes, etc.) It's a substantial challenge, and to some extent meeting that challenge doesn't really make the language better...

    1. Re:Internationalizing programming languages by msuarezalvarez · · Score: 1

      Honestly, I'd rather not use a compiler/interpreter written by someone who cannot grok the "complexity" of handling unicode properly.

      In the same vein, designers of caps-insensitive languages should be banned from using computers, so that's not really an issue...

      More seriously: there are quite a few languages which allow Unicode everywhere, and the implementors have not died in the process of getting that done right...

  104. Coders who dont use PHP bitch about it, News at 11 by ukyoCE · · Score: 1

    *Yawn*

    As usual a bunch of people who never use PHP complain about a bunch of nonsense like: function argument order, the language has its own syntax, it has a "bloated" core (oh no! a 4mb executable shared across all php threads on my web server, THE HORROR), bothering to maintain backwards compatibility instead of breaking millions of apps and preventing them from upgrading to receive bugfixes, etc.
     
    :: and . are both already used in PHP. Breaking backwards compatibility is bad. Unless you expect to copy-paste code from some other language into PHP, there's no reason it needs to copy Your Favorite Language(tm)'s syntax. People who actually code in PHP will use it, recognize it, etc.

    And despite all the perl mongers with sour grapes, PHP will keep being the most widely used web programming language, with python and ruby as distant seconds.

    And for good reason too. Bad programmers (and noobs) can use PHP badly but still get things done. Good programmers can make large scalable web apps Very Quickly and with all the language features they need.

  105. Solving I18N problems in language design... by Tetsujin · · Score: 1

    How is it possible for even American developers to be this clueless. Which characters are convenient to type depends entirely on the keyboard layout that is used. Case in point, $ is insanely painful to type on Scandinavian layout.

    I hate issues like this. I want to create a Unix Shell-ish language - which means one of the very first design decisions is that $ prefix is used for variable names... But I hate the idea that the language I want to create could be a pain in the ass for people in other countries!* I'm not entirely sure how to solve issues like this, since there's a limited number of syntax characters available for use, and I don't want to define a whole bunch of reserved keywords... (My best plan to deal with this, so far, involves allowing for the definition of equivalent syntax characters for other natural languages, and also making the regular ASCII versions I'll be using easy to input regardless of the keyboard layout of the user, in interactive sessions anyway...)

    But the choice of syntax characters, to some extent, must be guided by how that affects the complexity of the parsing process. There are a number of reasons for this. Obviously the language interpreter itself has to be able to interpret the language - but also it is generally helpful if it's relatively easy for ancillary utilities (editors, IDE systems, debuggers, etc.) to handle the syntax... And with things like PHP where the source code gets interpreted over and over again each time a page is loaded, for practical reasons it's best if parsing is fast...)

    (* Obligatory joke: If the design pans out, it'll be a pain in the ass for everyone, regardless of nationality. :D )

    --
    Bow-ties are cool.
  106. Perl is numerically greater than PHP by Tetsujin · · Score: 1

    Will the people who made PHP a good programming language please fork it and take it away from the clueless morons who have taken over?

    As a Perl programmer, I have to laugh at your suggestion that somebody ever made PHP a good programming language. Read this and this.

    It's good that there's a programming language out there that Perl Programmers can laugh at...

    --
    Bow-ties are cool.
  107. Re:Gripe Moan Bitch and Holler! by DragonWriter · · Score: 1

    So to the root of my diatribe, I would wager that most of the people bitching about the architects of PHP using the backslash as a name space separator could not even begin to write something like PHP and yet they feel so qualified to raise their collective voices in protest and condemn the decision of dev's who quite obviously do so

    Not being able to build a car by themselves doesn't make people unable to tell that a BMW is better than a Yugo.

  108. breaking out of loops by doom · · Score: 1

    If you have a triple nested loop in the same function, you should refactor the code and move the inner loops into another function.

    There are languages like perl where you can name your loops, to make it clear where you want to break to:

    OUTER:
    foreach my $i (@x_vals) {
    foreach my $j (@y_vals) {
    next OUTER if out_of_bounds( $i, $j );
    process( $i, $j );
    }
    }

    And in using subroutine calls inside of loops there's a tradeoff between readability and efficiency. You can't say dogmatically that one way is better than the other.

  109. Re:PHP is a whacky domain-specific PL. Get over it by doom · · Score: 1

    And as for the poo-flinging: You people just go on ranting about how PHP is crappy, imature and oh-so-dead in the water.

    Meanwhile Joomla, Drupal, Typo3, Cake, Symfony, Prado, ZendFW and EZ Publish carry on getting the job done. And gaining market share.

    But it did all this without namespaces. Aren't you annoyed at them changing part of their winning formula?

    But you know, half of the time when I try to use one of these wonderful PHP based web apps, I discover remarkable amounts of suckage. I use a Drupal-based events blog that gets confused about days and times. Once, I set someone up with a Horde/IMP webmail account, and it turned out to have a nasty, clunky UI, and the proper administration was too difficult for the ISP (mysterious errors about incompatible versions of something or other kept popping up, as I remember it).

    PHP programmers discovered the "worse is better" principle, and took it to extremes.

    It could be that the success of PHP goes very far to proving that "Languages Don't Matter" -- at the very least, you can compensate for flaws with coding standards, automated tests, and fanatic QA, or else Yahoo would be out of business.

  110. Re:Gripe Moan Bitch and Holler! by SanityInAnarchy · · Score: 1

    $876.58 adds up.

    ...to less than one developer's salary.

    leasing 400 rather than 600 easily covers the salary and overhead for the guy who makes it possible.

    Assuming that, at that stage, only one guy would be enough to make it possible.

    Now, granted, one guy probably could, by tweaking some algorithms, adding caching in just the right places, etc.

    But one guy is not the difference between, say, a Ruby team and a C team.

    --
    Don't thank God, thank a doctor!
  111. Pathetic by Yami+King · · Score: 1

    Been a programmer for quite some time now, mainly used PHP. Was happy when PHP added support -finally- for namespaces, but this separator is ridiculous! Can't really say more about this..

  112. Re:Gripe Moan Bitch and Holler! by NoOneInParticular · · Score: 1

    s/incompetence/work/

    Granted, and apologies

    It's really not [link to ec2]

    Yes it is. The numbers add up. As another poster mentioned, enough extra cpu's for 24 hours a day does add up to your salary.

    Absolutely not, especially in web development. Do you think Google would still be in business if they stopped developing after Version 1.0? Have you noticed that YouTube is able to react to something as small as an XKCD comic, in order to deliver new features? No, programming is an ongoing expense. So you want to develop in something maintainable, and in something that can scale, even if you can't scale yet.

    Ok, programming is an ongoing expense. But do notice that hardware and maintainance of said hardware is an ongoing expense as well. You need to balance the two. Not being able to scale yet means that you cannot scale. The product is unfinished.

    Oh, and horizontal scaling is more important than vertical scaling, for pretty much all web apps. Vertical scalability is what you're assuming is important -- squeezing more out of every cycle of a single machine. Horizontal scaling is about making sure that you can simply throw more servers at the problem, and your app will actually be able to run concurrently on multiple cores, and on multiple machines, without falling over.

    I didn't claim anything around horizontal or vertical scaling. You're assuming I'm talking about wasting cycles here, but I'm not. I am talking about proper design for scaling, as well as proper coding to make use of that scaling. Both of these take time and thought. In my experience, a team that does not take excellent care of the details of their code to make sure that the individual components run smoothly and fast is very likely to make some large errors in their design to prevent them from scaling properly. One such error for a web application is building a CRUD application with dependence on a separate relational database tier to maintain state. This creates highly maintainable and easy to comprehend code that will not scale horizontally without some drastic measures. This is about 90% of the web-apps right there, and armies upon armies of DBA's and IT personel are full-time employed to keep such applications somewhat performing. This is considered best practice in the field and Oracle is laughing all the way to the bank.

    Finally, you mention Google. Have you ever looked at the attention to detail that comes out of Google in their high-scalability code. The web-parser is in C, simply because that's the fastest way to parse html. They might have a million machines to do this, but they do want to finish the job of parsing the internet as quickly as possible, simply because that means you can do it more often with the same hardware.
    Their generated html has all unnecessary fluff such as extraneuous whitespace removed, simply because every byte counts over the network. The generated javascript: no extra whitespace, and with short variable names. Same reason.
    There's no app-server involved, no database dependency in the response cycle, they've developed their own file-system, tuned their own fork of the OS to perfection, developed their own frameworks for using their hardware, etc., etc., etc. Google is by far the best example of my point: they have not offloaded any programmer's work on the maintenance staff. The programmers create code to do the job from the high-level scalability design down to the low-level optimizations that make it run smoothly in practice. The maintenance staff takes care of the hardware, and doesn't have the additional burden of covering for slack on the side of the developers. If you take care of detail, you can provide higher quality code, smoother operations, and overall a lower total cost of developing and running your app.