Live data from Hacker News

Addition of 1 and 1 in PHP

github.com

61–70 of 89 posts

Re: Addition of 1 and 1 in PHP

#61
post #7

I know a couple of Java programmers that will find this helpful. Thanks.

What Java really needs is a KitcheSink class. I'm pretty sure there's already one in PHP.

http://www-archive.mozilla.org/docs/web-developer/samples/ki... used to be available in Mozilla as "about:kitchensink"

Re: Addition of 1 and 1 in PHP

#62

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…

I think the main issue is that alot of things just don't remain static. You choose the right tools for the job and then the moment you're finished a new set of requirements are bolted on and suddenly it's no longer the right tool for the job. So instead you start off doing the "simple" things with over powered (and hence more complicated) frameworks. Zend, symphony, cake, drupal you pick your poison in the sure knowledge that when that inevitable list of extra stuff lands on your desk you'll be able to do it.

I've seen some horrible cases where simple blogs done in wordpress were incrementally extended to the point where they're absolutely unmaintainable, un-updatable monsters.

Re: Addition of 1 and 1 in PHP

#63
post #21

Earlier quoted context omitted.

No, but it has a bunch of kitchensnk_ functions in the kitchensnk extension.

Those have been deprecated, you really need to be using the real_ksink functions. Be careful, though, the argument order swapped.

Is it real_ksink2cabinet, or real_ksinktocabinet, or real_ksink_to_cabinet? Why is it so hard to put the dishes up?

http://phpsadness.com/sad/48

Re: Addition of 1 and 1 in PHP

#64
post #62

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…

I think the main issue is that alot of things just don't remain static. You choose the right tools for the job and then the moment you're finished a new set of requirements are bolted on and suddenly it's no longer the right tool for the job. So instead you start off doing the "simple" things with over powered (and hence more complicated) frameworks. Zend, symphony, cake, drupal you pick your poison in the sure knowl…

Yep, YAGNI is a great rule of thumb, but there are cases where you know that you ARE going to need it.

The marketing manager who says today "I just want a blog" IS going to come back next week and say "I want to a white paper on the blog, for which people have to register, and then it automatically subscribes them to a newsletter".

After enough feature requests, you've built yourself a crap framework anyway. At least, by starting with a decent framework, the foundation of your code is solid.

Re: Addition of 1 and 1 in PHP

#65
while i get the joke , i'm sorry , but serious PHP development means bloated frameworks. You cant avoid it.

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.

That's why you end up ( in PHP ) writing yaml config files for DI, ORM , etc more than actual PHP.

If php looked more like Ruby or Python , using symfony 2 or ZF 2 would be less painfull.

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.

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.

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.

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.

Re: Addition of 1 and 1 in PHP

#66
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 actually frowned upon, or will even get you labelled as an ignorant employee.

Re: Addition of 1 and 1 in PHP

#67

Earlier quoted context omitted.

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

[deleted]

Re: Addition of 1 and 1 in PHP

#69
post #65

while i get the joke , i'm sorry , but serious PHP development means bloated frameworks. You cant avoid it. 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. That's why you end up ( in PHP ) writing yaml config files for DI, ORM , e…

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

This is great news - it means PHP is going down the same route that very nearly lead Java to its death and still makes it the laughing-stock of the Dev world. PHP does not have this much traction with enterprisey enterprises, so following Java here probably means PHP is heading for a painful and ugly end.

"Good news, everyone" - Prof. Farnthworth

Re: Addition of 1 and 1 in PHP

#70
post #69
post #65

while i get the joke , i'm sorry , but serious PHP development means bloated frameworks. You cant avoid it. 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. That's why you end up ( in PHP ) writing yaml config files for DI, ORM , e…

>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. This is great news - it means PHP is going down the same route that very nearly lead Java to its death and still makes it the laughing-stock of the Dev world. PHP does not have this much traction with enterprisey enterprises, so following Java here probably means PHP is heading for a…

All web solutions use pluggable middleware ( Ruby Rake , Python WSGI , NodeJS Connect ). So PHP getting some abstraction is JAVA-ISH ?
Post reply on HN