Earlier quoted context omitted.
> And the worst being the attribute #[] syntax... why?! Almost every other language uses @attribute, and it is successful: simple to write, easy to read, why on earth a new and such complicated solution? Simple, it was already taken up [1]. Also `@attribute` syntax is by no way universal (and semantics wildly vary even with the same syntax): `#[]` in particular might have been inspired by Rust. [1] https://www.php.ne…
The rfcs have a lot of discussion on those subjects indeed, but I still disagree with the choice! Also, the current use of @ is before a function call or some get, not before a method/class/... declaration, so a change in that direction would probably be possible. (plus the @ to suppress errors should probably be removed from the language anyway!)
PHP 8: Before and After
271–280 of 346 posts
Re: PHP 8: Before and After
#272One of the underappreciated pros of php for web development is its execution model, it's fault tolerant by default and shares little memory across requests. This kind of makes sloppy programming far more tolerable in php than in other platforms. In effect this has an impact on performance but it also helps in ensuring that a bad request can't blow out the whole application from serving other requests like is common i…
And yet, I find that PHP apps tend to be quite performant, compared to say Java or Rails (I don't know about node, maybe not compared to node). But I'm not a PHP developer, this is just my impression. And the complaints you hear about PHP, I seldom hear performance. No?
Re: PHP 8: Before and After
#273One of the underappreciated pros of php for web development is its execution model, it's fault tolerant by default and shares little memory across requests. This kind of makes sloppy programming far more tolerable in php than in other platforms. In effect this has an impact on performance but it also helps in ensuring that a bad request can't blow out the whole application from serving other requests like is common i…
If you want to quickly do something without diving into frameworks the tooling was easy to setup and rarely fell apart, if ever. There are not many moving parts, you usually have a web server that is very solid and comes with an installer that you hit next next next. Then you have a database server, usually MySQL. Sometimes you would need an extension to work with images, you put it in place by editing an .ini file.
Almost like an Excel for backend.
Re: PHP 8: Before and After
#274Earlier quoted context omitted.
PHP apps following modern best practices usually include stateful middleware of some kind though, so this applies in theory more than in practice.
If you mean persistent databases or caching like Redis, it's still much easier to accidentally reference a global pointer due to a programming error than accidentally put something in a cache store. All systems need some sort of persistence, this is true for other languages as well.
Re: PHP 8: Before and After
#275Please remember that PHP is more or less the only truly free (as freedom) community driven language suitable for both prototyping/pet projects and enterprise grade web software development. TypeScript and C# are Microsoft, Go is Google, Java is Oracle. Python is not suitable for complex multi-layered systems, Rust is too young and let's see where it will go without Mozilla. Ruby? IMO Ruby is in sunset phase, no new a…
But PHP is? I cannot imagine a "complex multi-layered system" for which PHP is a better solution than a Python stack.
Re: PHP 8: Before and After
#276Please remember that PHP is more or less the only truly free (as freedom) community driven language suitable for both prototyping/pet projects and enterprise grade web software development. TypeScript and C# are Microsoft, Go is Google, Java is Oracle. Python is not suitable for complex multi-layered systems, Rust is too young and let's see where it will go without Mozilla. Ruby? IMO Ruby is in sunset phase, no new a…
Go isn't free? JS isn't free? Guile (which is probably as free as you can get) comes with a web framework too. Also what does "enterprise grade" mean? I'm not sure if you're aware but the forum we're talking on right now is written in PG's lisp dialect. I'm pretty sure arc is free.
JS is not a programming language, it's some nonsense.
Re: PHP 8: Before and After
#277Earlier quoted context omitted.
I am wondering this: are people who do crud apps (in php or otherwise) do consider race-conditions in the database? Like one query and then based on that query another one which inserts/updates? And if so, where can I read about the standard techniques used in practice?
Database transactions is the topic you should look into. There's ways to handle these in all environments. https://en.wikipedia.org/wiki/Database_transaction
Re: PHP 8: Before and After
#278One of the underappreciated pros of php for web development is its execution model, it's fault tolerant by default and shares little memory across requests. This kind of makes sloppy programming far more tolerable in php than in other platforms. In effect this has an impact on performance but it also helps in ensuring that a bad request can't blow out the whole application from serving other requests like is common i…
> this has an impact on performance And yet, I find that PHP apps tend to be quite performant, compared to say Java or Rails (I don't know about node, maybe not compared to node). But I'm not a PHP developer, this is just my impression. And the complaints you hear about PHP, I seldom hear performance. No?
Re: PHP 8: Before and After
#279Earlier quoted context omitted.
If you mean persistent databases or caching like Redis, it's still much easier to accidentally reference a global pointer due to a programming error than accidentally put something in a cache store. All systems need some sort of persistence, this is true for other languages as well.
No, I'm talking about the kind of thing that provides a `Context`-like object that allows the application developer to share memory between requests.
Re: PHP 8: Before and After
#280Please remember that PHP is more or less the only truly free (as freedom) community driven language suitable for both prototyping/pet projects and enterprise grade web software development. TypeScript and C# are Microsoft, Go is Google, Java is Oracle. Python is not suitable for complex multi-layered systems, Rust is too young and let's see where it will go without Mozilla. Ruby? IMO Ruby is in sunset phase, no new a…
> Python is not suitable for complex multi-layered systems But PHP is? I cannot imagine a "complex multi-layered system" for which PHP is a better solution than a Python stack.