Live data from Hacker News

PHP needs to die. What will replace it?

seldo.com

101–110 of 160 posts

Re: PHP needs to die. What will replace it?

#101
post #99
post #84

Earlier quoted context omitted.

No, I'm saying that the stuff built into PHP is weird and inconsistent. I should change it to "sane default library" from "sane API". My current favorite example of this (ignoring the naming scheme for string functions entirely) is that in_array and strpos are functions that perform (almost) the same task, on two different types. They take their arguments in the opposite order. strpos($haystack, $needle) vs in_array(…

> No, I'm saying that the stuff built into PHP is weird and inconsistent. You never asked yourself WHY. See, that's the important question, isn't it. WHY. I'll tell you WHY. Because two different dudes implemented it. At different times. Probably, from different continents. They didn't notice it at the time. But, eventually, someone noticed it. And then they did something really crazy. They didn't fix it. Because tha…

You're ascribing things to me that aren't present in the text.

I had a pretty good idea why that's how it is. I even completely agree with not changing it now. Backwards compatibility is important, no argument there.

That doesn't change that it's the sort of niggling annoyance that drives people to dislike the language.

Re: PHP needs to die. What will replace it?

#103

PHP is a nightmare, but only once you learn enough about programming or development to understand what you should really be doing, and only once you've seen how other languages do it. After that comes PHP's special flavour of OOP. I'd prefer to call it 'Do Whatever The Fuck You Like Orientated Programming' given the abundance of 'magic methods' and other functions that try really hard to make sure you've got a cheeky…

> It's so loose and care-free that it doesn't care what you do or how you do it.

This is precisely why I fell in love with PHP. My first was BASIC, my second was C, my third was Java, but my fourth ... oh god ... like that slutty girl who will let you do absolutely anything. How can you not fall in love with that?

Re: PHP needs to die. What will replace it?

#104
post #91
post #77

Earlier quoted context omitted.

Yeah, exactly. This headline could have been written with the same justification in 1999. Yet PHP refuses to die. Clearly us hackers are missing something important.

Having not used php for 12 years, I recently accepted a freelance job for a client who had been left in the lurch by his php developer who seemingly abandoned the project because she was out of her depth. I have to say that I was pleasantly surprised by some of the new language features that php has borrowed from elsewhere... eg: closures, anonymous functions, docstrings. IMHO php is held back primarily by messy, inc…

Note that python3 still doesn't have widespread adoption, because there are still widely used libraries lacking support for it.

Re: PHP needs to die. What will replace it?

#105
post #97
post #82

Earlier quoted context omitted.

Perl hashes don't preserve order. PHP's almost always do. i.e., the order you insert keys is the order in which you will receive them back when you iterate over the array. It's similar to a LinkedHashMap in Java. CS types might recoil at the mixture of behaviors that are baked into PHP's workhorse data structure, but most of them turn out to be quite useful. (And it makes it easier for the beginner programmer to deci…

There is CPAN for that. (iirc, this is solved with a module in the Perl Cookbook. I don't have that book where I am writing this.) Edit: For a beginner that wants a Visual Basic for web, sure. By now I have different needs, to enjoy using my tools. (And for the record, if I need to keep order of a hash/dict/etc in some language, I generally use a "traditional" array in addition. That is probably too complex for a beg…

Exactly, it's not a native part of the language, which reinforces my point that the beginner doesn't need to think as much about data structures with PHP. The built-in array() usually can handle the task well enough. They never are left muttering "this would be perfect for a linked hashmap but where is my drat PHP cookbook?"

Re: PHP needs to die. What will replace it?

#106

The article states that php doesn't have lambdas and method chaining, although it does. They aren't well done, as per usual, but it definitely has them. Honestly, we may be best off doing a CoffeeScript style pre-processor for PHP. Because PHP isn't going anywhere, no mattter how much we may prefer other languages, PHP's popularity is one of pure pragmatism, something the language purists don't seem to understand. Ge…

Get me from 0 to "Hello, World" as fast as you can. That's how you build the next PHP. I understand why that is, but I can't help but think that it's optimizing for an edge case instead of the whole operation. I'm willing to invest a little bit longer to get to "Hello World" on day one if it means a lot less pain for every day to follow.

A useful criticism, but in this case I don't think it's optimizing for an edge case. There's a power law, or something close to it, when it comes to web developer skill. PHP is so dominant because it requires very little skill to get started, and very little skill to incrementally advance from there.

Other technologies can try to push on the "PHP problem" from above, and they can make a lot of progress, but they won't ever "win" because the inertia of PHP is coming from below. The only way to fully get rid of PHP is to beat it on its home turf, and that's firmly in the "Hello World" realm.

Re: PHP needs to die. What will replace it?

#108
Technologies might "need to die" on blogs, but in the real world they get replaced with better alternatives - once these emerge. Want to replace PHP with your favorite solution X? Write a better Wordpress, Drupal, vBulletin or even PhpMySQL alternative in X.

It's incredible to me how the fantastically talented X rockstar ninjas can't produce a better replacement for, say, Wordpress given how much technology and our general understanding of building web apps have improved since 2003. Less blogging, more coding.

Re: PHP needs to die. What will replace it?

#110
post #104
post #91

Earlier quoted context omitted.

Having not used php for 12 years, I recently accepted a freelance job for a client who had been left in the lurch by his php developer who seemingly abandoned the project because she was out of her depth. I have to say that I was pleasantly surprised by some of the new language features that php has borrowed from elsewhere... eg: closures, anonymous functions, docstrings. IMHO php is held back primarily by messy, inc…

Note that python3 still doesn't have widespread adoption, because there are still widely used libraries lacking support for it.

But in the coming future it will. All major libraries and frameworks are going to port over to python 3.

But we are missing the point here. PHP could need a cleanup from the ground up even if they have to break a lot of stuff this could help the language to evolve.

Post reply on HN