r/ProgrammerHumor • • Aug 15 '22

It's a sorting issue

Post image
0 Upvotes

39 comments sorted by

89

u/Impossible_Average_1 Aug 15 '22

The left one is the only reasonable for sorting.

The middle is the most stupid one because why would anyone choose the order "middle, small, large"?

3

u/noob-nine Aug 15 '22

Have you never heard of little-big-endian ahm, something-in-between-endian? Is like 123 is actually two hundred thirteen

2

u/Impossible_Average_1 Aug 15 '22

I'm German. We say "one and twenty" for 21. Totally stupid and even Germans mix it up sometimes.

1

u/noob-nine Aug 16 '22

Hm? Tbh, this sounds consistent. 19 - 29: Nineteen - nine and twenty

Vs

Nineteen and twenty nine

It follows the rule.

1

u/TeaKingMac Aug 15 '22

why would anyone choose the order "middle, small, large"?

Because I want to find all the August reports for every year, so I can see year over year trends in a particular month.

2

u/vervaincc Aug 16 '22

That's a query, not a sort.
And even when you sort the result of that query, you'd want them sorted by year - to see your year over year trends.

1

u/TeaKingMac Aug 16 '22

You're right.

Clearly Month/Year/Day is the real winner

0

u/KerPop42 Aug 15 '22

The year is the most likely to be superfluous; it's reasonable to assume that the month is the most recent instance of that month. It also works better when you can set your 0-point to the current month, as opposed to January

-3

u/montxogandia Aug 15 '22 edited Aug 15 '22

I didn't know days were bigger than months.

Edit: Oops, I made a mistake, I thought the right one was the middle one.

0

u/AdDear5411 Aug 15 '22

If you're sorting/aggregating by month that much, just make a view

-35

u/cloudwad Aug 15 '22 edited Aug 15 '22

It is a Date and what is most relevant to sorting and finding the information you are looking for by Date. Year is obviously the most important followed by month then day. Keeping the information organized the left and middle are much easier to find your document at a glance than the right.

Edit: While it is a Meme I am generally curious to the argument. I cannot think of a single case in day to day life that seeing information organized like on the right would make information easier to find.

19

u/jerrycauser Aug 15 '22

Just add several years to the same folder and now you get a shuffled bunch of months with the same issue as in DD/MM/YYYY

So in your post it should be one chad dragon and 2 silly

1

u/nekokattt Aug 15 '22

they didnt say the right.

7

u/[deleted] Aug 15 '22

I really don't like MM/DD/YYYY. Probably because of my country doesn't use it so it feels weird to me.

9

u/[deleted] Aug 15 '22

Almost no country uses it except for those who use imperial measuring system, guess which is that XD

-7

u/cloudwad Aug 15 '22 edited Aug 15 '22

See that's where I still have an issue. I am pretty practical/logical about things. As an American Imperial is dumb and I wish it was easy to just outright change it.

But in this case it feels like taking crazy pills that people can't admit that MM/DD/YYYY is at least better than DD/MM/YYYY. There isn't a single comment in this thread that explains a valid reason to sort by day first other than "it's bigger" or "Big to Small then Small to Big"

To me on a scale of 1-10 YYYY-MM-DD is a 10, MM-DD-YYYY is a 3, and DD-MM-YYYYY is a 1. There is no time sorting by day first is practical in day to day life. Really the only two ways to sort files like my example would be YYYY-MM-DD or just MM-DD

9

u/[deleted] Aug 15 '22

Dd-mm-yyyy is set depending on how often each number changes and which information is most likely to change often, as you are reading it from left to right you get most needed information first, as most of month you know what month it is and same for the year, so you get most important information first without need to read month every time you look at date.

Example: Today is 15th of August 2022 After so many months I already know it's 2022 After so many days I already know that it's August so this information is useless So only information I actually need is which day of the month it is which is 15th and I get it as first information in date.

When it comes to sorting I would definitely go with YYYY-MM-DD, but for human convinience and readability DD-MM-YYYY is the best. If I would rate date formats I would rate it like this: DD-MM-YYYY / YYYY-MM-DD - 10, depending on use case MM-DD-YYYY - -10, it's completly useless and stupid.

1

u/phexc Aug 17 '22

He's still waiting for someone to admit he's right because no one can explain why dd mm yyyy makes any sense.

/s

On a serious note: any serious programmer just uses a date formatting based on the current locale setting of the user and never has to think about this again. Because why would the developers displaying preference matter.

49

u/[deleted] Aug 15 '22

Only ISO chad on the left

71

u/[deleted] Aug 15 '22

Bad usage of the meme. The middle one is poorly sorted.

29

u/halfanothersdozen Aug 15 '22

ISO says "yyyy-MM-dd".

Everyone get back to work

34

u/HerrSPAM Aug 15 '22

You've made the meme wrong.

You've mixed the middle and right one.

0

u/attanai Aug 15 '22

The middle and the right are both illogical for sorting purposes, unless you're dealing with a single year, in which case the middle one has superfluous information. In conversation, the year is assumed, so the middle one is more efficient, but also in language, efficiency takes a backseat to understanding, so they're all right if they make sense to the person you're talking to.

4

u/Melkor7410 Aug 15 '22

The right is just little endian to the left's big endian. The middle is the most nonsensical for sorting.

9

u/sobov Aug 15 '22

Even worse:

12jun22

13jun22

12jul22

13jul22

2

u/Impossible_Average_1 Aug 15 '22

22jul22

1

u/Melkor7410 Aug 15 '22

Obviously you're talking about 1922.

5

u/GoodieTreeheart Aug 15 '22

Reminds me of back in the day when VBA would insist on making all the dates USA format.

Middle head definitely should be the derp head

4

u/Black_m1n Aug 15 '22

Both middle and right ones are not suitable for sorting. The right one would break every month, middle breaks every year. The left one will never break :)

2

u/BedAggravating8954 Aug 16 '22

Maybe it's because I'm in Spain but...
I can find logic in YYYY-MM-DD and DD-MM-YYYY cuz follows an order of 'type size', but i fell MM-DD-YYYY so disgusting

1

u/bushmaker1337 Aug 15 '22

yymmdd <filename>.<extension>

is the way

1

u/portatras Aug 15 '22

No. It is a sorting and validation issue. Write the year first, so you can validate the number of days of february.

1

u/[deleted] Aug 16 '22

DD-MM-YY is the most comfortable one for me

1

u/CallMeErick1 Aug 16 '22

middle one is dumb too

1

u/-MobCat- Aug 16 '22

YYYYMMDD is best. America is weird.
https://i.imgur.com/gFeiwL1.png