Hacker News new | ask | show | jobs
by midnightmonster 5834 days 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.

1 comments

unDRY 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-implemen...

I managed to find a better answer than it is suggested there, though.