Live data from Hacker News

Announcing a specification for PHP

hhvm.com

101–110 of 263 posts

Re: Announcing a specification for PHP

#101

What's it been, 20 years?

If you read the article you would have known this. It is literally the first three sentences they cover this.

Too subtle, I guess. I was responding to the facts of the first sentence: More than twenty years without a spec.

Why yes, that does remind me why I chose other languages.

Re: Announcing a specification for PHP

#102
post #7

Earlier quoted context omitted.

There are languages that everybody hates, and then there are the languages nobody uses.

There are languages whose communities everybody hates, but it doesn't seem to be that everybody hates Ruby or Clojure or whatever. Just that everybody hates their trendiness.

I haven't found the Clojure haters yet but I can find a Ruby hater without looking too hard.

Re: Announcing a specification for PHP

#103
post #23

After recently having to work with modern PHP, I have to say a lot of the criticism of the language is unfounded. It's changed a lot since I first used it. But the stdlib is still hard to manage. Different naming conventions, different order on the parameters for functions that do almost the same thing, and every function is global. Couldn't they keep all that for backwards compatibility, but create more sane wrapper…

> It's changed a lot since I first used it. Have any good examples? I haven't used the language in years, would love to see what "modern" PHP looks like. (Seriously, not trolling at all)

The Laravel framework[1] is a good place to start, it's quite well designed and elegent. It requires at least PHP 5.4.

[1] http://laravel.com/

Re: Announcing a specification for PHP

#104
post #34

This is great news for the PHP community, and I for one applaud their effort. Contrary to what many HN hipsters seems to believe, PHP is quite a capable language, and HHVM / Hack is really pushing things forward. * Hack introduces type hinting, imo the major lacking part in PHP. * HHVM introduces speed to php. On a personal project calculating perlin noise, I got about 8x speedup on HHVM. * The specification helps pa…

> Contrary to what many HN hipsters seems to believe, PHP is quite a capable language, and HHVM / Hack is really pushing things forward. This attitude really frustrates me. I'm a developer with over 20 years of experience. I don't use PHP because (a) I have had poor experiences with it in the past, (b) I am enjoying my current stack (Java8/Clojure/Groovy), and (c) would go with stacks like RoR over PHP if I had to ch…

Agree. PHP started itself out with the handicap of a lot of shitty misfeatures, and now that they've beaten it into a state that it's possible (though in no way encouraged) to write decent code in it, anybody who doesn't put on a "PHP: It's not that bad!" party hat gets called a hater.

I'm afraid they're going to have to show me reasons it's actually superior to other languages before I'm going to jump on the train. This "it's less broken than it's ever been" stuff isn't going to cut it.

One thing that makes me chuckle every time I decide to give PHP a fair glance again is "<?php" at the beginning of all the source files. It's hilarious to me that with all the well understood best practices about separation of logic and presentation, people are still seriously using a language where you have to use a little signal to the compiler that means "ok, here's where the HTML stops and the code begins!" I assume at this point it's a vestigial tail, but it's just one irritating reminder that this language was originally designed for half-ass hacks.

Re: Announcing a specification for PHP

#105
post #92

Earlier quoted context omitted.

There are many other options, none of which enjoy the ubiquity of PHP (as far as being installed on such a vast majority of hosts). The barrier to entry is higher if you want to run a site on something else. That is the sole reason PHP is as popular as it is and part of the reason why it stays popular and powers so many of the internet's top websites. Other reasons why it stays popular is that they really have improv…

> none of which enjoy the ubiquity of PHP (as far as being installed on such a vast majority of hosts). So, choose the language based on the ease of the first 15 minutes of your startup?

I think that depends on whether an individual can get past that first 15 minutes. Me, I can have a virtual host running anything I want in a couple of minutes. You too, I'm sure. But for people who aren't pros, just getting something hosted can be a major battle. Not as major as when PHP got its start, but it's still too hard.

That's the lesson I'd love to see other ecosystems learn. PHP, by being very novice-friendly, has developed an enormous user base. How much better off would those people be if they had started with a language that was awesome not just for starting, but for the long term?

(As an aside, I'm throwing no stones here. My first programming language was BASIC, and it took me a long time to unlearn the bad habits it gave me.)

Re: Announcing a specification for PHP

#106
post #87

Earlier quoted context omitted.

To be fair, all languages are "a bit quirky". It gets worse when you start including things that are in the PHP stdlib but aren't in other languages by default. [e.g. When they basically re-implement how php-fpm handles requests and thread safety]

>>> To be fair, all languages are "a bit quirky". Agreed. These are just a few quirks in PHP I find amusing.

I'm sure you've already seen this (it's been around a while), but if not, you'll find it amusing:

http://www.phpwtf.org/

Last I checked, it wasn't quite as good as wtfjs, but it looks like quite a few new surprises have been added rather recently.

Edit: Correction, there's only one new entry as of this year, which is a shame. :)

Re: Announcing a specification for PHP

#107
post #92

Earlier quoted context omitted.

There are many other options, none of which enjoy the ubiquity of PHP (as far as being installed on such a vast majority of hosts). The barrier to entry is higher if you want to run a site on something else. That is the sole reason PHP is as popular as it is and part of the reason why it stays popular and powers so many of the internet's top websites. Other reasons why it stays popular is that they really have improv…

> none of which enjoy the ubiquity of PHP (as far as being installed on such a vast majority of hosts). So, choose the language based on the ease of the first 15 minutes of your startup?

I'm talking about people who need websites in general. Not your fancy startup. Also please name me a single startup that for some reason could not flourish using PHP as opposed to some other language?

It's really more about the talent of your team than the language you choose to write your app(s) in.

Re: Announcing a specification for PHP

#108

Earlier quoted context omitted.

> It's changed a lot since I first used it. Have any good examples? I haven't used the language in years, would love to see what "modern" PHP looks like. (Seriously, not trolling at all)

The Laravel framework[1] is a good place to start, it's quite well designed and elegent. It requires at least PHP 5.4. [1] http://laravel.com/

Laravel alone was enough to bring me back to PHP. It seriously has made PHP exciting again (I come from a Codeigniter and Zend background). It takes all of the things people love about Ruby on Rails and brings them to a PHP framework utilising modern features like traits alongside the fantastic selection of packages like Cashier. The even more surprising aspect of Laravel isn't how great it is, but rather the fact it was built by one guy... Other frameworks like Zend, Symfony, Codeigniter were built by teams. Of course, Laravel has contributors nowadays being an open source project, but in the early days it was mostly Taylor taking the reigns.

Re: Announcing a specification for PHP

#109
post #79
post #23

After recently having to work with modern PHP, I have to say a lot of the criticism of the language is unfounded. It's changed a lot since I first used it. But the stdlib is still hard to manage. Different naming conventions, different order on the parameters for functions that do almost the same thing, and every function is global. Couldn't they keep all that for backwards compatibility, but create more sane wrapper…

Fun with PHP: $a = 'b'; $b = 'a'; echo $a."\n"; >>> b echo $$a."\n"; >>> a echo $$$a."\n"; >>> b Yaaa $obj = new StdClass(); $obj->x = 1; function x_plus_one($obj) { $obj->x++; } x_plus_one($obj); var_dump($obj); >>> object(stdClass)#1 (1) { >>> ["x"]=> >>> int(2) >>> } Huh? A local change to the object changed the object outside the local scope? It must have been passed by reference... function null_the_object($obj)…

Got any counterexamples? What well-known OO languages don't work like this?

Re: Announcing a specification for PHP

#110
post #87

Earlier quoted context omitted.

>>> To be fair, all languages are "a bit quirky". Agreed. These are just a few quirks in PHP I find amusing.

I'm sure you've already seen this (it's been around a while), but if not, you'll find it amusing: http://www.phpwtf.org/ Last I checked, it wasn't quite as good as wtfjs, but it looks like quite a few new surprises have been added rather recently. Edit: Correction, there's only one new entry as of this year, which is a shame. :)

The first two I read aren't even WTF the worthy and are perfectly reasonable. Even in the classic fractal of bad design article, only 1/3 of it is actually valid.
Post reply on HN