Live data from Hacker News

Addition of 1 and 1 in PHP

github.com

41–50 of 89 posts

Re: Addition of 1 and 1 in PHP

#42

Pretty 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…

> The problem of over-engineering isn't just related to the big PHP frameworks - the same problem exists in Python and Ruby. OTOH, the "complexity" may also be "configurability" or "pluggability" with missing shortcuts. And quite often the "simple" version ends up being insufficient when one needs to tweak something: http://lucumr.pocoo.org/2013/2/13/moar-classes/ > That's a fairly simple concept When going for pithy…

I know what you mean, and I realize there's more to web development than what I just wrote. Nonetheless, I think frameworks such as Zend add a level of complexity that is rarely justified. Zend fans would probably claim that doing things the "right" way in the beginning means less work when you need to maintain the app three years later. I'm not so sure. To be honest, three years from now I'd rather be maintaining a CodeIgniter app than a Zend one. I'm not a CodeIgniter fan per se, and I realize that it gets a lot of criticism for being written the "wrong" way - but the point here is that simple (and well-documented) solutions often win the day.

Re: Addition of 1 and 1 in PHP

#44

Pretty 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…

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.

Maybe most HN startups are that, but web development _at it's core_ certainly isn't limited to CRUD apps.

Re: Addition of 1 and 1 in PHP

#46
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.

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.

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.

Re: Addition of 1 and 1 in PHP

#47

Pretty 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…

> The problem of over-engineering isn't just related to the big PHP frameworks - the same problem exists in Python and Ruby. OTOH, the "complexity" may also be "configurability" or "pluggability" with missing shortcuts. And quite often the "simple" version ends up being insufficient when one needs to tweak something: http://lucumr.pocoo.org/2013/2/13/moar-classes/ > That's a fairly simple concept When going for pithy…

Also on that subject: http://me.veekun.com/blog/2013/03/03/the-controller-pattern-...

Re: Addition of 1 and 1 in PHP

#48
post #34

While we are discussing PHP, why is the ternary operator nesting behavior different from every other mainstream language using "?" and ":" ?

I'm not sure, but probably historical reasons like much else in PHP.

Though, I'm not a real fan of reading other people's nested ternary ops, because if you're going that deep, just write an if/then in whatever language you're using? It will keep you under 80 chars which is a polite way to go.

Post reply on HN