I remember when I would've agreed with you that your version is easier to understand and better, but now I don't.
I think it's javascript's fault. If you were working on a lisp codebase (suspend your disbelief for a second for me, please), you might see something like:
((splat (get 'title')) orders)
You might consider it perfectly appropriate in context, especially since you probably already have a good idea what splat and get do.
If you were working in Java and saw
int totals[] = splat(get("title")).call(orders);
You'd probably be upset at whoever wrote it, and with good reason. The difference between legitimate jargon and cleverness is contextual.
The argument you guys are having arises because some people think of javascript as a dynamic sort of java with lots of weird stuff thrown in, and some people, ragenwald included, think of it as a lisp in a java costume. I don't think either view is entirely correct, but both are reasonable and you can write your javascript either way.
When it comes to "clever" vs "explicit", I'd say it comes down to the opinions of all the people who have to maintain your code: are they expecting lisp or java?
More than once I have found about a new technique in language A and thought: "Wow, this is clever". Then sometime later I learnt language B where that technique is not only common place, but has some nice syntax sugar and is used throughout the whole standard library. And that makes a huge difference in the perceived cleverness of the code.
I think it's javascript's fault. If you were working on a lisp codebase (suspend your disbelief for a second for me, please), you might see something like:
You might consider it perfectly appropriate in context, especially since you probably already have a good idea what splat and get do.If you were working in Java and saw
You'd probably be upset at whoever wrote it, and with good reason. The difference between legitimate jargon and cleverness is contextual.The argument you guys are having arises because some people think of javascript as a dynamic sort of java with lots of weird stuff thrown in, and some people, ragenwald included, think of it as a lisp in a java costume. I don't think either view is entirely correct, but both are reasonable and you can write your javascript either way.
When it comes to "clever" vs "explicit", I'd say it comes down to the opinions of all the people who have to maintain your code: are they expecting lisp or java?