3 ms·
Stupid idea IMHO. PHP is great BECAUSE it organic growth. It fully exposes the incorporated libraries with the same naming convention of the library functions a
by frik 9y ago
Stupid idea IMHO. PHP is great BECAUSE it organic growth. It fully exposes the incorporated libraries with the same naming convention of the library functions and often additionally also in ObjectOriented style.
Have a look how green field planned ObjectOriented Namespaces in Java and dotNet Framework 1-4 turned out. Java's String vs StringBuilder vs StringBuffer, Java's deprecated Date and Time classes, the whole "old" dotNet Framework has been deprecated for a slightly incompatible new dotNet Core namespace and several namespace parts got deprecated long before, some got useless with the move to asynchronous programming (something C/C++ based WinAPI supported since 1994), etc.
What history showed us that monolithic namespaces designed by committee doesn't work out that well, an organic growth may look ugly to you but is easier to remember and quite sympathetic - I for one like PHP also because of that. JavaScript, C99, C++11, have a similar long term history.
Also PHP is so great because of it best of class documentation on PHP.net - no other language has such an extensive docu (and for so many years) incl useful comments on every page. JavaDoc, MSDN, MozillaWiki, etc are unfortunately worse in every regard. (MDN is catching up; and even W3School is quite handy)
- k__ 9y agoAs I remember PHP docs from back in the days, they were mostly crap with the occasional comment that told you how they were crap.
- frik 9y agoIt's just you. PHP.net documentation was always better than the rest, easy to read, some simple examples and with helpful comments. JavaDoc, MSDN had no comments for decades, little examples and the later one lacked lots of API parts. Show me one online documentation of a language that is/was better. Also great are the book "Programming in C 2nd ed" and "Programming Lua", and the Golang focus isn't bad. PHP.net 2017 explode function: http://php.net/manual/en/function.explode.php http://php.net/manual/en/function.explode.php PHP.net 2005 explode function: https://web.archive.org/web/20050206214005/http://php.net/manual/en/function.explode.php https://web.archive.org/web/20050206214005/http://php.net/ma...
- k__ 9y agoI'm not saying the otheres were better. I 'm just saying that PHP.net docs simply had false claims and they needed the users to comment and make them right. I don't wanna know how much hours I lost with that, haha. Well these days I simply look in the source, because it doesn't lie
- lawpoop 9y agoWhat were the false claims?
- batat 9y agoSome awful stuff: http://php.net/manual/en/function.escapeshellarg.php http://php.net/manual/en/function.escapeshellarg.php http://php.net/manual/en/numberformatter.setpattern.php http://php.net/manual/en/numberformatter.setpattern.php
- nkkollaw 9y agoYou can't tell me that the fact that the opposite of the `htmlentities` function is `html_entity_decode` is "great, easier to remember and quite sympathetic". Of course you need great documentation, with those inconsistencies users have to look at it every 5 minutes to even know what they're doing. EDIT: Thanks. https://github.com/nkkollaw/php/commit/eeb8d6b38272eadaae4055e1330665c228da60cb https://github.com/nkkollaw/php/commit/eeb8d6b38272eadaae405...