Hello everyone,

Let's stop the religious war between strongly and weekly typed languages.
In software, there is no silver bullet. Both approaches have their benefits
and their disadvantages, so trying to prove that one is better to the other
leads to nowhere.

Having said that, I don't think that PHP will any time soon become a
strongly typed language. However, as there are indeed benefits to strongly
typed languages, I see no reason to just close the door. I think it's high
time that we separated the PHP *platform* from the PHP *language*. That
will eventually lead to the creation of strongly typed languages that could
be executed on the PHP platform.

Just my two cents :-)


Lazare INEPOLOGLOU
Ingénieur Logiciel


2012/2/28 Arvids Godjuks <arvids.godj...@gmail.com>

> Aren't you people getting tired of saying that arguments like "it's
> not the PHP way" or "that does not fit the PHP paradigm" are invalid.
> Are you even aware, that language is not only about the features, but
> is also about the paradigm, syntax, philosophy and methods of how it
> achieves it's goals? It's not as simple as "nah, lets add feature X,
> it looks weird and alien, but who cares as long as it's cool!".
> On the terminology - strict is strict, weak is weak. Writing a
> statement at the start of the thread and adding a few new words will
> make no difference. Because half the people will just skip it, or
> didn't read carefully because it's not interesting and so on. Some
> people on the list just assume that we are perfect beings and read
> every line of what's written on the list (hell, I skim the text and
> read only the important things. I have ~15 threads active in my
> mailbox (only the internals, not counting other mail) and reading each
> of it carefully will just take too long).
>
> Besides that - a scripting language is much easier to learn, use it
> and learn it. Things like strict typing, strict type hinting and so on
> are not as trivial to understand and learn unless you start with a
> strict typed compiled language. When you deal with the script language
> and loose variable typing you get used to being able to convert types
> on the fly. And imagine the shock when you start using some strict
> typed library and now you have to convert all your variables
> explicitly. And now the code looks just like C/C++/Java/Delphi code -
> type conversion statements all over the place. I sure don't want such
> code. And not because it is hard to combine (or impossible) weak and
> strict type hinting - that just does not suit a scripting language
> created with loose/weak typing in the first place.  And adding such
> things will not improve the code - it will mess it up big time. I
> don't know about you, but I have seen and worked with folks who did
> some really weird things in PHP. An instrument like strict type
> hinting will just give them the ability to write code that is plain
> stupid. It will be just like OOP for the sake of OOP. Too many people
> do not understand the philosophy behind the PHP and they build over
> complex things and complain that they had to become "inventive" to be
> able to do implement something from the C++/Java/Python/Ruby world.
> And they complain that PHP is a bad language, but still eat the
> cactus. I wonder why?
>
> I really liked what the O'Raily wrote here:
>
> http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1.html
> I know, some things are a little over the top, but in general it
> describes the best PHP feature - it's easy to work with, it's easy to
> make something without using any frameworks, libraries and just do the
> work you need for the WEB.
> And I think it should stay that way. And I personally like it that
> way. And it's because of that I don't want to migrate to Ryby or
> Python. Adding strict type hinting will ruin it because I know for a
> fact that there are plenty of programmers who will turn their API's
> into strict typed all over the place. And I will have to select my
> data from the database and go through the records and explicitly
> convert all my data to the correct types so I can use that wonderful
> library whose author is a fond of strict typing. I see such things
> with OOP right now in many places - they ask you for an object, but I
> know it just really needs a string with the data to do the work.
> Many people migrate to PHP from different languages, and mostly those
> are strictly typed compile languages (I actually had teached PHP for 2
> years at the private school of web technologies - I saw many people
> learning PHP after Java, C++, Delphi, even assembler).
> It's not the problem that will become a problem in a year or two - it
> will become so in 5-7 years. Just like register_globals, magic_quotes
> and things like that gave their evil effects in time.
>
> So please, take your time to think this through. The technical aspect
> is only part of the puzzle. As they say "The road to hell is paved
> with good intentions". And adding strict and weak type hinting
> together is just plainly a very bad idea. It may be good for library
> and framework writers (but not all of them agree on that), but to the
> people using them it will be a headache.
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to