3 ms·
> I have this impression the language was designed to duplicate as much code as you possibly can You're right about the limits of jquery, but JavaScript is not
by midnightmonster 16y ago
> I have this impression the language was designed to duplicate as much code as you possibly can
You're right about the limits of jquery, but JavaScript is not like Java inasmuch as repetitious JavaScript is a near-sure sign that you're doing it wrong. I'm working on a larger script too these days, and code organization is a problem for me, too, but repetition isn't really.
- snitko 16y agounDRY code is a problem for me in JavaScript probably because I don't have too much experience. The point is: you can write DRY code in js, it's just not as easy as in Ruby. Also, here's an example: http://stackoverflow.com/questions/3077335/how-do-i-implement-a-before-filter-callback-in-javascript http://stackoverflow.com/questions/3077335/how-do-i-implemen... I managed to find a better answer than it is suggested there, though.