Re: RFC: Implementing a core anti-XSS escaping class

From: Date: Wed, 19 Sep 2012 17:11:41 +0000
Subject: Re: RFC: Implementing a core anti-XSS escaping class
References: 1 2 3 4 5 6 7 8 9 10 11 12 13  Groups: php.internals 
Request: Send a blank email to internals+get-63154@lists.php.net to get a copy of this message
On 19/09/12 17:57, Michael Shadle wrote:
If you want to play with OO all day, then use Java. PHP was built on procedural, and now all you OO fanboys are going nuts with it. :) On a short-lived web request I see no reason to complicate and obfuscate the code with OO. Please explain in detail how object-oriented code obfuscates, complicates, murders baby kittens, etc.
This is becoming religious now, and a fight I will probably lose, but think about PHP core, it does not need to actually start having "OO only" stuff, especially when we're talking about one-line functions. This is becoming religious now, and a fight I will probably lose, but think about PHP core, it does not need to actually start having "Procedural only" stuff, especially when we're talking about one-line functions.
Next you'll start saying "why can't I do $string = new String(); $string->input($input); $string->replace($output);" or something, instead of str_replace. Actually, I have. As an advocate of APIs with consistent argument order that newbies like me can learn more easily, I *have*, in fact, proposed that.
You can always build something from a basic simple foundation, which is how PHP's OO is built anyway. Don't complicate things because of personal preference. There is no reason it cannot stay a simple function call or two. Wrap that in as many classes as you wish on your own time. :) What's complex about a method call?
-- Andrew Faulds http://ajf.me/

« previous php.internals (#63154) next »