Live data from Hacker News

PHP needs a vision

news.php.net

131–140 of 182 posts

Re: PHP needs a vision

#131
post #32
post #22

Earlier quoted context omitted.

PHP has changed a lot over time. It moved from a C-style procedural language to very Java-esque object oriented language. "PHP" hasn't been "PHP" for a long time already. It's always hard to do large language changes, but it's not impossible. E.g. consider the change that PHP did from version 4 to 5. That was a pretty major paradigm shift, with lots of broken code, but it worked out well in the end :)

To me the OO features of PHP have always felt 'bolted on', yet Java is OO from-head-to-toes. It only emphasizes my point: unlike a startup, a programming language cannot pick/change vision when it is a grown-up.

Probably because they were in fact "bolted on". Saying that Java is OO from head to toes, I can't agree with. Java has primitive types as well, and not everything is a first class object (like methods). Python is more OO in that sense, for example. In a sense, Java is having trouble incorporating modern features in the language too. Just take a look at how generics are implemented, and the endless closure debate.

Re: PHP needs a vision

#132
post #60

Earlier quoted context omitted.

"PHP Should Be Implementation Neutral, and Support All Paradigms Equally". This is what I like about PHP. When you want a 4 page site, you can use procedural and functional programming. When you're working on an enterprise level CMS you can whip out the OO paradigm and you're set. PHP is a messy soup but it does web better than most other languages.

One nice side affect of this is that PHP can suit both novice and experienced programmers. Newbies don't have to learn OO before they write Hello World.

Yeah, and thanks to this, you end up with a "beast" like Magento, written by "experienced" programmers, and then you have novices tasked with writing themes and components for it, but it doesn't work that way because the "beast" is not "black boxed" well enough for the novices to ignore it. (I keep quoting "experienced" here because the example Magento is just "Java written in PHP" and I'd fire anyone turning up this type of code.)

Re: PHP needs a vision

#134
post #76
post #60

Earlier quoted context omitted.

"PHP Should Be Implementation Neutral, and Support All Paradigms Equally". This is what I like about PHP. When you want a 4 page site, you can use procedural and functional programming. When you're working on an enterprise level CMS you can whip out the OO paradigm and you're set. PHP is a messy soup but it does web better than most other languages.

No. No it doesn't. It does it easier . That's not the same thing.

When it comes to the web, lower barrier of entry is actually a value in itself.

Re: PHP needs a vision

#135
post #38

Some of the statements there such as this really disappoint me. "PHP is what people use to get their first site off the ground. PHP is what a web designer learns when he/she wants to go into programming. PHP is what a random Joe uses when he needs to whip up a page and he's in "do it yourself" mind." PHP is a great language in that its very flexible and quick to get going with, the sad thing is people don't want it t…

Facebook hates PHP, but it would be too expensive to convert their 3 million lines of code. They just use HipHop to compile it to C++.

They are actually phasing out the HPHPc translator and are now developing, as far as I can see, a more conventional one, which translates php into bytecode and can perform JIT on the bytecode into native code without going through C++.

Re: PHP needs a vision

#136

Earlier quoted context omitted.

The codebase of Wordpress is an utterly terrible, offensive, kludgy, hacked-together mess of spaghetti code. The last time I looked at the internals it still lacked a coherent MVC structure. There are big, good things built with PHP, written the right way with solid software engineering principles, but Wordpress is not one of them.

Yeah, it's very evident in the fact that no one uses it, too. PHP sucks.

If number of users was equivalent to quality you would be correct. But it isn't. Under your argument, Wal-Mart is a purveyor of family heirlooms.

Re: PHP needs a vision

#137
post #32

Earlier quoted context omitted.

To me the OO features of PHP have always felt 'bolted on', yet Java is OO from-head-to-toes. It only emphasizes my point: unlike a startup, a programming language cannot pick/change vision when it is a grown-up.

Probably because they were in fact "bolted on". Saying that Java is OO from head to toes, I can't agree with. Java has primitive types as well, and not everything is a first class object (like methods). Python is more OO in that sense, for example. In a sense, Java is having trouble incorporating modern features in the language too. Just take a look at how generics are implemented, and the endless closure debate.

Python? Try to subclass an int in Python, and see that it is not as OO as you think.

Ruby is more OO then Java for the reason you give, still there are primitives but they have a thick OO-coating so you are less likely to notice they are 'different'. Try subclassing a Fixnum -- it works! But Fixnums have no 'new'.

Re: PHP needs a vision

#138
post #49

Worthwhile reading the email that preceded it: http://news.php.net/php.internals/64763 The response hardly seems warranted. The vision is pretty stated there.

The response would seem warranted if you had been a participating member of the PHP internals list for any significant length of time. Stas is pretty well known for jumping into threads and completely derailing, and shooting things down with BS like "PHP is not Java, stop trying to make it into Java". The response is a culmination of a long time of watching him respond in such a fashion. Stuff like this: http://marc.…

Now I can understand the state of PHP...

Re: PHP needs a vision

#139
post #132

Earlier quoted context omitted.

One nice side affect of this is that PHP can suit both novice and experienced programmers. Newbies don't have to learn OO before they write Hello World.

Yeah, and thanks to this, you end up with a "beast" like Magento, written by "experienced" programmers, and then you have novices tasked with writing themes and components for it, but it doesn't work that way because the "beast" is not "black boxed" well enough for the novices to ignore it. (I keep quoting "experienced" here because the example Magento is just "Java written in PHP" and I'd fire anyone turning up this…

Having had the unfortunate experience to work with Magento recently, I completely agree with your evaluation. My reoccurring thoughts were exactly "this is Java written in PHP!".
Post reply on HN