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.
25 Years of PHP
221–230 of 426 posts
Re: 25 Years of PHP
#222Earlier 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?
Re: 25 Years of PHP
#223At 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
#224Earlier 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…
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
#225Earlier 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.
Moved the examples to a gist due to HN formatting:
https://gist.github.com/wjessop/0923e0667d7dd53ae0503459894e...
Re: 25 Years of PHP
#226Earlier 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.
- 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
#227Earlier 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++.
And in what way is it actually less verbose? It's almost identical to Java...
Re: 25 Years of PHP
#228I 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…
Re: 25 Years of PHP
#229Earlier 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.
Re: 25 Years of PHP
#230Earlier 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.
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.