Remember the with statement?
I know, that was aweful wasn't it? What a terrible idea!
In case you don't remember, JavaScript used to have this statement named with. It was a shorthand for writing recurring access to objects.
ooo.eee.oo.ah_ah.ting.tang.walla.walla.bing = true; ooo.eee.oo.ah_ah.ting.tang.walla.walla.bang = true;
Could be written as.
with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) { bing = true; bang = true; }
Makes the code smaller, people probably thought it was a great idea and put it in to the language.
What happened to with? Well, Crockford stood on the mountain top and declared that it was stupid and people should stop using it.
At the time, he was on a tear. Crockford looked over everything in the language and found that many of the features in JavaScript were actually not worth the expense of the bugs they might create or the ambiguity they add to your code.
I like to sum it up this way.
There are things you may want and things that you may need. Wanting something is not a good reason to use it if it adds ambiguity or could potentially introduce bugs.
You never need with, you just might want it because it's less characters to write.
People listened to Crockford. I haven't seen a with statement in almost 2 years.
with stopped being a problem.
When I look at the proposals in Harmony it looks to me like a lot more want than need.
Some of it I think adds ambiguity.
Other people think differently.
If I think about it enough I get annoyed and start yelling.
Then I stop yelling, because it's not helping.
I become quiet but angry.
Then I remembered with.
I'm feeling better now.