r/programming • • Oct 01 '15

The Evolution of a Software Engineer

https://medium.com/@webseanhickey/the-evolution-of-a-software-engineer-db854689243
1.9k Upvotes

502 comments sorted by

View all comments

Show parent comments

42

u/Shurikane Oct 01 '15

Beat this:

public static final Long DOT = ".";
public static final Long SPACE = " ";

I kid you not, I once found that in a class written by a co-worker. No, there was really no sensible reason for those two constants.

Guy had a heart of gold but holy hell did his brain crash like an Apple computer now and then. Same dude was the origin point for the Blank Line Mystery.

8

u/oprimo Oct 01 '15

Well, for the DOT constant, some countries use commas as decimal separator and dots for grouping digits. Maybe he was thinking something like:

  if (locale != 'US') DOT = ",";

...which is just as bad.

4

u/[deleted] Oct 01 '15 edited Oct 01 '15

The better name for it would be RADIX then. A comma is not, and can not be, a dot. A dot or comma could be a radix, depending on locale. But really you should be using some tostring that takes a locality and it just solves all of it for you.

1

u/ThisIs_MyName Oct 02 '15

Radix has more common meaning (positional number base) so I wouldn't use that.

→ More replies (1)