Live data from Hacker News

25 Years of PHP

jetbrains.com

221–230 of 426 posts

Re: 25 Years of PHP

#221

Earlier quoted context omitted.

> PHP, on the other hand, is basically just worse-Java It’s much more like C than Java. And Java was in its infancy when PHP came out so it makes sense that it’s inspired more by C than Java.

Incorrect. Old PHP was more like C. If you see a modern, best practices, PHP code base today, it reads like Java 7 did in 2011.

PHP is way less verbose. I wouldn't say it really looks like Java, maybe more like C++.

Re: 25 Years of PHP

#222
post #161

Earlier quoted context omitted.

Whats old is new again. Laravel et al read like java. Nobody wants that crap anymore. Everyones moving codebases back to more procedural styles with a good dose of functional leanings towards immutable values.

Which is basically impossible to do in PHP. How do you make a deep copy of an input argument to avoid mutating it? How do you do a map+(filter|reduce)(+array_values) on an array without looping over it THREE times?

You’ve convinced me never to use PHP if I can help it

Re: 25 Years of PHP

#223
I gotta say... PHP has grown so much and growing further in the right direction (with union types and async I/O).

At the speed of its improvements... it's kind of embarrassing other dynamic languages (I am looking at you Python, even though you are one of my favorites).

Re: 25 Years of PHP

#224

Earlier quoted context omitted.

You're using the two super-fallacious arguments I refer to in my original reply: 1. You can write bad code in any language. 2. All languages have warts. My response to #1: Here is a rock. Please use it, with some nails, to hang a bunch of pictures on your walls. Don't complain about your tool because it's entirely possible to use it successfully at this task. Or, less sarcastically, why use a tool that encourages bad…

Not really. As I thought I'd alluded to in the above, when I was using PHP "in anger" as it were, there were 3 options for dynamic content: 1) Write a C program, and use the GCI-BIN interface. In developmental terms, this sucked dead bunnies through thin straws 2) Use some god-awful server-side script thing, updating static files with externally-invoked changes. Yes, people resorted to this. 3) Use PHP/FI. Life is no…

You're moving the goalposts. PHP was a great option in 1995. It is not today (except as a basic scripting language, where you and I agree completely. I would use PHP as soon as my bash script gets to about 100 lines).

Your post here is arguing about 1995 or whatever. The post I replied to was full of present-tense about "just use the good parts" and "all languages have issues", etc.

Re: 25 Years of PHP

#225
post #163

Earlier quoted context omitted.

> I mean your proof is I seen PHP code then conclusion is PHP is bad. You're over simplifying my point to make yours. I have seen bad PHP code. I have seen bad Go code. I have seen bad code in many languages. The proportion of bad PHP code however, is higher in PHP, for the reasons I've stated around edge cases and the difficulty in reasoning. > You are trying to compare PHP with Go, probably Go is better then PHP, b…

Link me to those edge cases please, I did not hit that many so I should be prepared. Thanks.

Here's some that are utterly trivial to find. There are plenty more. Feel free, as a supposedly competent PHP programmer, to go and find the rest, becayse you definitely need to know about them to be able to write code that's going to work properly.

Moved the examples to a gist due to HN formatting:

https://gist.github.com/wjessop/0923e0667d7dd53ae0503459894e...

Re: 25 Years of PHP

#226
post #34

Earlier quoted context omitted.

The point of calling a "fractal" and talking about the "design" is that while you can only look at the surface in an article of reasonable length, it points toward strutural and systemic failings within the language itself. The problem is that PHP is built on bad foundations and while many of the superficial problems can be mitigated, the underlying foundations can't be fixed without breaking changes. (Or, as Python…

yet you don't see articles about how bad python is, it still receive lot of praises and much love. This is telling a lot about how fair are some comments about PHP.

Python received much of its latest praise from introductory level college students that haven't done much programming other than "import numpy". I've used python and sure i like it better than other "bad languages" but when you look around in the real world you see that it's not the best or the most popular choice.

- cloud/ops space has moved to Go

- Java/C# are overall better languages and more productive environments than python for large scale services.

- A million websites still use php and the community is thriving. Billion-dollar companies use ruby to transact billions of dollars (stripe,shopify).

- Js is eating the world

Python found its niche in AI/ML space and sure is a great language but that's it?

Re: 25 Years of PHP

#227

Earlier quoted context omitted.

Incorrect. Old PHP was more like C. If you see a modern, best practices, PHP code base today, it reads like Java 7 did in 2011.

PHP is way less verbose. I wouldn't say it really looks like Java, maybe more like C++.

Stop looking at the syntax, then. PHP semantics almost completely match Java's- single inheritance, no const, everything is a reference, effectively no top-level functions, etc.

And in what way is it actually less verbose? It's almost identical to Java...

Re: 25 Years of PHP

#228
post #32

I wrote a lot of PHP from 1999-2008. First as a hobby, then professionally. From 20 LOC guestbooks to payment gateways used to process millions in payments. It wasn't until recently that I was sure I'd written more code in any other language than PHP. These days I'll occasionally poke around with it or patch a bug, but that's about it. Is it a perfect language? No. But which language is? (I can hear the Lisp crowd gr…

While I agree that PHP does have pros as well as cons, I find it disconcerting that I've read MANY assertions here on HN, that PHP detractors just haven't used it very much or are mostly complaining about things like bad standard library function names. I've used PHP in earnest. It and JavaScript are tied for worst programming languages I've used. JavaScript gets more of a "pass" from me because I'm just not a dynami…

People who demand a dynamic language needs to add strict typing and once it does, demand that it now add generics need to stay the fuck away from dynamic languages.

Re: 25 Years of PHP

#229

Earlier quoted context omitted.

Not really. As I thought I'd alluded to in the above, when I was using PHP "in anger" as it were, there were 3 options for dynamic content: 1) Write a C program, and use the GCI-BIN interface. In developmental terms, this sucked dead bunnies through thin straws 2) Use some god-awful server-side script thing, updating static files with externally-invoked changes. Yes, people resorted to this. 3) Use PHP/FI. Life is no…

You're moving the goalposts. PHP was a great option in 1995. It is not today (except as a basic scripting language, where you and I agree completely. I would use PHP as soon as my bash script gets to about 100 lines). Your post here is arguing about 1995 or whatever. The post I replied to was full of present-tense about "just use the good parts" and "all languages have issues", etc.

That's ... fair comment. My apologies, I have a bad habit of not clicking on parent to see what the context of a post is.

Re: 25 Years of PHP

#230
post #228

Earlier quoted context omitted.

While I agree that PHP does have pros as well as cons, I find it disconcerting that I've read MANY assertions here on HN, that PHP detractors just haven't used it very much or are mostly complaining about things like bad standard library function names. I've used PHP in earnest. It and JavaScript are tied for worst programming languages I've used. JavaScript gets more of a "pass" from me because I'm just not a dynami…

People who demand a dynamic language needs to add strict typing and once it does, demand that it now add generics need to stay the fuck away from dynamic languages.

For sure. But let's be clear- I'm not "demanding" anything. I don't want PHP to change, I don't want to use PHP at all. I don't like dynamic languages.

BUT. Today's "best practices" for PHP are to use typehints everywhere. And there are language changes in the works to add MORE typing to PHP.

Post reply on HN