4 ms·
So you have to distinguish between output meant for a program and output meant for human. That pretty much defines my career, yes. Say someone gives you a log
by mikestew 11y ago
So you have to distinguish between output meant for a program and output meant for human.
That pretty much defines my career, yes.
Say someone gives you a logfile of problematic transactions - you then have to convert all the numbers to decimal points before using them in some one-off program that checks them.
Say someone gives me a MongoDB full of transactions that need to be transformed into relational data for our data warehouse...hey, I'll bet I could make a career out of this.
I truly don't mean to be trite, but what you describe is just the way of things. In your log file example, a regex would more than likely solve the problem. One loop, a readln() and a writeln(), sorted. People do it everyday. Hell, I'll probably do something similar before the day is out.
- ars 11y agoI'm not trying to be annoying - I'm simply curious. I never had to deal with that (internally that is, I do localize for end users - but that data is one way), and I was wondering how people handled it, that's all. Sounds like it's a bit annoying, but you just deal with it because you have to. I guess it's a slight extra use of time, but nothing major?
- nl 11y agoMuch, much worse is the US mm/DD/yyyy format, especially if mixed with DD/mm/yyyy format, unlabeled, in the same file.
- ars 11y agoSee, that's kinda my question. As a programmer I refuse to use anything except yyyy-mm-dd, unless I'm forced to. So do Europeans analogously refuse to use anything except decimal points, except where they have to?
- rasapetter 11y agoAre you sure you didn't mean to write yyyy-mm-dd?
- ars 11y agoI did, thanks I fixed it. (If you delete your post, I'll delete mine and we won't clutter the thread.)
- Symbiote 11y agoBritain and Ireland use the "American" way (presumably, it's actually the British way). Displaying English-formatted numbers is incorrect in the rest of Europe, and will confuse users. Programming languages handle this, but you still write pi = 3.14 in the code. Note 123.456,78 is German, but Swiss is 123'456,78. I think. (Displaying miles and yards, inches and 'letter' sized paper is also incorrect, but it's unfortunately not uncommon.)
- mikestew 11y agoOh, I'm not taking you as annoying at all. I'm just having a hard time sussing where you're coming from. As a multi-decade veteran of the industry, to me the answer seems obvious. I want to explain in appropriate terms, but I don't want to condescend, either. Anyway, to get to the heart of it, you just deal with it. I don't even find it annoying, it is what it is. It's like being annoyed by the fact that elephants have long noses. It is truly, after all, what most of us here do for a living. Whether it's slapping a one-off regex on a log file to get the currency format right, or sucking down JSON from a REST API and presenting it in a nice mobile UI to tell you when your Uber will be here, we take data and munge it, then put a pretty face on it. So were I to have to deal with currency formats in a text file that don't match what the machine expects, I just transform it appropriately without thought to "annoyance" or "inconvenience", just that it needs to be done.