4 ms·
I am pretty impressed with the path PHP has been taking lately. They have moved the language from being a mess into aggressively incorporating modern features a
by maxxxxx 8y ago
I am pretty impressed with the path PHP has been taking lately. They have moved the language from being a mess into aggressively incorporating modern features at a very rapid pace. Especially PHP7 is a really nice language.
- justinator 8y agoI think the problem with PHP is that it's a mature language that is aggressively incorporating modern features, yet still is a mess.
- maxxxxx 8y agoIt's definitely not my language of choice but I commend them for making good progress from a bad starting point.
- welly 8y agoWhat are the messy bits? I know they are there but how is it a mess in your opinion? There seems to be a lot of "PHP is a mess/garabage/whatever else" hyperbole in this thread with no actual explanations why.
- pathartl 8y agoI for one would rather see common utilities move into proper naming and static classing with proper returns. For instance, strpos(string haystack, string needle) will return the position of needle in haystack as an int if found. If not, it returns false. To me, the proper thing in this scenario is to either return an int (even -1 is fine for not found) or throw an exception. There's inconsistencies in typing of what is returned. There's nothing wrong with loose typing, especially in the place that PHP is used. It's just that the PHP API regularly returns not what you'd expect. Throw into the mix that the built in simple-functions are all over the place (https://www.php.net/manual/en/ref.strings.php https://www.php.net/manual/en/ref.strings.php). Seriously, there's str_replace, strpos, and parse_str. These could easily be solved by doing something similar to C#'s naming by changing it to something like String.Replace, String.IndexOf, String.Parse.
- ptx 8y agoOn the other hand, they have been moving to frameworks with separate templates and long-lived processed serving multiple requests - just like every other languange. But mod_php and logic mixed directly into the templates were the two main things that made it so easy to get started with, so with PHP moving to the same model as other languages, why not use another (even nicer) language?