Live data from Hacker News

Go with PHP

gowithphp.com

501–510 of 532 posts

Re: Go with PHP

#501

of course php is best, but how do u do in app(web app/browser) notification with 6$/month apache & php? for example if there are 2000 users who need to push a message to when a queue job finishes in php backend?

Laravel lets you run tasks in the background. You just queue up those notifications and then some other task you wrote will come along and start sending them. Apache isn't involved.

Thanks. My queue is done and working, but how can i make php to have websocket for thousands of devices ? I know it's javascript in the frontend and i could do some kind of timeout loop to check job status, but that's not good..

Re: Go with PHP

#502

Why do most PHP related posts on HN read like repentance ? If you want to promote the language -to the point of buying a domain and making a webpage-, please show interesting stuff, not something that is equally trivial to solve in gazillions of web frameworks written in gazillions of languages.

Because there is a lot of negative propaganda against PHP out there, especially within academia.

You can meet people fresh out of university telling you that PHP is bad even though they have never written a line of PHP. They just know.

This is quite bad for the industry as a whole, because it plays right into large companies that is pushing their technology in an effort to subvert web.

Re: Go with PHP

#503
post #117

PHP 8+ is filling-in a lot of the missing features -- type hints, attributes, named parameters, etc. Nowadays instead of using 'string_you_have_to_remember_and_might_mistype' or abusing associative arrays as in the given code sample, you can usually get full code completion luxury with PHP without magic comments or other workarounds. PHP 8 is still missing a few critical features such as generics and typed resource h…

Learned Python a few years back; after being a long time php dev. The named parameters and the *parameter expansion felt so nice in Python and it irked me that we didn't have that in php. Feels good that it is finally coming ^^

Re: Go with PHP

#504
post #198
post #188

Earlier quoted context omitted.

You do get XSS protection out of the box in most templating languages, though, and PHP is also a templating language. Take this template: {{ title }} In most templating languages, for a title of " alert(); ", the result will end up being: <script>alert();</script> In PHP, which is a templating language, the equivalent seems to be: But this will print the title unescaped, which is a security vulnerability,…

Templating languages are abstractions on top of other technologies. I don't see how PHP is a templating language. I could write that exact same code above in NodeJS and I'd need to use mustache to escape the output. So you can make the same mistakes in Node, Python. Nobody writes PHP mixing HTML and PHP anymore, and if you do you should run. Shit code is not unique to PHP and I've seen more than my life's share in JS…

Tangential, but I've always found Mustache's tagline "logic-less templates" confusing - what they mean is that the template language doesn't have control flow. Logic is not a synonym of control flow in my mind.

Re: Go with PHP

#505
post #502

Why do most PHP related posts on HN read like repentance ? If you want to promote the language -to the point of buying a domain and making a webpage-, please show interesting stuff, not something that is equally trivial to solve in gazillions of web frameworks written in gazillions of languages.

Because there is a lot of negative propaganda against PHP out there, especially within academia. You can meet people fresh out of university telling you that PHP is bad even though they have never written a line of PHP. They just know. This is quite bad for the industry as a whole, because it plays right into large companies that is pushing their technology in an effort to subvert web.

PHP sucks though.

Re: Go with PHP

#506
post #502

Earlier quoted context omitted.

Because there is a lot of negative propaganda against PHP out there, especially within academia. You can meet people fresh out of university telling you that PHP is bad even though they have never written a line of PHP. They just know. This is quite bad for the industry as a whole, because it plays right into large companies that is pushing their technology in an effort to subvert web.

PHP sucks though.

I wouldn't say it sucks, or rather at this point it has its warts like any other platform. It's definitely not a pretty thing, and it was never meant to be. It's something that borrows from the competition rather than innovate.

Re: Go with PHP

#507
A major downside of phps model is that there is no continuously running service, so you can’t run timers or background cleanups.

Re: Go with PHP

#508
post #462

Earlier quoted context omitted.

https://symfony.com/doc/current/page_creation.html Apparently there's now something called annotation routes. Which appear to be inferring functionality from comments. You made me look though. I suppose I had it coming.

They are not comments they are php8 attributes

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

Re: Go with PHP

#509

Earlier quoted context omitted.

They are not comments they are php8 attributes

# 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...

Re: Go with PHP

#510
post #502

Earlier quoted context omitted.

Because there is a lot of negative propaganda against PHP out there, especially within academia. You can meet people fresh out of university telling you that PHP is bad even though they have never written a line of PHP. They just know. This is quite bad for the industry as a whole, because it plays right into large companies that is pushing their technology in an effort to subvert web.

PHP sucks though.

Name something better to build web sites.
Post reply on HN