This is so funny. The author's description is great on github, really fooling you at times. Even if this isn't intended as a joke, the dedication to doing something fun to prove a point got me thinking about over engineering design patterns too.
>"got me thinking about over engineering design patterns too." Relevant: http://me.veekun.com/blog/2013/03/03/the-controller-pattern-... (by the same dude who wrote "PHP: A Fractal of Bad Design", no less)
Addition of 1 and 1 in PHP
51–60 of 89 posts
Re: Addition of 1 and 1 in PHP
#52Pretty much sums up how I feel about most of the big frameworks (Zend in particular, but also Symfony and CakePHP). The problem of over-engineering isn't just related to the big PHP frameworks - the same problem exists in Python and Ruby. At its core, web development is about taking some user input, validating it, throwing it in a database, and displaying it again (perhaps slightly modified) to users. That's a fairly…
Re: Addition of 1 and 1 in PHP
#53While we are discussing PHP, why is the ternary operator nesting behavior different from every other mainstream language using "?" and ":" ?
Re: Addition of 1 and 1 in PHP
#54Earlier quoted context omitted.
What Java really needs is a KitcheSink class. I'm pretty sure there's already one in PHP.
No, but it has a bunch of kitchensnk_ functions in the kitchensnk extension.
Be careful, though, the argument order swapped.
Re: Addition of 1 and 1 in PHP
#55And I hope that after all the types of fad programming (that work almost as good as the fad diets) we will get to the "common sense programming" - use the proper tools and scale for the problem and don't try to fit the problem in your tools and frameworks.
Re: Addition of 1 and 1 in PHP
#56The only flaw I can see is that the string literal '1' should have been declared as a const somewhere, preferably in another unrelated library, and called something like 'UNITY_VALUE'.
UNITY_VALUE? Seriously? The agile approach would be to contact the customer, ask them what kind of user story they need to interact with the number 1, e.g. "As an admin, I want to interact with the number that is the square root of 1, which is also the product of i^4, and the multiplicative identity." There may be some back and forth on this, since regular users (not just admins) will want to work with the number prescribed above.
Then, you need to draw up a quick prototype. We don't need any crap like UNITY_VALUE polluting our beautiful agile code. Instead we'll declare a constant called ONE somewhere. (It doesn't matter where you put it, since we'll probably just Martin Fowler that code anyway in 10 weeks--actually, make that 2.)
Then you go back to the customer, show them the prototype. In my opinion, it helps to show them Euler's identity or the multiplicative identity just to assure them it works, in case they doubt it. (They probably will doubt it, since all this agile process stuff looks like automagic to the unenlightened morons we call customers.)
Then move on. Done. Bam. No need for this UNITY_VALUE junk. No additional libraries. Agile magic.
Re: Addition of 1 and 1 in PHP
#57I'm not familiar with the PHP ecosystem. Is the author making fun something other than obvious over-engineering? Does he or she feel like that's a problem in the PHP ecosystem? I'm criticizing, because it's funny. I'm just trying to figure out if theres some wisdom being conveyed that I'm missing.
I think he is mocking the general pattern of over-engineering and PHP just happens to be the language he wrote this in. At least PHP is not a language known for massive over-engineering. Usually people associate the exact contrary with PHP. But there is indeed a recent trend towards better object oriented designs in PHP and with it comes also more over-engineered code. But I have yet to see any Java-style absurdity.…
Re: Addition of 1 and 1 in PHP
#58Earlier quoted context omitted.
I think he is mocking the general pattern of over-engineering and PHP just happens to be the language he wrote this in. At least PHP is not a language known for massive over-engineering. Usually people associate the exact contrary with PHP. But there is indeed a recent trend towards better object oriented designs in PHP and with it comes also more over-engineered code. But I have yet to see any Java-style absurdity.…
> I have yet to see any Java-style absurdity. Then you probably haven't tried Zend Framework ;)
Re: Addition of 1 and 1 in PHP
#59Yes this is a good joke until you realize there is no other way to get some level of type safety in PHP other than adding a bunch of unnecessary classes.
Oh come on, PHP is a dynamically typed language. That's the trade.