Live data from Hacker News

PHP is much better than what you think

fabien.potencier.org

221–230 of 346 posts

Re: PHP is much better than what you think

#221

Earlier quoted context omitted.

If I plot two lines on a graph for you: y1 = 0.02x + 1 y2 = 0.10x + 0.5 Regardless of the fact that y2 started at 0.5, fully half of what y1 started at, at some point y2 overtakes y1. It's impotent to whine endlessly that a language used to be bad. So PHP 5 years ago was terrible. PHP today is 'nearly as good' as Python (I'd argue it's better). In 5 years PHP is going to blow Python out of the water. These languages…

I think your graph is accurate when it comes to the amount of effort put into polishing each language -- but as to actual quality, I'd firstly say y=1 is the goal (the language is basically complete; you can add more around the edges, but the core is solid and needs no more changes), and it doesn't account for the fact that with a constant large amount of effort as input, progress as output slows down exponentially d…

> I'd firstly say y=1 is the goal (the language is basically complete; you can add more around the edges,

Not your functions, not your plane, you don't get to define parameters.

> starting off awful and rapidly turning into a giant blob of band-aids :P

PHP has been completely rewritten at least twice.

> everything else is more productive after the initial setup hurdle~

Can you give a single example of something in Python that introduces greater productivity than PHP?

> and in all three cases other languages have done them better

> so I'm not sure why PHP having them since 2005 is supposed to be a good sign...

Now you're just being a pedant. The point is that it isn't 2005 and it's not 1978. It's 2012. Talking about what the capabilities of a language were almost a decade ago is useless.

Re: PHP is much better than what you think

#222
post #109
post #12

I'd stay away from a language that has function names like array_keys or allows you to write array("a" => "green", "red", "blue");

What's wrong with array_keys? It's extremely useful. Java has keySet(), Ruby has hash.keys, etc. Your second argument is even dumber. Yes, PHP lets you do lots of things, which improve the speed of development. If you don't like it, don't write it that way.

I wouldn't pick on the example, but you've made me curious: how does it improve the speed of development to have array("a" => "green", "red", "blue") ?

Re: PHP is much better than what you think

#223
post #133

Funny. People criticize PHP the language and the PHP fanboys retort by praising PHP the platform. Jeff Atwood more or less said that we should provide the platform advantages of PHP in other languages in order to steer new developers there.

You can't provide the platform advantages of PHP in other languages because either there aren't enough programmers in that language (Ruby, Python) or that language is fundamentally much more difficult to work with (Java).

There are plenty of people writing Ruby and Python.

There is another reason, which is that some of PHP's design choices seem easy but make things harder down the line.

Re: PHP is much better than what you think

#224
post #201

Earlier quoted context omitted.

I suspect that parent was referring to the python 2.x branch, which has been catching up with ruby 1.9, but on most benchmarks started at ~ 3x slower and are now ~ 2x slower. Since benchmarks are completely worthless, let's just stop this pissing match right now.

> I suspect that parent was referring to the python 2.x branch, which has been catching up with ruby 1.9, but on most benchmarks started at ~ 3x slower and are now ~ 2x slower. Citation needed again. Ruby 1.9 is slower than Python 3, and Python 3 is slower or as fast as Python 2 on Python official benchmarks. http://docs.python.org/release/3.0.1/whatsnew/3.0.html#perfo... > Since benchmarks are completely worthless,…

Fib(36)

Python 2.7.2

    def fib(n):
        if n == 0 or n == 1:
           return n
        else:
           return fib(n-1) + fib(n-2)
     
     for i in range(36):
         print "n=%d => %d" % (i, fib(i))'
python -c 20.69s user 0.06s system 99% cpu 20.807 total

Ruby 1.9.3 def fib(n) if n == 0 || n == 1 n else fib(n-1) + fib(n-2) end end

    36.times do |i|
      puts "n=#{i} => #{fib(i)}"
    end
ruby 11.44s user 0.03s system 99% cpu 11.507 total

I guess since benchmarks are not completely worthless, we should conclude that ubuntu doesn't keep up on ruby and uses 2-3 year old versions.

I wasn't accusing you of starting the pissing match.

Re: PHP is much better than what you think

#225
post #194

Earlier quoted context omitted.

It's the opening of an SGML process instruction tag. That's why PHP code is inherently embedded in SGML documents...... That's why the LedgerSMB project uses Template Toolkit with tags (that and [% %] causes problems in LaTeX).

You seem to think you have some understanding of PHP which you blatantly do not. You've made a nonsense assumption based on the choice of tag used by PHP to tell the interpretor to treat the text following the tag as code and not to direct it back out the SAPI.

Ummm... I think you are missing my point.

That's an SGML document. It doesn't matter where the PI tag is, or what is in it, it's an SGML document.

'

fun stuff here

'

?>

That's still an SGML document.

# logic goes here

?>

That's an SGML document.

This is not splitting hairs. The reason is relatively subtle.... When you are doing SGML stuff an extra newline or a space in front of the opening tag really doesn't have any effect but if you do any output in binary form, it's a mess.

Re: PHP is much better than what you think

#226

Earlier quoted context omitted.

You can write that code in almost any language and it will look bad and be hard to mentally parse.

That might be true, but it's a lot easier to do in PHP than Python for example

I looked at rosetta code - they both look pretty similar in clarity. Compare to JavaScript or R, which are much more legible.

Re: PHP is much better than what you think

#227
post #194

Earlier quoted context omitted.

You seem to think you have some understanding of PHP which you blatantly do not. You've made a nonsense assumption based on the choice of tag used by PHP to tell the interpretor to treat the text following the tag as code and not to direct it back out the SAPI.

Ummm... I think you are missing my point. That's an SGML document. It doesn't matter where the PI tag is, or what is in it, it's an SGML document. ' fun stuff here ' ?> That's still an SGML document. # logic goes here ?> That's an SGML document. This is not splitting hairs. The reason is relatively subtle.... When you are doing SGML stuff an extra newline or a space in front of the opening tag really doesn't have any…

You are making little to no sense. Sorry, but I've got to give up on this thread.

Re: PHP is much better than what you think

#228
post #182

Earlier quoted context omitted.

What's so horrible about CakePHP?

Its legacy (who wants to still support PHP4?). AFAIK, it's no longer maintained; I believe all the core development is now taking place on the Lithium project: http://lithify.me/

None of these things are true, I don't know where anyone comes up with this stuff. Sounds like a smear job more than anything. CakePHP2 is PHP 5.2.8+[1]. It's still being maintained and 2.2 was released this week[2]. Lithium is not a real 'fork' from Cake - rather it is a project that two of the Cake devs were working on as a 'next gen CakePHP' but decided to make into a separate project - the two frameworks don't share any code in their 'production' releases. Lithium has a much smaller community and is still poorly documented (as far as I can tell having tried to use it for a project).

[1] http://book.cakephp.org/2.0/en/appendices/2-0-migration-guid...

[2] http://bakery.cakephp.org/articles/lorenzo/2012/07/01/cakeph...

Re: PHP is much better than what you think

#229
post #131
post #83

Earlier quoted context omitted.

Never heard of them.

You are deliberately trying to miss the point. But in the off chance that you don't really get it, the point is quora, asana were started by early facebook programmers, and they didn't use PHP. If they liked PHP so much, they would have used it. I can't find a citation, but there was a thread where a fb engineer claimed fb's internal PHP wiki starts with "There are two kind of people. People who hate PHP, and people…

> If they liked PHP so much, they would have used it.

Or they got tired of being bullied by people like you.

Re: PHP is much better than what you think

#230
post #211

Earlier quoted context omitted.

And I guess this guy doesn't either: http://news.ycombinator.com/item?id=4177516

He seems like he does. You might notice I never said no PHP apologist understands PHP, but rather contradicted your (frequently posted) lie that PHP detractors don't understand PHP. Of course, he doesn't offer an actual rebuttal to much, mainly just "well yeah it sucks, but I know it sucks so its ok".

In response your undefined edit: Can you point out my lies?
Post reply on HN