LWN.net Logo

What If I Don't Actually Like My Users?

What If I Don't Actually Like My Users?

Posted Apr 7, 2008 8:28 UTC (Mon) by Los__D (subscriber, #15263)
In reply to: What If I Don't Actually Like My Users? by Wummel
Parent article: What If I Don't Actually Like My Users?

What's wrong with the 0 prefix giving octal? It does exactly the same in C, just as both C and
parseInt() treats 0x as hexadecimal.

Anyway, ActionScript v3 has dumped this, probably meaning it's also gone from ECMAScript, so I
guess JavaScript will pick up the changes sooner or later.

They kept the '0x' prefix for Hexadecimal though, which seems a bit strange to me, either keep
them both, or dump them both. Oh well, maybe it's just because noone really uses octal in
ECMAScript and derived scripts.


(Log in to post comments)

What If I Don't Actually Like My Users?

Posted Apr 7, 2008 11:09 UTC (Mon) by dvdeug (subscriber, #10998) [Link]

What's wrong with the leading 0 making it octal is that if you have to deal with people who
aren't mathematicians or computer scientists, they probably won't know what octal is. If they
add a leading zero by accident, odds are they'll not be able to figure out what they did wrong
or why the results came out the way they did, and unless you're lucky enough to be standing
over their shoulder while they do it, their bug reports won't have enough information to
replicate it. The difference, to them, between typing in 0507 and 507 is nothing. Hence using
parseInt with a UI is going to cause rare, hard-to-trace problems in exchange for a feature
that no one cares about. (Really, even among computer geeks, few people use octal.)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds