3 ms·
>It is not a goal (at this time) to apply the language enhancements to the standard libraries Speaking from experience being forced to use php, it's a hassle t
by sebstefan 2y ago
>It is not a goal (at this time) to apply the language enhancements to the standard libraries
Speaking from experience being forced to use php, it's a hassle to have ahead-of-time guarantees on your data that you need to strip out or build back up everytime you interact with the (massive) standard library
They should be a bit more enthused to add that kind of expressiveness to their STL and make it a first class citizen in the STL
- imtringued 2y agoHonestly one of the biggest problems with Java is that they are incrementally improving it, but then the new minimally improved code becomes legacy code for the next incremental feature. Legacy code that uses Optional is a liability for any proposal that uses explicit nullability and non nullability. Record types could have been non nullable by default and so on...
- slaymaker1907 2y agoI think you're reading "at this time" as "never" when in reality, they want to do that separately since that sort of conversion is a huge undertaking in its own right. Additionally, separating it into two steps allows them to more easily launch this as a preview feature, get feedback, and then commit to a design before trying to overhaul the whole standard library. If they try and do it all at once, that gives them little room to actually iterate on the feature.
- hnthr_w_y 2y agoforced? modern php is a bliss.
- sebstefan 2y agoIt's hard defending php in 2024 when you've used the alternatives that exist... It took two major versions to add types to both function arguments and return values and there's still no type-restricted data structures. Think "array of foo". Just overall, other than with bash, I've never shot myself in the foot more often than with php I despise that thing with a passion
- jeroenhd 2y agoPHP is fine. It's like Python or Javascript, but with dollar signs. I don't generally like duck-typing languages, but PHP is no worse than its competitors.
- jeltz 2y agoThe standard library of PHP is still the same old crappy standard library that it used to have with only some minor fixes. The language itself is not that bad (still worse than Python, JS or Ruby) but the standard library is awful. One thing I have to give modern PHP is that Composer is pretty neat, better than NPM and the packaging mess of Python and roughly on par with Rubygems/Bundler.
- jeroenhd 2y agoThe PHP standard library has issues for sure (shout-out to real_escape_string), but so do Python and JS (I can't speak for Ruby as I've never used it). JS's "hide everything behind a few magical objects" (Math, window, document, etc.) approach isn't much better in my opinion. Python is a bit better, but mostly because Python 3 was a clean break from Python 2. I find the biggest argument for or against PHP in the context of these languages to be "I find dollar signs aestethically (dis)pleasing". It's a perfectly valid preference to have, but people talk about PHP like they're still porting Wordpress plugins to PHP 4.
- jeltz 2y agoI do not care at all about the dollar sign, but I have worked both in PHP 4 and in modern PHP and I do not think the language has improved much. Other than Composer the dev experince was basically the same. It is still not up to par with Ruby or Python.
- jeltz 2y agoHaving worked in modern PHP I have to disagree. Modern PHP is much better than it used to be but it is still much worse than any of the common alternatives (JS, Ruby, Python, Java, ...).
- brazzy 2y agoKey phrase "at this time". I'm sure it will become a goal once the feature is established.