Octal literals have their uses (you Unix haters skip this one)

Brendan Eich brendan at mozilla.com
Thu Jan 12 11:11:46 PST 2012

[Resending reply with elaboration. /be]

Yes, the ability to quote the octal literal with Node's APIs came up on 
the gist, but it's not enough.

Quoting is easy to forget, and making the runtime convert string 
(literal) to number is inefficient compared to having JS do it at 
compile-time, and making the runtime (even via a call to parseInt) do it 
also increases bug habitat ever so slightly.

Mainly, users don't have to shun octal in non-strict mode, and they do 
not in Node code I have seen. They won't be adopting strict mode as far 
as I can tell. Banning octal is just one more reason for those who 
*might* adopt strict mode to reject it.

Agree on parseInt. Old dog, hard to change (runtime-only errors are 
migration- and user-hostile). Not sure what to do there.


More information about the es-discuss mailing list