I agree with Joan,  I am not too sure I like this additional
reduction. I believe similar concepts are being applied to JS 2.0 and
FF 3.0?

IMO, part of good software craftmanship and being productive is being
able to recognized code in brain speed. One might called say the art
of "jQuery Theory" dissemination of information  applies here.

Seeing something like this:

    $(...).onclick().toggle().end();

naturally comes with a presumption the commands is all part of the
framework.  Which part is the programmer's function,  toggle() or
end()?

I think this may be one thing new jQuery explorers struggle with early
on with jQuery syntax and new way of thinking and structuring logic.

But once you get going, learning by example, etc,  you begin to see
the clear separation of the framework from the programmers work.

   $(...).click(function() { ... });

Of course, on the other hand, one can also write the reduced method
as:

    $(...).onclick().myToggle().end();

and this might serve equally well to recognize code separation.

"There is no such thing as a bad language, just bad programmers." -
Dr. Debug.

---
HLS



On Aug 17, 2:54 pm, "Joan Piedra" <[EMAIL PROTECTED]> wrote:
> On 8/17/07, Matt Kruse <[EMAIL PROTECTED]> wrote:
>
> > I want to do this:
> > $('#test').click("alert('test');");
>
> Hello Matt,
>
> IMHO, I've seen code like this, but I got confused each time I read it.
> I find using anonymous a better approach because it encapsulate the
> whole code that will show in the click event, so I don't mess up with
> anything else.
>
> On 8/17/07, John Resig <[EMAIL PROTECTED]> wrote:
>
> > $(...).onclick().toggle().end();
>
> The same would happen to John's code, this would mess me up.
> Just my opinion tho.
>
> Regards,
>
> --
> Joan Piedra || Frontend webdeveloperhttp://joanpiedra.com/

Reply via email to