Live data from Hacker News

25 Years of PHP

jetbrains.com

231–240 of 426 posts

Re: 25 Years of PHP

#231

Earlier quoted context omitted.

composer is so slow tbh. It takes ages to download package and well requires me to setup swap even when i have 4 gb ram in server.

Have you used prestissimo? It allows parallel downloads and makes the process much much faster. https://github.com/hirak/prestissimo

I'm not sure how it compares, but an alpha for Composer 2.0 was released last week[1] and the release notes seem to imply that it runs in parallel by default now.

> Added support for parallel downloads of package metadata and zip files, this requires that the curl extension is present and we thus strongly recommend enabling curl

1: https://github.com/composer/composer/releases/tag/2.0.0-alph...

Re: 25 Years of PHP

#232
post #228

Earlier quoted context omitted.

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.

> I don't want to use PHP at all. I don't like dynamic languages.

Okay, so don't? I think individual languages are better when they don't add every feature under the sun that happens to be popular in the moment. PHP doesn't need threads and it sure as hell doesn't need async. PHP multiprocessing works the old way just fine (fork).

> Today's "best practices" for PHP are to use typehints everywhere.

Yeah, and it's a result of people constantly bitching about PHP lacking features. It's really annoying because it gives credence to complaints like this, I really wish they would have just replied to the strict-types demands with "No, fuck off, this is a dynamic language."

If you must use PHP, I would strongly suggest you use it the way it was intended and stop trying to shoehorn other language features and paradigms into it, you will be much happier. If we simply treat PHP as a dynamically typed C, everything is so much easier.

Re: 25 Years of PHP

#233

Earlier quoted context omitted.

Just like I tell people that buy cordless drills at Harbor Freight, "sometimes it IS the tool". Does that mean you can't build fast, meaningful, cool things with it? Of course you can. But, the deeper you get, the more problems you'll have to solve with weird esoteric knowledge. I'll agree with all of your points on horribly inconsistent and broken language features. I get that people that have grown up with the lang…

I mean, who uses mysql_real_escape_string when you have PDO and bindings ? PHP isn’t perfect. As OP said, no language is, and any competent software engineer uses the parts of the language that work well for them, and just ignores the things that don’t work for them. I don’t believe for a second that the abuse the language has suffered over the years has anything to do with mysql_real_escape_string, it’s more to do w…

1981? The title of the article is "25 Years of PHP", which checks out because PHP appeared in 1995, and this is 2020, and 2020-1995=25, but 1981 was 39 years ago. The ARPANET was using NCP with 8 bit host IDs in 1981, and nobody was listening for the HTTP protocol on port 80 back then, and homosocketuality was still prohibited.

https://news.ycombinator.com/item?id=14178993

>The act of trying to connect an even socket to another even socket, or an odd socket to another odd socket, was considered a "peculiar error" called "homosocketuality", which was strictly forbidden by internet protocols, and mandatory "heterosocketuality" was called the "Anita Bryant feature" [2].

https://www.saildart.org/allow/IMPSER.DOC%5bSS,SYS%5d

>Illegal gender in RFC, host hhh/iii, link 0

>The host is trying to engage us in homosocketuality. Since this is against the laws of God and ARPA, we naturally refuse to consent to it.

Re: 25 Years of PHP

#234
post #73

Earlier quoted context omitted.

Every time there's a story about PHP there's a comment like yours, and then in reply there's a comment like mine: Yes it's perfectly fine to use PHP if it's a productive environment for you. Of course it's possible to write good software with it. Of course a skilled developer will manage to do great things with sub-standard tools. Many extremely popular websites were and even still are powered by PHP, that's undeniab…

> This revisionist stance that there was never anything really wrong with PHP This strikes me as a strawman. PHP spent years being a generally loathed language for reasons that at this point aren't really worth reiterating. But, in an analog to Javascript, it has made progress, grown up and become a better language. One of the best? Like Javascript, no. But serviceable at worst. I stopped earnest work in PHP ~ 5.7. I…

Javascript has made progress too. While far from perfect and I think PHP's journey started at a worse point has has gone further JS certainly is a lot better now and the major failings of JS are of it's ecosystem and not the language itself.

I also think that both JS and PHP get a lot of flak for maintaining backwards compat as far back as they do. You can run a lot of webapps (frontend and backend) from 10-20 years back in modern PHP and browsers which is pretty amazing. I'd like them to have a modern mode (like the proposed p++/<?php2020 and modules for JS) we should still acknowledge that maintaining compat that far back is not easy.

Re: 25 Years of PHP

#236
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…

The "annotation syntax" is becoming a language feature with PHP8 attributes.

Re: 25 Years of PHP

#237

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.

Not just moving the goalposts, but actually programming PHP 14 years before it first appeared in 1995, and putting database-driven websites on the web 8 years before it was invented in 1989.

His post here is arguing about 1981, actually.

>I’ll admit to a soft spot for PHP - I was putting database-driven websites on the web when that wasn’t much of a thing (back in 1981, if foggy memory recalls true). I wrote the asset management system that was used by Lucasfilm on Star Wars, by Manix on the Matrix, by various post-production houses in Soho, etc. etc. - all in PHP. We had video-streaming from remote locations before RealNetworks were mainstream. All because of PHP.

Re: 25 Years of PHP

#238
post #115

Rasmus Lerdorf look at the last 25 years of PHP: https://www.youtube.com/watch?v=wCZ5TJCBWM Really interesting for anyone wondering what the thinking was behind function naming and other inconsistencies jump to: https://youtu.be/wCZ5TJCBWMg?t=987 and https://youtu.be/wCZ5TJCBWMg?t=1466

If I look from outside - it looks like there was exactly 0 thinking involved in function naming.

Re: 25 Years of PHP

#239

Earlier quoted context omitted.

What's wrong with using session variables for maintaining state?

Session variables are tied to user sessions (like name suggests), so they cannot be used to persist application state (e.g. cached content, compiled templates, metrics, etc.)

Exactly.

I see downvotes on my GP post, I'm simply stating the fact: if you need state for a building a powerful webapp then obviously there's better runtimes that PHP+Apache, I don't see how one could disagree with that statement, apart from not having sufficient experience in that matter.

There's plenty of good reasons to counterbalance that fact thought, PHP has a very good ecosystem, multiple mature/powerful web frameworks, and cheap/abundant workforce. But it lacks a state holding runtime and for the most demanding applications it's a sufficiently big technical hassle to encourage seeking other runtime and/or language.

Re: 25 Years of PHP

#240

Earlier quoted context omitted.

I mean, who uses mysql_real_escape_string when you have PDO and bindings ? PHP isn’t perfect. As OP said, no language is, and any competent software engineer uses the parts of the language that work well for them, and just ignores the things that don’t work for them. I don’t believe for a second that the abuse the language has suffered over the years has anything to do with mysql_real_escape_string, it’s more to do w…

1981? The title of the article is "25 Years of PHP", which checks out because PHP appeared in 1995, and this is 2020, and 2020-1995=25, but 1981 was 39 years ago. The ARPANET was using NCP with 8 bit host IDs in 1981, and nobody was listening for the HTTP protocol on port 80 back then, and homosocketuality was still prohibited. https://news.ycombinator.com/item?id=14178993 >The act of trying to connect an even socket…

Yup. My bad.

I started trying to figure out when it was by when I was at college, how long I did the PhD for, how long I was in the first job, how long into the second job I started using it and I screwed up the maths along the way. It was in 1996, not 1981... No excuses, that's just bad.

Post reply on HN