[Rails] Re: shortcut to call js function

2009-05-30 Thread Marnen Laibow-Koser

Mk 27 wrote:
[...]
> I think we are talking about slightly different things.  I am not 
> talking about defining functions inline.  I'm talking about calling 
> them:
> 
>  with no exceptions" and you are bound to failure because of that.

What failure?  Again, I've *already succeeded* in doing everything I'm 
talking about, so for you to claim that it is impossible suggests 
inadequate comprehension on your part.  That's OK for now.  Parts of 
this concept may be tough.  But that doesn't mean they don't exist, or 
that you shouldn't be willing to educate yourself about them.

> 
>> You said you were snobbish about JS as compared to "real languages". 
>> Well, guess what -- JS is a "real" language, and quite a powerful one 
>> too, 
> 
> This was a joke about snobbishness, and not really anything else.  Sorry 
> I did not make that clear earlier...

I understand.  My point was that if you use JS in larger chunks, you can 
take better advantage of the higher-level constructs in the language, 
which will make it possible to produce better-designed code.

[...]
> 
> Inlining CSS is truly pointless, but when I look at a page source and 
> see a mix of html, javascript, and embedded "whatever", I honestly do 
> not, never have, never will, have some sort of absurd formatting related 
> freak-out (like: "See how much tidier your html is now!!"  Grow up).

Excuse me?  "Grow up"?!?  I'll just pretend you didn't say that -- let's 
keep this civil.
It's not really about formatting, it's about organization, and as 
pharrington explained, it also benefits things like testability and code 
reuse.

> You sound like someone who insists there is only one place to place an 
> opening {, when in fact there are a number of acceptable styles and that 
> is all they are: styles.

Do not jump to conclusions, and do not try to drag an unrelated issue 
into this thread.  Unlike brace placement, this is *not* a stylistic 
debate, but rather an architectural one.  As long as you fail to grasp 
that, you will fail to grasp why this issue is important.

> 
>>> You are not 
>>> talking about any improvement in functionality or performance, after 
>>> all.
>> 
>> Wrong again.
> 
> No, you are wrong again.  

No I'm not, and I'm not sure why you think I am.  External JS undeniably 
brings an improvement in functionality, and performance is helped by the 
browser being able to cache the entire JS file.

> If you want to tell me
> 
>