Pretty much sums up how I feel about most of the big frameworks (Zend in particular, but also Symfony and CakePHP).<p>The problem of over-engineering isn't just related to the big PHP frameworks - the same problem exists in Python and Ruby.<p>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 simple concept, and frameworks should reflect that.
The 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'.
Reminds me of something I wrote a few months ago on how to detect negative numbers: <a href="http://stackoverflow.com/a/11910993/1329367" rel="nofollow">http://stackoverflow.com/a/11910993/1329367</a> but obviously the one above has much more value add and follows better design patterns.
I opened a few bugs to help get this library in a more usable state. I'd really love to see a SOAP API on this as well as result templating, a request router, and a controller.<p>It may also be useful to include a message queue (RabitMQ / SQS are good candidates) implemented using the pub/sub model to allow arbitrary scaling of the compute nodes.<p>I have some other ideas about something like JMX / MBeans here to allow arbitrary instrumentation of methods. This would provide more flexibility than the benchmarking module already included.
It reminds me of a Zend Framework project I'm maintaining, where the previous dev apparently tried to apply any OOP pattern they've ever head about.<p>To get anything from the db, one needs to get a "service locator" (just a dumb global object but with a cooler name) that will parse a namespace and returns a repository that will call a mapper, which in turn will instantiate an entity, which somewhere deeps in the Zend Framework is going to run an SQL query (going through dozens of classes, just to make stack-traces more readable...) and, maybe, if I'm lucky, I'll actually get some usable data back.<p>Of course, adding a new table is just as much fun - dozens of modules, controllers, repositories, mappers and so on to create, and just as many configuration files to update. And, of course, if something's not quite right, good luck getting any sensible error from the framework.
Welcome to the enterprise world. If you are already working for a typically huge enterprise, you would have realized that this kind of coding (Engineering) is just another day at the office and people actually get paid (more) to over-engineer! Infact, anything done to reduce complexity is <i>actually</i> frowned upon, or will even get you labelled as an ignorant employee.
The functional unit tests made me laugh: <a href="https://github.com/Herzult/SimplePHPEasyPlus/blob/master/tests/Functional/AdditionTest.php#L53" rel="nofollow">https://github.com/Herzult/SimplePHPEasyPlus/blob/master/tes...</a>
I'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?<p>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 love it.<p>And 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.
The addition operator takes a collection of numbers, and add the first two? Given the lack of documentation, I find this extremely misleading and I couldn't recommend this library.
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.
What if I need to add 2 and 1? Is there a lib for that? Or would this one need to be completely refactored?<p>Also, in what version could we expect ability to handle 2 digit (or more!) numbers?
Yes this is a good joke until you realize there is no other way to get <i>some</i> level of type safety in PHP other than adding a bunch of unnecessary classes.
while i get the joke , i'm sorry , but serious PHP development means bloated frameworks. You cant avoid it.<p>Frameworks code looks ugly because PHP looks ugly . But has anybody seen Rails source code ?Django's ? or even Sinatra's ? it is bloated too, but because Ruby and Python a well designed , when using them , you dont feel they are bloated.<p>That's why you end up ( in PHP ) writing yaml config files for DI, ORM , etc more than actual PHP.<p>If php looked more like Ruby or Python , using symfony 2 or ZF 2 would be less painfull.<p>Now let's consider something else. in Python you have WSGI , Ruby Rake ,etc ... which are really good stuff , universal in the way you plug into them to write your own framework.<p>Up until now, PHP devs felt they did not really need it. But as the PSR effort improves , we need frameworks to implement the same http kernels so we can plug any middleware no matter what the lib is , that's very important. You cant use raw PHP anymore. You need middleware you can use ACCROSS frameworks.<p>So should php devs use frameworks ? yes. just like Ruby , Python devs dont do raw CGI programming. Should i use guzzle instead of CURL ? yes because it has a beautifull and fluent API , and CURL is just plain ugly. Should i use Silex/Slim/Laravel instead of raw PHP ? yes because your application will scale with these simple frameworks. Writing raw PHP without PSR-0 autoloading , and no framework doesnt scale , period.<p>PHP has a real problem. I admit. It needs a real deep , breaking redesign, a clear separation between the core and libraries , and fat trimming. But framework designers did a great job trying to correct its flaws and making PHP development bearable.