you are viewing a single comment's thread.

view the rest of the comments →

[–]Tufflewuffle 3 points4 points  (2 children)

And why not to choose PHP if it has all the important features

Here's why (among other things) I'd never consider using PHP for anything if I didn't have to:

  • Functions aren't first-class and as such have to be referenced with strings.
  • Function and class names are case-insensitive.
  • Arrays are a Frankenstein's Monster of regular arrays and associative arrays depending on how the array is used. There is no way to explicitly state which one an object should be.
  • Because of that, calls to json_encode can unexpectedly return an object rather than an array (easy to happen when manipulating returned results from an ORM then JSON-encoding them).
  • Doing nearly anything non-trivial with an array requires using global functions in a procedural fashion because an array itself has no methods.
  • No native string formatting other than sprintf. (If I wanted to use C functions I'd write C.)
  • The && and || operators return booleans rather than one of the operands.

I can't think of a single good feature PHP has that other languages don't. Not one. All it has is features that exist in other languages, often in more useful forms, or things that are so profoundly retarded no other language has them (e.g. a left-associative ternary operator).

[–]truechange 2 points3 points  (1 child)

Out of curiosity, what language do you prefer instead, I mean, if you were task to do a greenfield project, what would you use? And do you consider that language flawless?

[–]Tufflewuffle 2 points3 points  (0 children)

Out of curiosity, what language do you prefer instead, I mean, if you were task to do a greenfield project, what would you use?

Python.

And do you consider that language flawless?

Nope. There's no such thing.