Hacker News new | ask | show | jobs
by jdg1 4057 days ago
"You can fucking strip the leading $ and commas you piece of shit mother fucking asshole terrible programmers."

That sounds sensible, but now you've just broken it for every country that uses comma as a decimal mark.

3 comments

My favourite was a recent banking webform which refused to recognise "0". Apparently it's not a real number. When I got through to support, they explained I had to leave the box blank to represent zero...

Mind: Blown.

It's because the data will eventually need to be fed into a mainframe that predates the Arabic numeral system.
I live in the USA and have a credit card issued by an American bank. When I pay my bill online, I want the $ and comma to work like I've known they work ever since I was in first grade over 50 years ago.

I don't give a fuck about how the rest of the world does numbers and banking. That's their problem. If the UK were still using guineas and shillings, should I care about that?

No. Deal with foreign currency problems on their websites. If the rest of the world wants to use commas and periods backwards from the way we do, then solve that problem for them elsewhere. Don't make my life difficult just so you can use the same code for a website in Elbonia.

The rest of the world's problems are not my problems. Solve them, or don't. But don't make my life hard because you're* too fucking lazy to do the right thing.

Computers should exist to make peoples' lives easier. People shouldn't be required to make programmers' lives easier.

/rant off

*not you personally, I don't know what you do, it's just an indefinite pronoun

But they know you locale and could do the right thing. Is not at all hard.
That's assuming users aren't resetting their locale. It's not uncommon for non english users to assume that the english version of a site is the real deal and their version is an inferior localization done by some backbenchers at whatever company made it.

For example, here's a story about how the majority of power users in Poland use an english keyboard with specialized key bindings, because using a polish keyboard marks you as a n00b: https://medium.com/medium-eng/the-curious-case-of-disappeari...

It's. Lazy. Programming.
Laziness is a virtue for programmers.
Yes. And folks have been trained to think that everyone not coding for en-us is double lazy.
There are several different ways, say a currency dropdown, that could hint on how to parse free-text input.

However, blaming the user for doing what makes sense is not helpful.

I think we're in violent agreement here - I'm trying to get across that "just use locale" doesn't necessarily mean that you're done your UI.
Even without knowing the locale, it pretty easy to know which are NoOps and which mean something.
How?
Number of digits, positioning of the , and .'s - its money which gives some nice constraints.