4 ms·
The keywords were reserved in the latest spec for just this purpose. I don't think the rationale for their inclusion is a good one. The inclusion of such keywo
by agentultra 9y ago
The keywords were reserved in the latest spec for just this purpose.
I don't think the rationale for their inclusion is a good one. The inclusion of such keywords in languages like C++, Java, etc was well-meaning but a mistake in retrospect. In the presence of global variables and direct assignment these keywords are the PHB approach to information hiding. They require ceremony and diligence to achieve true encapsulation. It's a murky situation at best.
See Bob Martin https://www.youtube.com/watch?v=TMuno5RZNeE&t=2325 https://www.youtube.com/watch?v=TMuno5RZNeE&t=2325 and Bertrand Meyer on Eiffel: http://se.inf.ethz.ch/old/teaching/ss2007/0050/slides/03_softarch_info_hiding_lang_constr_3up.pdf http://se.inf.ethz.ch/old/teaching/ss2007/0050/slides/03_sof... (Bertrand Meyer coined the Open/Closed Principle and is the developer behind Eiffel).
At this point though I see their inclusion in JS being almost inevitable. Just another feature to ignore.
It'd be nicer if they would look to add syntax for higher-order operators like compose to the language instead of this.