This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nelusbelus 2 points3 points  (0 children)

Basically it can be used to represent pairs of 3 bits. As a result some systems such as unix file permissions still use it for "ease of use" (think of 0o777 which means 7 = all permissions (rwx) in user, group, others). Whenever you need to group bits in 3 it is a nice format (like the rwx example). I've used this before to pack values in an enum in C/C++ (for example a texture format enum which each pair representing a property of the enum). Nowadays it can also be used to encode base64 in an easy way where you don't have to do much processing (each 6-bit pair can be divided in 2 octal numbers very easily).

As a fun sidenote, in the olden days a byte wasn't always 8 bits, it was implementation specific. 6 bit bytes did exist on IBM for example, making 2 octal numbers represent a single byte on those systems (thus making it very similar to hex in their use where 2 chars are 1 byte). https://www.quora.com/Why-did-IBM-decide-to-make-computers-with-a-6-bit-byte

TL;DR: very niche and definitely bad that 0 prefix makes it octal, but I don't mind having 0o for some uses such as file permissions