Skip to content

Comment on Google & the Future of JavaScript

Comments

I'm looking forward to discussing this, but in the meantime, can anyone parse "Similarly, I think we can find a way to repair “this” binding foot-guns with softly-bound “this”." for me? I don't understand what "binding foot-guns" are.

What he means is:

1) "this" binding is dangerous - you can easily shoot yourself in the foot with it (it is a "foot-gun").

2) "this" binding can probably be repaired with softly-bound "this".

There's no such thing as "binding foot-guns", the phrase breaks down between "binding" and "foot-". But "'this' binding" and "foot-gun" are both somewhat obscure phrases so this probably was not as clear as it could have been.

Thanks! I hadn't come across the foot-gun meme before (http://web.mit.edu/~axch/www/footshoot.html).

He means foot-guns of the this-binding variety.

foot-guns are guns used to shoot yourself in the foot. Binding is a complex thing to get right, and it sounds like putting the "this" reference into Javascript correctly so it doesn't cause problems (and cause you to metaphorically shoot yourself in the foot) is requiring effort.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.