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:
>
> <script type="text/javascript>call_my_function(here, forthis)</script>
>
> You can claim whatever you want but you are not going to get rid of that
> from the page by adding a single line to a .js file somewhere. Period.
> The end.
You are wrong. Period. The end. It is very easy to replace that by a
single line in an external JS file.
>
>> No. Just iterate over the affected DOM elements and apply an
>> appropriate abstraction.
>
> Sure, but that is not one line of code.
I didn't say it was -- either I failed to understand what you were
asking, or you're confusing two separate cases.
> You are trying to make a "rule
> 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
>
> <script type="text/javascript>call_my_function(here, forthis)</script>
>
> represents some kind of performance issue (considering call_my_function
> is already cached), I will tell you are wrong again, because you are.
What do you mean that call_my_function is already cached? I would like
to make sure I fully understand your assertion before I answer it.
>
>>> I would hate to consider a case where an author decided *not* to do
>>> something because it required inline js.
>>
>> Read my lips: *NOTHING* REQUIRES INLINE JS! Anything doable with inline
>> JS can also be done without it.
>
> Possibly, although you don't make much of a case to support that.
I hope and believe that I have made quite a case. So has pharrington in
this thread (far better than me). If there's something that doesn't
convince you, please ask about it. If there's something you don't
believe is doable with inline JS, let's see it!
> But
> just because something *can* be done one way or another doesn't mean it
> *has* to be, unless you have a good reason for it, and since you still
> have not come up with one, I am satisfied that it doesn't exist.
I believe that I have come up with good reasons -- ease of maintenance,
separation of presentation (view) and behavior (controller), caching,
all that other good stuff. But since when did I become the only source?
Read Doug Crockford's writings. Read pharrington's posts here. Read
the Wikipedia article on unobtrusive JS. Read almost anything on decent
JS architecture. Notice that others in this thread consistently come
out in favor of unobtrusive JS.
Above all, please realize that nothing I have said was meant as a
personal attack. You seem to be reacting as if I insulted your little
sister (I don't know if that's the impression you meant to convey), when
in fact I'm just trying to give you some useful guidelines for
programming practice. I hope you will take my comments in the spirit in
which they have been intended, as I also have attempted to do.
>
> MK
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---