I'm well aware that this has been discussed before, Stas. However, you're mischaracterizing those previous conversations. It has never been proven that optional strict typing doesn't work. You've made the same arguments against it, but those arguments have counter-arguments that are also viable.
If anything, I think the fact that this keeps coming up is something that you should be the one to take note of. It keeps coming up because people keep asking for it. It keeps coming up because, despite belittling and dismissive comments made by yourself and a few others, people continue to see that there is, in fact, a valid argument for implementing this. It shows that you have never been able to convince those who don't already agree with you that this is impossible. You're also imploying some logical fallacies. For example, you guys have repeatedly tried to mischaracterize this as an attempt to "rewrite" PHP into a clone of C++ or Java. Nobody is proposing anything even remotely like that. On the contrary, the PHP language would remain largely unchanged; we'd merely be adding a new element to it. Furthermore, I have spoken to numerous people who have complained about PHP code being overly bulky and/or difficult to read due to its mandatory dynamic typing. Your counter-argument to that was, essentially, "Yeah, well they're all stupid!" No, they're not. They have a valid point. PHP can be bulky and it can be hard to read is certain circumstances-- situations where strict typing would make it much easier to read. Your dismissive attitude does not constitute a constructive argument IMHO. It's just juvenile and disrespectful of those who happen to disagree with you. And again, you're using the, "If you don't like PHP, then get the hell out and use a different language," argument (i.e. "If one needs strict typed compiled language, one knows where to find plenty of them."). As I said in a previous post, that argument carries ZERO weight with me, and I'm not the only one who feels that way. Like it or not, we're talking about this now. We're talking about it because people are still interested and still eager for this to happen, despite previous discussions in which they're often demeaned or ridiculed. Whether or not it will actually happen is something neither of us can predict, but the discussion is happening right now and we're not going to stop talking about it just because you don't think it should be discussed. So let's drop the arrogant, "We've already talked about this stupid thing before," crap right here and now because it's not going to change anything. Regarding Arvids' comment, that's a valid concern. There are instances where the data coming in may not be predictable. But in those cases, you could simply not use strict typing. What we're proposing would be optional, probably on a per-function and/or per-script basis. This would be an *expansion* of PHP's existing feature set, in a manner of speaking. Existing scripts would continue to function as they do now. Also, John was correct in pointing out that even C++ supports implicit conversions. This is obviously a topic that people are passionate about on both sides. However, if we could make more of an effort to be respectful of others and their viewpoints, this discussion can be had without animosity or insults being hurled about. I came into this largely on the fence, but I'm more and more becoming convinced that this in fact would be a good idea. Both sides have valid arguments and, like it or not, this issue is NOT going to go away. --Kris On Sat, Feb 25, 2012 at 3:00 PM, Stas Malyshev <smalys...@sugarcrm.com>wrote: > Hi! > > > There are advantages to strict typing other than speed and safety. The >> biggest compliant I hear from people asking for this is that weak >> hinting often leads to bulkier code that is much more difficult to read, >> particularly for someone who frequently switches between PHP and >> compiled languages like C++ and C#. >> > > If somebody finds PHP much more difficult to read than C++, well, he > obviously has a very different concept of reading than the rest of the > humankind. As for other points, I don't think it really makes sense to > discuss making PHP into C++ or any kind of strict typed language. If one > needs strict typed compiled language, one knows where to find plenty of > them. > > > >> Therefore, allowing for strict typing, i.e. leaving it to the discretion >> of the code author, would not necessitate converting PHP into a compiled >> > > I would really wish when we have this annual strict typing discussion > people would bother to read past ones. Partial strict typing does not work, > and in general strict typing in non-compiled language is asking for > trouble. We talked about it many times. > > > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 >