C K Kashyap wrote:
Unfortunately, that will pretty much guarantee suboptimal code. ï¿½For
almost anything nontrivial, it is probably worth writing your own JS.
Optimization is a game of compromises I’d say - you have
readability/maintainability/speed of development on one hand and
“performance” of the code itself on the other - timing/memory etc.
I wasn’t talking about performance optimization, but rather about
general code quality and maintainability.
If I understand it right, ruby language and rails framework tends to
weight the first category more - and that is where my advice comes
But you are right…if you know for sure that you are going to run a
particular version of a particular browser, you might as well spend
all the time to figure out all the JS special functions provided by
that JS engine and squeeze out every bit of power.
That’s not what I meant either. Rather, I meant that too many Rails
devs assume that the framework will free them from writing JS. It
won’t. Take a look at the crappy JS that Rails helpers produce, along
with the fact that writing straight JS is often easier and it will
quickly become obvious why Rails’ helpers aren’t worth the effort,
except in the simplest cases (where they can be quite useful indeed).