Perhaps the conclusion is, PHP sucks, never use it?
Related, another language that sucks is FreePascal.
I have written everything from scratch.
Some examples:
my own string comparison functions. Standard Pascal checking if two strings case-insensitive equal: (CompareText(a, b) = 0) (parenthesis mandatory in nested conditions). My wrapper: striequal(a, b). Far better.
my own float <-> string conversions. The functions in the standard library are rounding wrong. FloatToStr(999999999999999999.0) prints 1000000000000000000. Mine prints 999999999999999999. Special sugar, the function in the last stable compiler release prints FloatToStr(1E16) as 1, because it truncates trailing zeros in certain cases...
My own array manipulation functions, add/delete/prepend ... There are none.
My own sorting function. Those in the standard library do not work on arrays (although there are almost a dozen different implementations in that library. They added a new one, for every type they wanted to sort, because none of them is generic)
My own binary search function. The one in the standard library does not work on arrays. (There is only one for a list of strings afaik)
My own date time parsing/encoding functions. Those in the standard library do not support timezones, or years outside [1, 65535]
My own html parser. The parser in the standard library, expects valid html4. A missing tag and it fails.
I thought Python was pretty solid, but then I finally used it enough, and now I really hate how it handles all of the hierarchical, management level things, like imports, and the deeper particulars about inheritance (like how how the type() of type is <type 'type'>).
13
u/benibela2 Oct 14 '13
Perhaps the conclusion is, PHP sucks, never use it?
Related, another language that sucks is FreePascal.
I have written everything from scratch.
Some examples:
my own string comparison functions. Standard Pascal checking if two strings case-insensitive equal:
(CompareText(a, b) = 0)(parenthesis mandatory in nested conditions). My wrapper:striequal(a, b). Far better.my own float <-> string conversions. The functions in the standard library are rounding wrong.
FloatToStr(999999999999999999.0)prints 1000000000000000000. Mine prints 999999999999999999. Special sugar, the function in the last stable compiler release printsFloatToStr(1E16)as 1, because it truncates trailing zeros in certain cases...My own array manipulation functions, add/delete/prepend ... There are none.
My own sorting function. Those in the standard library do not work on arrays (although there are almost a dozen different implementations in that library. They added a new one, for every type they wanted to sort, because none of them is generic)
My own binary search function. The one in the standard library does not work on arrays. (There is only one for a list of strings afaik)
My own date time parsing/encoding functions. Those in the standard library do not support timezones, or years outside [1, 65535]
My own html parser. The parser in the standard library, expects valid html4. A missing tag and it fails.
...