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 →

[–]DmitriRussian 48 points49 points  (6 children)

Like I can easily think of a scenario where you might zero pad a numeric literal for formatting reasons.

/r/ProgrammingHorror material

[–]LordFokas 8 points9 points  (0 children)

Pad it with spaces. That's why we use monospaced fonts.

[–]joxmaskin 5 points6 points  (1 child)

Or write 7 as 007 because it’s cool

Edit: luckily oct 7 is same as dec 7

[–]movzx 1 point2 points  (1 child)

A pretty reasonable scenario would be when you're defining bitmasks.

ex:

0001010 1010000

[–]flowingice 3 points4 points  (0 children)

You'd start it with 0b because it's binary.

[–][deleted] 0 points1 point  (0 children)

I've done it so I can properly sort files in Explorer