Live data from Hacker News

25 Years of PHP

jetbrains.com

311–320 of 426 posts

Re: 25 Years of PHP

#311
post #76

Earlier quoted context omitted.

But Movable Type was written (mostly) in Perl... I'm not sure I see how Movable Type affects PHP all that much, but maybe I'm missing something.

Movable Type was popular, but a change in its licensing terms led to people leaving it in droves for Wordpress which had a similar interface and approach. Fast forward to 2020, and Wordpress installations reportedly make up the majority of PHP use in the world.

If I'm reading that correctly, the license change happened in 2013... Well after Wordpress was already highly established as the dominant player.

Re: 25 Years of PHP

#312

Earlier quoted context omitted.

Yeah, alright, I understand your example now but I would argue that it's more of a problem with actually using filenames as array keys than it is a problem with PHP. Even so, wouldn't you be able to ensure that it's a string by doing `$array[(string)$filename] = ...`? (Again, I don't think using filenames for array keys—in any language—is a good idea but we're theorycrafting here.)

Oh, come on, don't try to defend a PHP design flaw by blaming people who use perfectly valid file names, and people who do perfectly valid things like using file names as array keys. Can you actually refer me to a programming language style guide that says not to use file names as array keys, or are you just pulling that out of your ass -- I mean theorycrafting? I've got a great idea, inspired by mysql_real_escape_st…

[deleted]

Re: 25 Years of PHP

#313

Long time ago I was learning Perl, because at that time basically the whole Internet ran on Perl CGI scripts. I thought, "man, Perl is weird". Then I learnt PHP, because whole internet seemed to move to Apache+PHP. I thought, "man, that's Perl done right!". Then I actually learnt Perl, looked at my PHP code written earlier. I thought "WTF?" Now I use Python. I think "man, why I have to type this silly whitespace?"

> "man, why I have to type this silly whitespace?"

I assume it's a joke, but I often have people in my classroom that have been doing python for some times and that keep typing the whitespaces themselves instead of using an editor that does it for them.

But again, I've seen some coding without any syntax highlighting.

Now I never assume people know even the most obvious things.

Re: 25 Years of PHP

#314

Earlier quoted context omitted.

No public code uses echo, strlen, function_exists, is_array, count, or intval? I find this really hard to believe.

I'm trying to give you the benefit of the doubt here, but I'm really suspecting that I'm just falling for a troll. I'm talking about WRITING PHP code. You don't WRITE top level functions. Every data type you WRITE is a reference type. In C++, it is common to write top level functions in a namespace for others to use. In C++ you can write a class/struct and pass it to function BY VALUE. In Java and PHP you cannot pass…

So TLF's exist and get used constantly but people don't write them often in code you look at (they do in the code I look at), you don't have to use classes and lots of pages don't but frameworks tend to stick with them, there are global variables, the syntax looks a lot more like C but class semantics exist, therefore it's exactly like Java. Whatever, if that's how you see it I guess I can't stop you.

Re: 25 Years of PHP

#315
What I love about PHP is its learning curve. You can quickly start making things.

I started two decades ago with dirty PHP mixed with HTML pages, then I learned templating. Then I learned OOP, classes, interfaces, abstract classes, traits, managing dependencies and unit tests. All of these with PHP, no framework.

Because PHP is quite easy to use, I learned all these "general" principles thanks to it. I guess nostalgia plays a big part in my appreciation of this language but I will just say one thing: thank you PHP!

Re: 25 Years of PHP

#316
post #29

I started with PHP 15 years ago, but after 5 years I just moved to Java. The worst thing with PHP was people and standards, everything was a mess, there was no right way to do stuff and larger projects had like 100 different implementations for the same thing. PHP was really challenging to work with as coming to a shared agreement for how one should implement stuff was a recipe for personal conflicts. So after a few…

"When the world becomes standard, I will start caring about standards." — Rasmus Lerdorf

The fish rots from the head down.

Re: 25 Years of PHP

#318

If it's THAT bad.. why is it still around and under active development 25 years on ? Sure COBAL is also still around but the amount of new projects started in COBAL vs PHP is a lot less.

Because technologies don't win by being the best, or even by being good.

They just need to provide a killer feature and an easy path to adoption.

After that, inertia does the rest.

Re: 25 Years of PHP

#319

As a new web dev who's never learned PHP, is it worth it? I don't really need to write anything into production.

As another newish web dev, I think it depends. Best thing is to take a look at your local job market and see what people are using. In my area it's a lot of .Net, so I'm focusing more on that. Some other areas have lots of PHP jobs, others have Rails, etc. If you don't care about any of that, I still probably wouldn't pick PHP honestly. I went with Go for my toy project backend, but NodeJS is another good option I think.

Re: 25 Years of PHP

#320

I have a theory that PHP is kind of like erlang -- as a framework and dev environment, not the language itself. Each request is pretty much independent of the others, and each one can independently crash. There was also CGI, but CGI always felt a little heavier, and the crashes were harsher (usually just a 501 error and nothing more). PHP embraced the crashes more and provided more information allowing faster debuggi…

> Each request is pretty much independent of the others, and each one can independently crash.

Not the case anymore with phpfpm.

Post reply on HN