atom feed161 messages in net.php.lists.internals[PHP-DEV] PHP Philosophy (was RE: [PH...
FromSent OnAttachments
113 earlier messages
Arvids GodjuksFeb 29, 2012 2:24 pm 
Zeev SuraskiFeb 29, 2012 2:26 pm 
Kris CraigFeb 29, 2012 2:29 pm 
Kris CraigFeb 29, 2012 2:33 pm 
Arvids GodjuksFeb 29, 2012 2:35 pm 
Kris CraigFeb 29, 2012 2:36 pm 
Adam RichardsonFeb 29, 2012 2:41 pm 
Derick RethansFeb 29, 2012 2:44 pm 
Matt WilsonFeb 29, 2012 2:46 pm 
Kris CraigFeb 29, 2012 2:47 pm 
Kris CraigFeb 29, 2012 2:57 pm 
Daniel MacedoFeb 29, 2012 3:42 pm 
Kris CraigFeb 29, 2012 3:54 pm 
Simon SchickFeb 29, 2012 3:56 pm 
Kris CraigFeb 29, 2012 4:05 pm 
Simon SchickFeb 29, 2012 4:18 pm 
Kris CraigFeb 29, 2012 4:55 pm 
John CrenshawFeb 29, 2012 5:16 pm 
John CrenshawFeb 29, 2012 5:16 pm 
John CrenshawFeb 29, 2012 5:16 pm 
Kris CraigFeb 29, 2012 5:46 pm 
Adam Jon RichardsonFeb 29, 2012 5:56 pm 
Richard LynchFeb 29, 2012 6:32 pm 
Kris CraigFeb 29, 2012 7:01 pm 
Richard LynchFeb 29, 2012 7:02 pm 
Kris CraigFeb 29, 2012 7:04 pm 
Kris CraigFeb 29, 2012 7:10 pm 
John CrenshawMar 1, 2012 12:38 am 
Arvids GodjuksMar 1, 2012 12:41 am 
John CrenshawMar 1, 2012 12:46 am 
Simon SchickMar 1, 2012 12:52 am 
John CrenshawMar 1, 2012 12:59 am 
Pierre JoyeMar 1, 2012 12:59 am 
Lester CaineMar 1, 2012 1:00 am 
Lazare InepologlouMar 1, 2012 1:10 am 
jpauliMar 1, 2012 2:59 am 
Kiall Mac InnesMar 1, 2012 3:10 am 
Anthony FerraraMar 1, 2012 10:06 am 
John CrenshawMar 1, 2012 11:37 am 
Gustavo LopesMar 1, 2012 12:08 pm 
Richard LynchMar 1, 2012 1:44 pm 
Simon SchickMar 1, 2012 3:30 pm 
John CrenshawMar 1, 2012 4:15 pm 
John CrenshawMar 1, 2012 4:18 pm 
Kris CraigMar 1, 2012 5:22 pm 
Simon SchickMar 2, 2012 1:09 am 
Simon SchickMar 2, 2012 2:30 am 
Ronald ChmaraMar 2, 2012 3:13 am 
Subject:[PHP-DEV] PHP Philosophy (was RE: [PHP-DEV] Scalar type hinting)
From:Richard Lynch (
Date:Feb 29, 2012 7:02:14 pm

On Wed, February 29, 2012 7:16 pm, John Crenshaw wrote:

I'm beginning to think that the type hinting question is too closely related to the dirty secrets of type juggling to resolve them separately. You may have to either discard consistency, or else fix the problem of silent bizarre conversions at the same time ('foo'==0, '123abc'=123). Fixing the conversions is a BC break though.

[short version] One man's "fixing" is another man's "feature" :-)

Old hands can now hit delete while I wax philosophical.

[long version]

PHP does the type juggling because HTTP data is all string. It's a feature, because PHP's main purpose was to process HTTP input. [Yes, I know you did not dispute this. It's just foreshadowing...]

Once one accepts the premise that automatic type-juggling is "good", the idea that (int) "123 abc" turns into 123 may seem incredibly "wrong" or "right" depending on how useful one has found it.

I have found it useful, and others have as well, to the point that we don't consider it something to "fix" but a "feature"

Obviously, others disagree. And that's okay. We "get" that some disagree, and even why some disagree. We've all coded in C, C++, C#, Forth, Modula 2, Lisp, PL/1, and many more, collectively.

We choose PHP, at times, because it is the way it is, as "broken" as it may seem to others. And they are legion. One only needs to review blogs and mailing lists of fans of other strictly-typed languages to see this.

But Breaking Compatibility with something so deeply ingrained in the culture and language, which goes back consistently at least to PHP3, and probably PHP/FI, is a non-starter.

There are probably literally millions of scripts that will break "out there." That's simply unacceptable, and I trust you understand why that is so.

You might consider those scripts poor programming practice. We all do. But PHP is the language of the unwashed masses, and that was, and is, part of why it is hugely popular. Somebody who barely understands programming can pound away at the keyboard and write a bloody useful web application, breaking 10,000 Computer Science rules along the way.

It's duct tape and bailing wire. And we love it for that.

If the app is useful enough, it might even get cleaned up. Or just more duct tape and bailing wire is applied, more likely. :-)

Even at a major release, PHP has, by and large, strived to remain Backwards Compatible, unless a VERY compelling reason was presented.

A vocal minority, or even a majority, of developers does not qualify. That's pretty much why the Core Devs' "veto" power exists.

Some of the proposals and ideas lately have adhered to that concept of not breaking Backwards Compatibility. Others have not, and those are just non-starters.

But PHP core has always had the mantra "Keep It Simple, Stupid"

If one wants a complex language, PHP is simply not going to be it, and virtually all of these proposals do not fit the KISS principle, at a fundamental level of "Any idiot can read halfway decent code and puzzle out what it does in less than a day."

This is a Religious Issue, a personal preference, a philosophical ideal, etc. Right or wrong, it is what it is, by choice, by the core developers who have put years worth of effort into it.

Please don't read this as "go away" or a restatement of the arguments that have been labeled as circular before. I am merely trying to explain why PHP is the way it is, at a 10,000 foot level, and why so many core devs are resistant to the changes being proposed.

I highly respect all the efforts and the alternative philosophical differences, and even the guiding principles of Computer Science driving them. PHP is just not the language for Computer Science types, for the most part. It's for the masses.

Some CS types like it in certain situations, which is all to the good, or it would be a total mess :-) We embrace its "flaws" and ugly hacks because, like it or not, "it works" for what it's designed to do.