Live data from Hacker News

Go with PHP

gowithphp.com

511–520 of 532 posts

Re: Go with PHP

#511
You are touting the language's ecosystem or tooling but the language itself is horrid. PHP is carried by Laravel.

Another language carried by tooling is Go. The language itself doesn't even have sum types, lmao.

Re: Go with PHP

#512

Earlier quoted context omitted.

# is a PHP comment syntax. #[foo] is as much of a comment as #foo is.

Not since PHP8 it's not [0], it's a real part of the language that you can read and view using reflection [0] https://www.php.net/manual/en/language.attributes.overview.p...

It's still using a subset of the comment syntax, and will still be ignored as comments rather than hard-fail in earlier versions.

Unknown attributes are also ignored silently, which isn't really a good sign.

Re: Go with PHP

#513

Earlier quoted context omitted.

Not since PHP8 it's not [0], it's a real part of the language that you can read and view using reflection [0] https://www.php.net/manual/en/language.attributes.overview.p...

It's still using a subset of the comment syntax, and will still be ignored as comments rather than hard-fail in earlier versions. Unknown attributes are also ignored silently, which isn't really a good sign.

This is one of the reasons I like PHP, in newer PHP versions it is an attribute but in older versions it is just a comment. Clever and backwards compatible.

Re: Go with PHP

#515
post #513

Earlier quoted context omitted.

It's still using a subset of the comment syntax, and will still be ignored as comments rather than hard-fail in earlier versions. Unknown attributes are also ignored silently, which isn't really a good sign.

This is one of the reasons I like PHP, in newer PHP versions it is an attribute but in older versions it is just a comment. Clever and backwards compatible.

It isn't backwards compatible (`#[foo` used to be legal PHP 7, but is illegal in PHP 8).

It may technically be forwards compatible syntactically (`#[foo]` will, as you say, just be ignored by PHP 7), but that's an anti-feature (assuming that the attribute isn't a no-op, it'll presumably break something else).

Re: Go with PHP

#516
post #513

Earlier quoted context omitted.

This is one of the reasons I like PHP, in newer PHP versions it is an attribute but in older versions it is just a comment. Clever and backwards compatible.

It isn't backwards compatible (`#[foo` used to be legal PHP 7, but is illegal in PHP 8). It may technically be forwards compatible syntactically (`#[foo]` will, as you say, just be ignored by PHP 7), but that's an anti-feature (assuming that the attribute isn't a no-op, it'll presumably break something else).

Okay, forward compatible. It makes it easier for framework and library maintainers to support multiple versions of PHP, which is nice.

> `#[foo` used to be legal PHP 7, but is illegal in PHP 8).

So it is not a comment in PHP8 then.

Re: Go with PHP

#517
post #514
post #510

Earlier quoted context omitted.

Name something better to build web sites.

HTML

Yes, I agree. But if you want to do some form of dynamic rendering and not static rendering HTML only is not an option. PHP matches HTML pretty well.

Re: Go with PHP

#518
post #487
post #480

Earlier quoted context omitted.

Joking aside, as someone who runs their entire saas off a single bare metal server in Las Vegas, I have been toying with the idea of pushing some stuff to the edge. The reason being, sometimes those average load times are not giving you the real picture. If my average load time is 560ms per request because 90% of requests are 400ms and 10% are 2 full seconds, that might be a problem. Fixing those 10% requests and bri…

I like the idea of a "Progressively Enhanced Monolith". Start by building the core of the application in something like Laravel that can do anything and be developed quickly, then stick it behind a proxy/CDN like Cloudflare. Then if you find endpoints or pages that are accessed frequently and would be better as their own microservice then use a small serverless worker to either respond directly from the edge or forwa…

I'm jumping on the conversation , actually my portfolio website is on cloudflare pages with astrojs , it costs me nothing to host it , has a quick way to develop . I higly recomend it
Post reply on HN