News for hackers. Stuff that matters.
Re:How Developers Choose Names by ttiurani on Sunday April 18, 2021 @11:16AM (#26853181)
With naming what IMO matters more than choosing one name, is choosing a name that is consistent with other similar names in the codebase. A new developer will learn your project's specific convention in a few minutes, but will be completely lost if the convention is routinely violated here and there. This is especially important with what verbs to use in methods, and how to name interfaces/classes in a way that respects both the business domain and the techical use.

I've seen way too many times how much confusion is created and time wasted when a developer not too familiar with the project comes up with a brand new verb for a common action, and couples it with a new synonym for an existing business domain entity – or worse still, uses the same name previously meant for a completely different domain entity.

The unfortunate burden with this is that a new developer might be right that their name is better for their use case, which then leads to laboursome debates about which is more important: consistency or slightly crisper name for the one use case.

Re:How Developers Choose Names by hinkley on Sunday April 18, 2021 @11:44AM (#26853410)
You have to be careful with your definitions. Don’t use different definitions of the same verb/noun in different places. You get one. If you need another definition elsewhere, use a synonym.

It is not beneath you to hit thesaurus.com while picking a name.

Re:How Developers Choose Names by jeremydeanlakey on Sunday April 18, 2021 @12:07PM (#26853629)
A thesaurus is one of my favorite dev tools.
Re:How Developers Choose Names by joekrill on Monday April 19, 2021 @08:52AM (#26862179)
100%. I use RhymeZone and Wordnik more than I care to admit during development work.
Re:How Developers Choose Names by archsurface on Sunday April 18, 2021 @12:48PM (#26854035)
Naming gets far worse than that. I've worked on code where the naming was not just unhelpful, it was outright misleading. One of the worst I remember was a project which unsurprisingly was named after a game of thrones character. As I never watched game of thrones it took me about two weeks before I could even remember the stupid name, during which time I was also dumbfounded as to how the program worked until I realised the naming in the code was equally bad, completely misleading. Then there's the place where the stg1 environment was actually the dev0 environment...
Re:How Developers Choose Names by saurik on Sunday April 18, 2021 @03:52PM (#26855730)
When I was working on a small game startup back 20 years ago, I renamed our all the high-level projects of our codebase into specifically-ancient Greek and then left a "glossary.txt" in the root directory so people could brush up on their language skills... this did not last for very long ;P.
Re:How Developers Choose Names by dnautics on Sunday April 18, 2021 @01:57PM (#26854744)
One of the best coding interviews I had was an paired debugging session and the problem boiled down to a poorly named parameter at the beginning.
Re:How Developers Choose Names by 2muchcoffeeman on Monday April 19, 2021 @12:30AM (#26859114)
One of the worst I remember was a project which unsurprisingly was named after a game of thrones character.

I remember the era when sys admins would name machines or environments after nerdy shit like Tatooine, Dagobah. And you had to memorise which was the test environment and which was the mail server.

Thankfully I have never seen that in code.

Re:How Developers Choose Names by wsc981 on Sunday April 18, 2021 @01:56PM (#26854729)
> I've worked on code where the naming was not just unhelpful, it was outright misleading.

It's one way to achieve job security for life though: https://github.com/Droogans/unmaintainable-code

Re:How Developers Choose Names by scubbo on Sunday April 18, 2021 @02:10PM (#26854837)
> Then there's the place where the stg1 environment was actually the dev0 environment...

Hey, think yourself lucky. It's only a pretty recent occurrence that my team has more than just the two "Prod" and "Non-Prod" environments...

Re:How Developers Choose Names by aYsY4dDQ2NrcNzA on Sunday April 18, 2021 @05:12PM (#26856414)
Using the name “prod” for anything other than delivering code to external customers is one of my eternal pet peeves.
Re:How Developers Choose Names by jawns on Sunday April 18, 2021 @11:28AM (#26853301)
This goes double for APIs, and triple for externally facing APIs, where typically the people who are working with it aren't familiar with your code base or naming conventions.

That's why good API design is so hard. Every name you assign to something becomes a convention by default.

Re:How Developers Choose Names by vas1 on Sunday April 18, 2021 @11:28AM (#26853297)
Couldn’t agree more with this. Consistency is key even if the convention used is awkward
Re:How Developers Choose Names by jariel on Sunday April 18, 2021 @11:59AM (#26853554)
Yes, convention is more important that the quality of the convention. The convention abnegates the need to think about things, and for a developer, thoughts are precious.
Re:How Developers Choose Names by PicassoCTs on Sunday April 18, 2021 @05:20PM (#26856486)
With a good convention, even more important, structure can be derived and deduced, without reading the documentation. I love it, when i begin to grasp the structure of a codebase, write a line and hit auto-complete and the codebase was reliable. Functionname exists and parameters expected are served up. The code just feels so much more discover-able in such moments.