Live data from Hacker News

25 Years of PHP

jetbrains.com

91–100 of 426 posts

Re: 25 Years of PHP

#91
post #61

If you were starting a project now, would you choose PHP or Hack?

PHP. Most of the Hack features are now in PHP core, and more and more libraries are dropping support for hhvm now.

Re: 25 Years of PHP

#92

What ever happened to the PHP-FIG? I noticed in the timeline projects kept dropping from it in the past 2 years. It seemed to have a lot of momentum for a while producing PSRs that were very widely adopted.

There's so much we can agree upon, right?

If you are the geerlingguy I think you are, Drupal sure had an exit after Larry, and Symfony decided to step out too. Laravel didn't really follow PSR to begin with.

I use Slim framework extensively nowadays, and it has a surprisingly PSR 2,4,7, AND 15 support.

https://github.com/php-fig/fig-standards

The repo is quite active.

Re: 25 Years of PHP

#93

'This page is best viewed in landscape mode' I don't think I'm going to rotate my desktop monitor just for your website :)

Your desktop monitor should already be in landscape mode, shouldn't it?

Not if you code a lot. It is not rare for developer to use vertical screen. https://img.devrant.com/devrant/rant/r_200135_Q9Fh4.jpg

Re: 25 Years of PHP

#94
post #39

Earlier quoted context omitted.

> But neither the choice of language nor the lack of framework are to blame. This is partly true. It is possible to make something great with substandard tools. I suspect a master craftsman with a set of dull saws and blunt chisels using his shoe for a hammer will still have the skill to create something pretty good. But it will be frustrating, and most people aren't master craftsmen so what they will produce will be…

> It is possible to make something great with substandard tools. Is PHP substandard though? While it's no longer my cup of tea, I do remember it being fairly stable and performant. Some of the enterprise software I work with, that was written in Java is ridiculously bad, but I don't consider Java substandard. Real world example: the "Configuration" app I use takes a minute to start up on modern hardware, and it's mai…

In my experience, and of course opinion, yes. Java might also be "bad", I don't know. I programmed it for a bit but didn't like it so moved on.

The main problem with PHP, the real killer, is not that it's complex, or the needle/haystack parameters to functions changed, or the iffy string escaping/unescaping or all that stuff, it's that it's hard to know all the edge cases in the language that could cause you to write a bug. It's hard to look at a piece of code and say "that's going to work the way I think it does". Javascript has the same problems with it's string/number/NaN/coercion wattitude.

I want to be able to reason about my programs, because almost all of what I do (and I guess most people writing anything other than the most trivial application) revolves around handling data. Names, emails, files, data, preferences. If the language I am writing makes it hard to see the bugs, then it makes it more likely that there will be bugs.

There is a common counter to this, and that's that good PHP programmers know about the edge cases, but there's a hell of a lot of average programmers out there.

Re: 25 Years of PHP

#95
post #53

Earlier quoted context omitted.

> Stuff that's in comments SHOULD NOT AFFECT RUNNING CODE. To clarify, comments never affect running code in PHP, ever. What's often done however is that tools like ORMs, or web frameworks offer a 'compile' step that parses these annotations (just like it's common in Java) and dumps a PHP file that maps things in the annotations into actual PHP code. For example, you can use it in Symfony to wire routes to handling f…

Yeah I worded that poorly, but once I went full on caps I decided to leave it, ahem :/. I get the idea of a compile step, and that's totally fine. But these annotations are commented out. It's very icky to be using them for anything other than documentation -- which is what comments are for, after all. Java's annotations are a bit different. Sure, the compiler does things with them -- the runtime does, too --, but th…

Is a heftier compile step totally fine?

The biggest difference between PHP and Java in my mind is that you start Java and pay the compile cost on server start, in PHP you pay the compile cost on every request, frameworks and language features increasingly hide this future cost in caches but caches are one of the two hardest things in computing and often act like pushing things under the carpet, why optimise the compile? It's under the carpet

As we move closer and closer to Java's model, we get further and further away from that quick PHP feedback loop of, make a change press f5 see the changes immediately and quickly

Which puts us further and further away from the kind of ideals that Bret Victor mentioned in his very good talk inventing on principle: https://youtu.be/PUv66718DII which to quote: "Creators need an immediate connection to what they're creating."

Inevitably this is coming and is already here but we should recognise what we've lost

Re: 25 Years of PHP

#96
I've written many languages (starting with ML –Machine Language).

I'm currently developing in Swift, and loving it.

I wrote PHP for about 20 of its 25 years. I never really got to love the language, but got fairly good with it. I don't miss it much.

I have used it to write some industrial-scale systems, though. It's a perfectly good language, and is still under active development and improvement; with a vast user base and [m|b]illions of pages of support.

Even though a lot of us like to live on "the bleeding edge," I've found that it's a good idea to stick with the classics for shipping code.

Nowadays, "the classics" includes JS and Python, so there are definitely good, well-supported, mature alternatives to PHP.

I also programmed C++, and ran a C++ shop, for many years. I always find the hate poured onto C++, with the annual "C++ is dead" pronouncement, quite amusing.

But I really like Swift.

Re: 25 Years of PHP

#97
After several years now of defaulting to Go, in the last month I've gone back to PHP (specifically Laravel) for a new project.

It's... comfortable. That's probably the best way I can describe how I feel about it. I've missed working in PHP, despite how much I enjoy Go.

Re: 25 Years of PHP

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

>My only real gripe with PHP is the annotation syntax. Yikes. Stuff that's in comments SHOULD NOT AFFECT RUNNING CODE. Who came up with that?

Agree. The first time I ran into this, I was completely confused as to why my code wasn't running as expected. Then I noticed the strange formal structure of the comments, made changes there, and voila.

I don't understand why that feature wasn't implemented as decorators or some kind of function code. If anyone has any resources/thoughts on why this path was chosen, I would be interested in seeing them.

Re: 25 Years of PHP

#99

Recently I have been thinking about moving my personal blog from Wordpress to a static site generator, because I don't allow comments or use Wordpress plugins. (Those who want comments can still use a combination of a static site generator and Disqus.) It occurred to me that once I did that, I could completely disable PHP on my Apache installation. It made me wonder how much usage of PHP out there is essentially a hi…

Depend on how you count what is static site generator. Dreamweaver has a template system you can use to generate pages. It could probably be considered a WYSIWYG static site generator. I have never used FrontPage, but I would imagine similar system also exists. There are also a lot of other WYSIWYG website editors out there during late 1990s and early 2000's. Despite that, CMS system thrives.

[deleted]

Re: 25 Years of PHP

#100
post #13
post #4

Amazing how many complete rewrites that timeline contains... :)

3 tbf i have a 12 year old php game that basically prints money - the only thing i had to change was the old mysql module (which was not even buggy/unsafe - just unmaintained).

PHP has unreasonably good backwards comparability, even between v4 and v7.
Post reply on HN