News for hackers. Stuff that matters.
Re:25 Years of PHP by elric on Wednesday June 10, 2020 @09:03AM (#23476562)
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 they're syntactically part of the language. In PHP, they're kinda of not. Not yet, anyway.

Re:25 Years of PHP by slifin on Wednesday June 10, 2020 @09:43AM (#23476909)
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 by agustif on Wednesday June 10, 2020 @01:51PM (#23479976)
Meanwhile with something like NextJS/TypeScript/React you can just enjoy instant reloads without ever caring about F5 again

The more languages the better IMHO though

Re:25 Years of PHP by purerandomness on Wednesday June 10, 2020 @05:36PM (#23482442)
Did you just deliberately redefine 'reload' just to incite a flamewar, or do you really not know what's different in your example?
Re:25 Years of PHP by bkanber on Wednesday June 10, 2020 @10:17AM (#23477239)
To be fair, I've been working in PHP for nearly 20 years and I've been able to avoid annotations almost entirely, except for that one time I used Doctrine and then threw it in the trash.