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.
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.
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
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.
I'm truly torn with this. The first one seems sensible (action -> target) and easier to read and reason about (especially with long names), while the other one looks more organized, naturally sortable and works great with any autocompletion system.
I prefer everything to be how you would read it as text. So create_file_dialog it is. Honorable mention is to have it namespaced in a class or something which I think is best. file_dialog.create or dialog.create_file or even dialog.file.create
I agree. I say open door so the function should be named openDoor.
Honestly nowadays none of that matter if you're using any remotely modern IDE with good indexing and a sensible search, you can start typing however you mind works and it will find it no matter how it's named.
Your team needs to have a coding standards meeting where you can describe the pros and cons of each approach. You guys shouldn't be wasting time during PR reviews on the same argument. When that happens to me, it just feels like such a waste of time.
I used to like the action followed by direct object format, until some time ago when trying to find methods or variables related to a specific object. If the action comes first, scanning for the object without an IDE means first reading unnecessary information about the action. That convinced me to opt for $object-$action in situations where it makes sense.
For example in CSS, I often scan for the element, then the action, so $element-$action makes more sense. BEM kinda follows this. When dealing with the DOM in JS, that makes sense too button.fileDialogOpen(), button.fileDialogSend(), ... makes more sense when searching.
Of course one has to use it sensibly and where necessary. If you are writing a code that focuses more on actions than objects, putting the action first makes sense.
I find this much easier to follow than if main were defined last, because main is obviously the most important method and everything else is used by it. A flattened dependency tree is how these definitions make sense to me or how I would read them as newbie to a codebase.
I keep asking myself what to choose, only for changing it a day after cursing myself to choose a stupid name.
Big endiant is great for intellisense to quickly browse possibilities, since it groups it all in the same place. But that's also a detriment when you know what you want. You can start typing without the prefix but you'll have to go through the better suggestions of intellisense first.
Little endiant is the same thing, but in reverse. Great when needed, but bad for browsing.
Although I do have some fix I'm starting to use. But it's not applicable everywhere, and not in every language.
What I do is use module as prefix. Instead of dialogue_file_open, I create a file_open in the dialogue module, allowing either directly calling file_open, or dialogue::file_open. Using intellisense on the module allow for easy browsing too!
Although in OP's post I'd rather have file_open_dialogue as it convey the more significant meaning, being to open a file, first. Then "dialogue" is just the flavour on top
Big endiant is great for intellisense to quickly browse possibilities, since it groups it all in the same place.
If only someone would train a program… we could call it a Large Language Model… to knowingly group the names together so we wouldn’t have to choose between human-readable format or dB format.
Guess that will never happen because instead we’re stuck using “AI’s” to inflate stock prices instead. /s
I remember seeing a proposed language that would allow each programmer to choose what name to use for each item. Don’t like ‘open_file’? Choose to see it as ‘file_open’ every time you review the file in the future.
While we battle with each other endlessly, we keep forgetting that the computer doesn’t care.