Hacker News new | past | comments | ask | show | jobs | submit login

Thanks for your contribution..

This , vs . is often a problem, because my bank will issue tables with , used as decimal separator, but copying that into some tool everything breaks because it expects . to be used.




his frustration stems from the fact that even after at least 50 years of software development the handling of number formatting (and add in dates for fun) is still something where time and time again software developers fuck up.

it is amazing, all those CS and other courses and still every new generation of (predominantly) US developers discover the fact that there is a world outside the US.

the most dominant data point to prove that software creation is still far away form being called a form of engineering. it's hacking, children throwing shit together then calling it "working".


Impossible to easily solve programatically. E.g. 400,123: what is it? You cannot know unambiguously.

And using OS language settings won't help either. Im from Europe but would not want to require using "," for the decimal separator enforced by OS settings, or anything related to programming or communicating with people on the Internet would become difficult.

I'd much rather have just everyone use the same convention for this. The C-locale convention for example. But for dates, please don't use the non-sorted American order. For dates the Japanese have it right :)


Or you could include these regional conventions in the character encoding, so that each file knows how it represent its numbers, and enforce them consistently throughout applications.

That would be a easy programmatic way to solve the problem, that wouldn't require the whole world to adopt a single standard. But of course it'll never happen, as it would require that all programmers know their shit and follow good practices, when it's much easier to throw the technical debt onto users and let them cope with the problem.


It would require to adopt a single standard, that is, how to encode that in the character encoding and the files. And it would still not stop someone from in the same browser for example using sometimes one notation, sometimes the other notation, depending on e.g. if they're filling in a form for a European bank, or something related to programming.


You mean, exactly like you do with character encodings for different alphabets?


>Or you could include these regional conventions in the character encoding, so that each file knows how it represent its numbers, and enforce them consistently throughout applications.

So if I open a file in Notepad and type 400,123 (using the comma on my keyboard), what character encoding should that be done with?


The one that Notepad has configured by default in your OS version, unless you choose a different encoding when saving the file.


"it is amazing, all those CS and other courses and still every new generation of (predominantly) US developers discover the fact that there is a world outside the US."

Best statement I've read on HN for months now.


That's led to one of the most marking bug I've had As a kid, I developed an education in software in visual basic. The software I had developed worked fine on my computer but when I installed it to any other computer it would fail.

It took me a long time to find out the issue. I was saving files in CSV using standards methods from Visual Basic. By default, the decimal separator in French is a comma. When Visual Basic saved a number in the CSV file, it saved it with the comma and without escaping or quoting. When the file was read back, the decimal part of the number was thought to be another column...

The only reason, it worked on my computer is that I had set up the decimal separator to a dot there because I found it more readable.


http://en.wikipedia.org/wiki/File:DecimalSeparator.svg

It's actually pretty interestingly split, world-wide.


British 18-19th C ___domain versus everyone else. Only Central America and Thailand buck the trend, the former most likely because of the enormous economy to their north.


You really don't need to take some developers not knowing this quite so personally.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: