redcalcium ,

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.

kunaltyagi ,

We need a new framework, one that allows universal lookup, and makes life easier

x = _.dialog.file.open
y = _.open.file.dialog
z = _.file.open.dialog
a = _.file.dialog.open

Once done, the formatter simply changes everything to _.open.file.dialog

Let's get this done JS peeps

\s

_g_be ,

Insert xkcd about 15th format

Rainb0wSkeppy ,
And009 ,

Not a programmer, but I'd prefer right naming convention because sorting

Lightfire228 ,

I am a programmer, and i also like the naming scheme on the right

Especially for things like filenames

bitwolf , (edited )

Also a programmer and think method names would be conducive using little endian.

TopicGet()
TopicCreate()
TopicDelete()

Writing this I realize we do this implicitly in some instances.

http.Get() -> httpGet()
http.Post() -> httpPost()
evatronic ,

I do one, the other senior dev does the other. We fight about it in pull requests.

livingcoder ,

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.

nikaaa , (edited )

This sounds like the typical plot of a story from The Codeless Code.

Edit: How about this story specifically?

Agent641 ,

I just name my variables a, b, c etc. If I have more than 26 variables in any given function, I name them aa, ab, ac, etc.

gandalf_der_12te OP ,
@gandalf_der_12te@discuss.tchncs.de avatar

you're on a highway to hell.

dariusj18 ,

Be php, mix and match

gandalf_der_12te OP ,
@gandalf_der_12te@discuss.tchncs.de avatar

let the chaos reign

cupcakezealot ,
@cupcakezealot@lemmy.blahaj.zone avatar

the people who chose the first one...who hurt you?

habl ,

I will

MechanicalJester ,

No one, it just makes sense.

You must be one of those
"Throw your mother downstairs, the box of tissues" types.

Yoda sounded normal to you I bet.

loudWaterEnjoyer ,
@loudWaterEnjoyer@lemmy.dbzer0.com avatar

It makes sense until you write 30 methods to manipulate the data layer.

Lifter ,

Fuzzy search solves this pretty good

Swedneck ,
@Swedneck@discuss.tchncs.de avatar

reverse polish notation time

lightnsfw ,

Powershell

crispy_kilt ,

First of all, it's spelled dialogue

Sotuanduso ,
@Sotuanduso@lemm.ee avatar

Two wars can exist simultaneously.

stufkes ,

OP's username is in German, so it's probably half-German-English code

crispy_kilt ,

Germans learn UK English

stufkes ,

Dialogue is UK English. But I just looked it up and apparently 'dialog' is a computer term, but should not be used on its own but rather in combination, such as 'dialog box'.

smeg ,

Americans sadly got there first and defined all the computer terms, that's why it's a TV programme but a computer program. I can deal with that though, helps distinguish computer things from real things!

lorty ,
@lorty@lemmygrad.ml avatar

I know the second one is better, but I also know I'm terribly inconsistent with this stuff.

nexussapphire ,

Been learning to program and I'm refusing to use an lsp for the time being. I'm bad about using abbreviated names when I have to type over and over again(no auto complete). I'm at least using descriptive names for functions I use less than four times.

Hazzia ,

Can't remember which is which but if it's organized in a top-down way (broad category first) that's just easier to look at and find stuff in the file system. I don't want to have to actually read and mentally process the names of every single file to figure out if it's the one I need. Sure, the "human readable" names are fine and good when you don't have hundreds of them you're trying to look through, but big projects I find are way easier to parse with the category naming.

ooterness ,

US Army logistics catalogs are organized this way. "Cookies, oatmeal" instead of "Oatmeal cookies" because it's a lot easier to find what you need an a giant alphabetical list.

blanketswithsmallpox ,

How any large organization gets away with not using YYYY-MM-DD format is beyond me.

Taking over some of my previous directors files is like chaos.

How anybody publishing entire internet memos without a date being on the first page is beyond me. Like wtf am I reading a PDF from 15 years ago or last month?

rockSlayer ,

Create a file handler class to avoid the issue

magic_lobster_party ,

Eww, that’s OOP

deadbeef79000 ,

Meh, a class is just a struct of function pointers.

nikaaa ,

FileDialogFactory

rekabis ,

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.

Static_Rocket ,
@Static_Rocket@lemmy.world avatar

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 ,
@33550336@lemmy.world avatar

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.

deadbeef79000 , (edited )

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 ,

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 , (edited )

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 ,
@red@sopuli.xyz avatar

I put all those in different files

compont/functions/foo.ext etc.

deadbeef79000 ,

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

MrOxiMoron ,

A third option there is

mexicancartel ,

A fourth there option is

PenisWenisGenius ,

sjajvxuwjdofgwu

AjsgGhS77bndugxg

gehshagfahcdvwjdvwjd

AjsgGhS77bndugxg (2)

Opisek ,

A fifth option there is

PenisWenisGenius , (edited )

New file

New file (2)

New file (3)

New file (4)

lunarul ,

open_dialog_file or dialog_open_file?

olafurp , (edited )

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

brunofin ,
@brunofin@lemm.ee avatar

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.

jjjalljs ,

I worked at a place where all the DB column names were like id_user, id_project. I hated it.

ShortFuse ,

I didn't really care about this thread until I read this comment.

RustyNova ,

I don't know and that's the problem :(

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

oldfart ,

For me it's simple.

Pseudo-OOP in C which takes dialog* as a forst argument? dialog_open_file

Otherwise - make it human readable

sudo42 , (edited )

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.

morrowind ,
@morrowind@lemmy.ml avatar

Where's file_dialogue_open

janAkali ,

To be fair, it's also missing open_dialog_file, dialog_open_file and most crucially file_open_dialog

xmunk ,

We're all trying our best to ignore the Americans and you bring up m/d/y... why!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • kbinchat
  • All magazines