4 ms·
eh my problem with php never really was performance (up to a point) or the language itself, it was the default library making figuring out every operation an ex
by LoSboccacc 7y ago
eh my problem with php never really was performance (up to a point) or the language itself, it was the default library making figuring out every operation an exercise in googling
like, why the weird _ difference between strtok and str_split, why str_replace has the search first and string as third parameter but in strpos the source string is the first parameter and then the search term the second
it's all confusing and weird and while someone that's a specialist is maybe at ease with this, for a generalist going in and out the language as needed it's frustrating.
- maxxxxx 7y agoWhen I did more PHP I quickly ended up writing my own sort of standard library with consistent functions and unit testing. It doesn’t really take much time and makes things much more predictable.
- noir_lord 7y agoI think we all do this to a degree. If you look most major projects have equivalents e.g. Laravel has Str. Same with collection types, SPL is an abortion so everyone maps over array which isn't really an array to pretend we have proper collections/lists etc. It's mostly fine but there are times when it's annoying.
- maxxxxx 7y agoWith JS it’s pretty much the same. It’s standard library is so weak that you pretty much have to write your own.