News for hackers. Stuff that matters.
Re:PHP introduces "goto" by jey on Tuesday June 09, 2009 @04:40PM (#649941)
"Why? PHP is not any worse or better than any other language."

False. Not all languages are created equal, and PHP is on the shittier end of the spectrum.

Re:PHP introduces "goto" by ars on Tuesday June 09, 2009 @04:50PM (#649961)
Really? So back up the statement - tell me exactly what's bad about PHP.

And as I said before, it's a loosely typed procedural language, so don't try to compare it to a functional one. Within that type of language, what's bad about PHP?

Re:PHP introduces "goto" by encoderer on Tuesday June 09, 2009 @07:02PM (#650181)
I like PHP just fine and use it often. But if you really want an answer to that question, I'll give you one: inconsistency. Not saying I don't understand it, and I'm not saying I blame the way PHP has evolved. But it does have a lot of inconsistency.
Re:PHP introduces "goto" by holygoat on Tuesday June 09, 2009 @08:55PM (#650322)
Are you aware that your challenge is rapidly approaching "without reference to anything better, tell me about PHP's failings"?

The usual technique for evaluating something is to compare it to its competitors, and some of those are functional!

One of the bad things about PHP is that it lacks the higher-order capabilities of most functional languages. It's also inconsistent, easy to write slow code in, makes it easy to introduce massive vulnerabilities, and ugly.

It's 2009. Nobody should be using PHP any more.

Re:PHP introduces "goto" by ars on Tuesday June 09, 2009 @09:34PM (#650374)
PHP is not a functional language. People like functional languages in theory, for the style. But not so much when it comes to actually using them.

And what's ugly about PHP? It looks almost exactly like C.

It is inconsistent (sometimes), but it's not "easy to write slow code in", there is nothing in PHP that makes slow code more or less likely.

It's 2009. Everyone IS using PHP, and almost no one uses functional languages. Oh they get a lot of press, but few deployments.

I'm really tired of these illogical attacks on PHP. No one has ever told me a problem in PHP compared to other procedural languages except that 0 == "" is confusing.

It's always "but everyone knows it's bad". Sure go along with peer pressure if you like, but I prefer to look at reality.

Re:PHP introduces "goto" by prodigal_erik on Tuesday June 09, 2009 @11:22PM (#650499)
PHP has to look up variables by name at runtime, because it doesn't know which ones will really exist, much less their types. It doesn't know whether any array will be used as an ordered list or a lookup table, so it has to maintain a complex data structure for both. It has to allow any value to actually be a reference which shares state with any other value. These are very expensive features which preclude a lot of optimizations, yet they're rarely used because they're more often surprising than helpful. We ported an app server from PHP to Java and picked up a 6x speed improvement with hardly any tuning.

And 0 == "" isn't really confusing. You want confusing?

  array(0 => false, 1 => true) == array(false => "0", 1.9 => " 0")
The real problem with PHP is there's no simple way to stop it from guessing what you might have wanted when it's utterly wrong.
Re:PHP introduces "goto" by paulgb on Tuesday June 09, 2009 @10:08PM (#650408)
People like functional languages in theory, for the style. But not so much when it comes to actually using them.

Really? I use the functional capabilities of Python and JavaScript all the time when I use those languages.

Re:PHP introduces "goto" by sayhello on Tuesday June 09, 2009 @09:33PM (#650372)
What's bad about PHP is choice.

There are so many languages that use a more elegant syntax, reducing the time (and pain) it takes to prevent and find errors, and add functionality.

Given that there can be both well and badly written PHP, other good language choices in general have a consistent and/or clear choice as it comes to syntax (and less keywords to memorize).

Some choices of dynamic, loosely typed languages are:

Ruby, while perl-inspired provides some very pleasant syntax.

While Python is less pretty, there is generally one good way of doing things. Python code is also often consistent across developers, even if its at a mostly superficial level.

PHP is probably more pleasant to work with than ASP/VBScript, but in 2009, with other choices, if you don't have to use PHP and don't mind trying something new, why don't you?

Re:PHP introduces "goto" by Jebdm on Saturday June 13, 2009 @04:57PM (#656480)
I agree, but for the record syntax choice is pretty arbitrary; I find Python quite nice to look at, while Ruby looks like a kludge.