5 ms·
Well what's more readable, .8675309 that is understood to have an implicit zero, or the parser giving up and unexpectedly making it a string? Maybe it's not you
by xelamonster 2y ago
Well what's more readable, .8675309 that is understood to have an implicit zero, or the parser giving up and unexpectedly making it a string? Maybe it's not your preference but I can't see any problem with making this more robust. The trailing one is strange to me but leaving off a leading zero isn't unusual at all for written numbers in my experience.
- 404mm 2y agoIMO the implicit zero is just as much an issue in regular written form. The period could be overlooked quite easily, but seeing a leading 0, one will know what’s really going on. How could the parser see it as a string? This is not YAML and JSON5 still requires quotation marks.
- The_Colonel 2y ago> Well what's more readable, .8675309 that is understood to have an implicit zero Is it universally understood? I think it's a US / English thing. In my country I've never seen numbers written in this way and many people would not "parse" it mentally as 0.8675309
- efitz 2y ago[flagged]
- The_Colonel 2y agoWhat an extreme reaction. Many people would not be able to parse it since they've never seen a number written in this way, but you immediately write them off as assholes. Wow.
- efitz 2y agoIt will look funny to many people but they will be able to interpret it. Remember that this thread is in the context of whether to be strict or relaxed in a specific file syntax for files intended to be authored by humans.
- The_Colonel 2y ago> It will look funny to many people but they will be able to interpret it. You're still approaching this with the background knowledge of what this is. If you've never seen this, you can only guess, and there are a couple of options. I've been terminally online for the better part of the last 2 decades, yet I've seen this way of writing for the first time only ~5 year ago or so, and I still remember simply not knowing what it is. The first reaction is that it's simply a typo - the author mistyped - the dot should have been a digit or perhaps not be there at all.
- szszrk 2y agoStripping zero is not a common practice. You are clearly speaking of your own bubble here. For most of the world that is even more ridiculous than using dot as decimal space separator or writing dates with month not in the middle place. Even Americans I work with don't write it like that when doing quick draft discussion, as they know it's confusing to others.
- efitz 2y agoIt’s not about whether people normally write it that way. In the overall context of the thread it’s whether they ever write it that way.
- szszrk 2y agoFrom my perspective no one does. Ever. I only know it's a thing because I watched some math-related edu shows. Didn't even see that when I briefly worked in US.
- oneeyedpigeon 2y ago> even more ridiculous than ... writing dates with month not in the middle place Come on, let's be fair—nothing else will ever be as ridiculous as that!
- szszrk 2y agoI could maybe throw into the contest: - "a gallon". Not purely US thing but almost. It can be anything from 3.8 to 4.4 liters, depending mostly on what are you measuring. - writing digits. Is it "1", is it "7", is it "i", is it "l"? Why do it to yourself, while their printed fonts are pretty much the same as everywhere else...
- layer8 2y agoFor people who grew up in countries where comma is the decimal separator (and dot the thousands grouping separator), this is highly unintuitive, because it would seem much more likely to be a misplaced punctuation mark. It might be moderately intuitive to English native speakers because of oral usage like “point one three eight”, but that’s also not a thing in many other languages.