|
You do know that computers don't give a damn about data format so long as they know how to interpret it.
Why the DNS order is like it is? Truncation would make a good reason: it's as easy to truncate the front as the back (same, to, with masking, so far as that goes). If there's to be any controversy as to why either choice, I'd look at the every famous Motorola vs. Intel format for storage of numerical values:
Big Endian vs. Little Endian. Both work - so long as you know what's coming.
Now for the date formatting which I noted, above, one could argue that the US method is better if you leave off the year (not uncommon) for then it can be sorted naturally. The Euro-system is part of the same Obsessive-Compulsive disaster that brought on the metric system.
I draw your attention to the following that you may realize the error of your ways:
The Lounge - CodeProject[^]
and even in my youth, oh so many years ago,
The Lounge - CodeProject[^]
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
W∴ Balboos wrote: You do know that computers don't give a damn about data format so long as they know how to interpret it. In that sense, there is no difference between humans and computers. If you give a computer the date 9/11/2001 and tell it "Interpret this as a date in American format", or you do the same to a human, it comes out right. If you tell the computer the date 9/11/2001 and tell it "Interpret tis as a date in European format", you get a different result from the computer, and so you would from a human given the same instruction.
What regards DNS names: No, they cannot be truncated. You have to include everthing up to the TLD. Obviously, you could have a local address book for looking up the higher levels of the address, so that you wouldn't have to worry about the TLD and its immediate subordinates for your regular contacts - but there is no reason why you should use any part of the DNS name as the lookup key in that dictionary; you could use any identifier. Once you get to the DNS level, the TLD cannot be truncated.
|
|
|
|
|
You really don't get it:
YYYYMMDD can be sorted trivially, whether sorted as an integer or a character string (so long as the year contains 4 figures w.r.t. char sorting).
The computer can read any of the dates and the overhead for that is the same.
But, if sorting the dates, they have to be parsed/interpreted before sorting (or within a custom sorting function - same thing) - and the work is a lot harder . . . unless the formatting of the date is such that it's naturally in order without any parsing/interpretation.
As for truncation of DNS - it's something you mentioned. The DNS masks would seem to be a hint as to how things are more likely done - although I'm no expert in that field. Handling native sizes, however, is what will happen in the system, anyway - so (originally, in those days) a 32 bit value is going to be a 32 bit value as it's passed through the 32 bit system/CPU. Unwanted values would be masked, not truncated. But I'll let you claim expertise in that matter.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
"Trivially" under a number of conditions. You state one of them yourself: The year must always be specified in a four digit format. That isn't always done (look at the expiration date of your plastic card!).
Second: People find an 8-digit sequence hard to read, and won't accept that machine oriented format you specify, but split it up. One date split with slashes, 2001/09/11, and another with hyphens, 2016-05-26, do not sort trivially (beyond the year) until you remove the separators that you simply must allow for readability.
And then pops another issue up: 2016-5-16 will not trivially sort correct with 2016-05-26.
Many people do not number months in their daily life, but would like to write 2016-May-26. Then you mess up the soring completely...
As long as you insist on forcing onto ordinary people what they don't want, but you insist that it suits the computer better, you end up like the Linux success on the desktop: People choose something else, something that matches their preferences and conventions better.
|
|
|
|
|
First, the hypen and slash delimited versions of YYYYMMDD still sort trivially as text. But let's get to the real point.
Go back to my original posting (reply) way up at the top of the thread. I said I use YYYYMMDD .
You can come up with any number of ways that things won't work - but if they don't follow the above then their relevance is, well, none.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
W∴ Balboos wrote: First, the hypen and slash delimited versions of YYYYMMDD still sort trivially as text. Sure - as long as everybody uses the same separator. But not everyone does.
Finding a truly trivial sorting problem is not a trivial task... Especially not in multi-national environments. You believe that alphabetic sorting is trivial? What about a common Scandianvian telephone book with Norwegian and Swedish names? The Norwegian alphabet goes ...wxyzæøå, while the Swedish goes ...wxyzåäö - the ä and æ are (from both sides) considered the same letter, as is ö and ø. So where should å be sorted: Before æø or after æø?
Or French, where you sort by the alphabetic character as the primary key, but two words differ in accents (which quite often is the case in French), they are not identical, and the sort order of the accents, as a secondary key, is well defined. Or Spanish, where certain double letters are sorted as a single letter, but not in an identical manner: I believe (disclaimer: I cannot speak Spanish myself) that ll is one case: The double ll is sorted as a if it were a single letter between l and m in the alphabet.
These details does not relate to your highly "synthetic" format that is not acceptable for use by common man. It is nothing but a lab prototype. That is what I wanted to stress as "the real point".
We could simplify sorting of dates by using the day number of the year - abandoning months and day within month completely: Problem solved!
Or we could use Unix epoch: Geek & Poke, 20081221[^]
(For those who have not yet discovered Geek & Poke: That is the greatest source of computer geek humour I have ever seen!)
Obviously, a list of eight digit decimal numbers can be trivially sorted. But is is about as useless as sorting a ten digit number such as 1229883309. Well, not quite, but if people won't accept that eight digit decimal number, then it is of no help that it will trivially sort.
|
|
|
|
|
Really? Is the metric system a disaster? So you consider that using fractions of 10th
0.001 mm = 1 micrometer
1 mm
10 mm = 1 centimeter
100 mm = 1 decimeter
1000 mm = 1 meter
1000000 mm = 1000 mt = 1 kilometer
is a mess? Vs
1/2", 1/4", 1/8"....1/64".. 1/256", 1'-3/16", 23 yards 2' - 5/32"
1 mile = 1760 yd???;
1 yd = 3 feet???;
1 feet = 12 inches???
1760 - 3 - 12 Really?
I really don't think the imperial system is much clear to a person that never have used this measurement system. The other one is much logical to our brains. Maybe the base-10 numeric system is not the best, but we at our actual civilization adopted it (Including the imperial units users), maybe because we have 10 fingers on our hands?
For whatever reason, our occidental brains think in 10, so I think that the metric system is an approximation to our feeling, not a disaster!!
|
|
|
|
|
You seemed to have missed the point.
This is CP - we do computer stuff (and some drink Gin).
The weights/measures I specified are all powers of 2 - very computer friendly for inter-conversion.
On a historical basis, note that you happen to use base ten for that metric trash because you've ten fingers. For a century or two, those more enlightened[^] (i.e., they didn't need to count on their fingers) argued for a switch to base-12 for everything.
The reason?
10 has two factors besides itself and one: 2, 5
12 has four factors: 2, 3, 4 and 6
The factors are used in more typical human-friendly transactions 1/2, 1/4, 1/3, for example.
So, you guys keep counting on your fingers whilst we embrace our current reality and look to the future!
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Base 12 would indeed be better than base 10 for "normal" usage, but you forgot to mention that it's also more directly related to cyclic or sinusoidal measurements. Why? The most common angle measurement factor is 15 degrees e.g. one twenty-fourth of a circle. All of the common fractions of cyclic measurement are multiples of 15 degrees, or twenty-fourths of a circle (or twelfths of a half-circle).
But regardless, the metric family of measurement systems is superior not because it uses base 10, but because it uses a COMMON base for all measurements. If that base were 12, and our numbering system were also base 12, it would remain superior to the clapboard mosaic that is the English/Imperial/American "system" of measurement.
|
|
|
|
|
tl;dr everything yet, but here is my 2 cents so far:
I agree that a base 12 number system would be best, 1/3 would be represented as 0.4.
I think the word you wanted was claptrap.
As to the American date format, I think it follows our speech pattern. In the original example we would say "May twenty fifth", so in England and Australia do you say "Twenty five May"? (I think I have heard this before).
As to Metric vs English/Imperial/American we have a saying 'There are 2 kinds of of nations, those that walked on the moon and those that use the Metric system' (I kid, I think NASA has always used Metric).
|
|
|
|
|
As an engineer, I get to be fluent in both systems. Conversions between the two can get you into a lot of trouble - NASA lost a Mars probe because of it. I MUCH prefer metric/SI units, even though I still use English/Imperial in everyday usage and for some professional terms; altitude in feet, speed in knots, weight (NOT mass) in pounds. And don't even get me started on Fahrenheit vs. Kelvin and affine spaces ...
The nicest thing about SI from my point of view is that when you make a mistake, you're off by one or more orders of magnitude, and it's easy to notice. With English/Imperial, errors are often not so apparent.
More than once I've tried to explain to a fellow (but not computer savvy) engineer that 0.4 (decimal) is a repeating fraction in binary. Base-10 floating representation in binary causes all sorts of issues for numerical methods which are not unlike unit conversions.
|
|
|
|
|
And for dates, either DAY MON YEAR, where MON is a three letter abbreviation (25 MAY 2016), or YEARMONTHDAY(20160526), sometimes with time appended, which sorts numerically very nicely. And always add the leading zero in either case.
|
|
|
|
|
Natural sorting is only advantageous to computers, and they don't deal with partial dates. I can't remember ever needing to write code that handled dates in the form of strings that didn't even include the year. So that's not really a bonus.
Come on, admit it: the US convention simply makes very poor sense - a fact supported by the fact that almost the entire rest of the world does it the other way round.
Also, the metric system is great, not sure what you've got against that as well.
|
|
|
|
|
You really love the context of d/m/y. Be here (in the leading English speaking nation in the world) we would say something like May 26th 2016. M/D/Y . In other words, it's the natural translation of language. Of your native speech works differently - enjoy - but don't tread on me.
Note that the common speech of the world is becoming English - because (unlike the French, for example) we welcome into our language all the various and colorful extension that keep enhancing its expressive nature. You will be assimilated !
So - get with the program: 1, 2, 4, 8, 16, . . . the power of powers of two!
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Actually we - that is, the British - often say it that way too, although it is more common to say it as M-D-Y, especially when including the year. But my point is that basing a written, numerical short-form notation purely on natural language (which is variable anyway), without posing some kind of logical order on it, is the very basis of why the US convention is a bit daft.
By the way, I already speak English (of the Queen's variety), and it seems highly unlikely that the American short-form date notation will ever become the global norm, so I'm not sure what assimilation you're referring to..
|
|
|
|
|
public obj CulturalModification(obj everything) {
Absorb(everything);
obj muchBetterVersion = Modify(everything);
return muchBetterVersion;
}
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
So why hasn't the US absorbed the much better date notation that the rest of the world uses?
|
|
|
|
|
Because most Americans have no idea of geography outside the US borders. In many cases inside the US borders either.
As if the world outside doesn't really exist, so whatever they use is perfect. Imperial measurements instead of metric for example. Beer that resembles diluted water. Cars that scream in pain when shown a bendy road. A plate that only looks a reasonable size when it contains a meal for four.
Confuse 'em back and use ISO format!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Silly person. Most of your complaints about our commodities are, well, ill founded at best and generally without merit.
As for not knowing geography outside the US - well I used to complain about that, myself. Until now, that is. Now that I stream news from all over the world I realize they were absolutely correct.
There's nothing of importance beyond the ocean shores of our glorious continent.
Where's m'gun at?
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
W∴ Balboos wrote: Where's m'gun at? I think we should take a vote on where it should be.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
|
OriginalGriff wrote: Because most Americans have no idea of geography outside the US borders.
I thought the world was flat and you fell off the edge in a giant waterfall if you sailed past the horizon. And north was just frozen wasteland, and south was just desert wasteland.
Marc
|
|
|
|
|
It isn't????
Paulo Gomes
Measuring programming progress by lines of code is like measuring aircraft building progress by weight.
—Bill Gates
|
|
|
|
|
You forgot to mention miles per gallon. Not only does it use imperial measurements, it also deviates from the UK measure by the same name.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
Stefan_Lang wrote: You forgot to mention miles per gallon. I was always fascinated by this approach, which I see as very 'American Style': I've got some resources (i.e. gallons of fuel) that I am going to exhaust - how much fun will it give me?
The European approach is the other way around: I've got a task that must be performed: Driving 100 km. How much fuel is that going to cost me? ... not 100 km pr liter, but liter per 100 km.
I do think that this says something about American philosophy as compared to European.
|
|
|
|
|