this post was submitted on 27 May 2024
717 points (97.9% liked)

Programmer Humor

19564 readers
513 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 

geteilt von: https://lemmit.online/post/3018791

This is an automated archive made by the Lemmit Bot.

The original was posted on /r/ProgrammerHumor by /u/polytopelover on 2024-05-26 21:23:20+00:00.

you are viewing a single comment's thread
view the rest of the comments
[–] rekabis@lemmy.ca 71 points 5 months ago (3 children)

There is a reason why little endian is preferred in virtually 100% of cases: sorting. Mentally or lexicographically, having the most important piece of information first will allow the correct item be found the fastest, or allow it to be discounted/ignored the quickest.

[–] deadbeef79000@lemmy.nz 26 points 5 months ago* (last edited 5 months ago) (2 children)

That's actually filtering not sorting.

That being said, it's more valuable (to me) to be able to find all my things for a topic quickly rather than type.

Foo_dialog

Foo_action

Foo_map

Bar_dialog

Bar_action

Bar_map

Is superior IMHO.

[–] rekabis@lemmy.ca 6 points 5 months ago (1 children)

If you are looking for Bar, it is highly likely that you are already looking specifically for a particular functionality - say, the action - for Bar. As such, it is irrelevant which method you use, both will get you to the function you need.

Conversely, while it is likely you will want to look up all items that implement a particular functionality, it is much less likely you are going to ever need a complete listing of all functionality that an item employs; you will be targeting only one functionality for that item and will have that one functionality as the primary and concrete focus. Ergo, functionality comes first, followed by what item has that functionality.

[–] deadbeef79000@lemmy.nz 5 points 5 months ago* (last edited 5 months ago)

We probably have slightly different work processes.

I'm more likely to be making "foo" functionally complete and then making "bar" complete than I am to be making all my dialogs functional then all my tabs/whatever.

This comes from TDD where I'm making a test pass for "foo", once done, I'll do the same for "bar".

Though it's even more likely these are different files entirely, rendering the arguments moot.

[–] red@sopuli.xyz 3 points 5 months ago (1 children)

I put all those in different files

compont/functions/foo.ext etc.

[–] deadbeef79000@lemmy.nz 2 points 5 months ago

Depends on the language's constraints, but yes: more smaller files please!

[–] Static_Rocket@lemmy.world 7 points 5 months ago

But also, sorting big endian automatically groups elements associated with common functions making search, completions, and snippets easier (if you use them). I'm torn

[–] 33550336@lemmy.world 3 points 5 months ago

I was going to write something like this. You actually wrote about semantic order, but syntactically it is as much important e.g. it is easier to sort dates such as 2024-05-27 than 27.05.2024 in chronological order.