Blog » Blog Entry

Responses to "benny the rock" on Zend Framework

June 20, 2008

Another misguided individual, benny, put some rather pointless opinions about Zend Framework on my blog post. I replied to them, here, in a new blog entry:

> It probably took you lots of time to rant about this why not use the time more productively?

In my defense, I had been coding in Rails all that day, so my increased productivity had me out ahead of the game. In short, I had the time to spare. Thanks for your concern all the same.

> class Zend_View_Extended extends Zend_View_Abstract
> {
>   protected function _run()
>   {
>     while( list( $k, $v ) = each( $this ) ) ${$k} = $v;
> 
>     include func_get_arg(0);
>   }
> }
> 
> class Zend_Controller_SuperAction extends Zend_Controller_Action
> {
> 
>   function __set($name, $value)
>   {
>     $this->view->{$name} = $value;
>   }
> }
>
> This solves all your problems (even using some of your code) of item 2.

That's precisely my point. A "good" framework wouldn't require me to "solve the problem" at all. Local view variables should already be in local scope in the view. Do you enjoy prefixing every view variable with $this-> ?

I almost feel sorry for you.. almost.

> $this->getRequest()->isXMLHTTPRequest() solves another one, writing Ajax
> Form Submits, POST or GET via a good library on your own takes exactly the
> same time than writting them for any View Helper, which actually just
> represents the same function call just in its respective language. So why
> bother about this topic?

Because in a good framework like Ruby on Rails it's just:

if request.xhr?

Looks pretty sweet compared to this abomination:

if( $this->getRequest()->isXMLHTTPRequest() )

I dunno about you benny, but to me, one of those looks a hell of a lot easier to type than the other :)

> Additionally most people get along better with one or the other javascript
> library, so I am quite happy to decide which one i can use with ZF. Extending
> the View Object with another "javascript" helper to wrap your favourite
> libraries functions into PHP would probably also take just a little bit.

I like a framework that helps me do less work, not one that requires me to fill in the gaps where functionality is missing. Rails already supports all the popular Javascript frameworks. So choosing which one or the other to use is only that, a choice.. no headaches integrating anything, it's already there, right now, today.

Tags: rubyonrails, zend

« Broken mirrors and fingernails More silly Zend Framework idiocy.. »

I'm too lazy to title my comment

By: benny <benny at whitewashing dot de>

Posted: 1 month ago

Since i use ZF quite alot, writing all those shortcuts once and using them ever since is cool for me. Referring to the abomination of XML Request testing, you could extend your Zend_Controller_SuperAction to include a function xhr():

function xhr() {
return $this->getResponse()->isXmlHttpRequest();
}

then: if($this->xhr()): is even shorter than the ruby implementation.

Of course this time you would have to solve the problem again, but you have to admit it does not kill anybody.

Why does ZF not include such shortcuts? I don't know, i am not a ZF developer. You're right, Rails does a much better job at giving a hand in rapid application development, but I bet ZF scales much better on huge applications that need tailor made functionality. When I want to develop a simple web application with RAD, I can still use Rails, Symfony or Cake.

Bet all you want..

By: Greg Donald <gdonald at gmail dot com>

Posted: 1 month ago

Rails is already deployed on hundreds of high-traffic sites:

http://rails100.pbwiki.com/Alexa+Rankings

http://rails100.pbwiki.com/Compete+Rankings

PHP will soon become a legacy platform

By: Kris Day <kdidriksson at gmail dot com>

Posted: 1 month ago

Hello,
Even though PHP seems to be at the height of it's adoption as a web development language, the writing is on the wall. It is fast becoming a legacy development platform. The excitement around Ruby (and Rails) reminds me of the excitement around Java 12 years ago. There is a great deal of emphasis right now on speed and deployment, so those issues will be solved soon. Talented young programmers are flocking to Ruby (and Rails) for good reason. I, myself, have just recently decided to take a look and like what I see.
The future is bright for Ruby.
I'm not a fan-boy by any stretch of the imagination. Four months ago, I would have called myself strictly a PHP programmer. At that time I hopped on the ZF bandwagon, but came away disappointed. The marketing is very good and extremely aggressive. Every negative blog entry is covered by the ZF team with the same rebuttal/propaganda. It is a very intense turf war with a lot at stake for those who have their paycheck riding on PHP. But once you have tasted the coolaide, you wind up saying to yourself, "man, what was I thinking?"
PHP5 is perfectly fine in itself and 5.3 will have some great additions. But here is the thing: how long do you think it will take the PHP community to standardize on 5.3+? Two years, five years, ten? Meanwhile, it will just get left in the dust.
Cheers,
Kris

Add a comment:

Title:

Comment:

Name:

Email: