On 28 July 2013 09:52, Виталий Филиппов vitalif@yourcmc.ru wrote:
Also for example I don't like python's strict typization ideas (for example it throws exception if you concatenate long and str using +). PHP is simple and has no such problems.
Except, you know, that is not entirely true. PHP's weak dynamic types causes numerous problems. You cannot compare strings in order to sort them, you need to convert individual characters to their ASCII/Unicode value and compare it that way (and that in itself is not always perfect, because their value may not be in the same order as humans consider an appropriate sorting[0]).
If I do `"10" == 10' in PHP, PHP will yield true. I can force it to say false (because they are not the same type) by using '===' (except - of course - PHP developers fails to understand what the === operator is for[1]). But if I do `"10" < 11' in PHP, it will yield true, because < does what == does (converts the types), but there is no way to tell PHP, I don't want that.
Particularly because int nor str doesn't exist in the language, you cannot cast things in PHP to control your types.
Furthermore, PHP has an annoying habit of doing stuff without warning you.
I recommend you reading this article: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
This is one of the main reasons I stopped contributing to MediaWiki; I simply got tired of writing in PHP. I don't like a language where I constantly have to circumvent it, because its developers are stupider than I am.
[0] Of course, no other languages solves this issue as well, so that's another thing. [1] === compares values and type… except with objects, where === is only true if both operands are actually the same object! For objects, == compares both value (of every attribute) and type, which is what === does for every other type. Wat.