Is it really a good idea for octal numbers to allow capital-O, e.g. 0O755?

# Jeff Walden (11 years ago)
var n = 0O755;

Is this something anyone wants to read? I certainly don't! Allowing only lowercase 'o' in octal literal syntax is inconsistent with 'x' and 'b', but on balance I think that's probably preferable to admitting this monstrosity. :-) (Which isn't to say I care strongly enough to spend a whole bunch of time arguing the point, only enough to raise it as a concern and see if others agree.)

# Erik Arvidsson (11 years ago)

It was decided to allow it for consistency with 0XFF and 0B11 and leave this up to style guides and linters.

# Andrea Giammarchi (11 years ago)

FWIW, I d0On't like it neither

# Brendan Eich (11 years ago)

I'm with Jeff. YAGNI, YouWillHateIt, ItWillMakeYourEyesBleedWhenYouLeastExpectIt. Remember homomorphic URL phishing attacks?

# Claude Pache (11 years ago)
var Oo22 = 60
window.alert(Oo22 - 0o22) // 42 O_o

Indeed, you ain't gonna need it for obfuscating your code, there's already more than one way to do it. :-)

Since there won't be much code containing words starting with OO, O0, 0O or 00, the risk of eye-bleeding is low. OT0H, it would only be good for facilitating the work of obfuscators (all their numerical constants will start with 0O or 00, and all their variables with OO or O0 followed by digits).

# Brendan Eich (11 years ago)

Claude Pache wrote:

the risk of eye-bleeding is low.

My eye already bled just from this thread!

cheezburger.com/2253407488

# Rick Waldron (11 years ago)

The decision of record, including a rationale citing lack of control over "lookalikes"

esdiscuss/2012-January/019784