Questions tagged [naming]

Give meaning and explanation with the fewest number of characters in a form that is most accepted by your team or community at large.

Filter by
Sorted by
Tagged with
5
votes
3answers
182 views

Word order for names [closed]

I'm working with a team of non-native English speakers and I'm struggling to come up with a rule that explains why a method should be called getFilePath and not getPathFile. Examples of this bad ...
5
votes
3answers
2k views

Naming the project containing only interfaces [closed]

I've extracted interfaces from my repository classes, like ICustomerRepository, IProductRepository and so on. The project which contains the repositories is named X.DataAccessLayer. Should I call the ...
5
votes
2answers
910 views

C# Names of Namespaces with version suffix

In official Microsoft docs: ✓ DO use a stable, version-independent product name at the second level of a namespace name. But in Reference Source, the following namespaces ends with Version: ...
5
votes
3answers
4k views

What should I name this helper class? [closed]

Usually when writing unit tests I create a helper class with extension methods. I use these methods exclusively for generating generic data for things that I am too lazy to type out. I usually name ...
5
votes
4answers
6k views

Can a method that must be overridden be considered private?

Suppose I have a class C with a method f() which is meant to be used only within C's implementation, but which should be overridden by C's subclasses. Is it reasonable, or "pythonic", to consider it ...
5
votes
2answers
577 views

Should duck typing affect naming conventions?

I'm a C++/C# developer and recently I've started to learn Python. I think I understand the concept of duck typing right now except for one thing. When I'm coding in C++ or C# I sometimes create ...
5
votes
2answers
2k views

Java-style package naming and second-level country domains

I own a .co.uk domain, and I whenever I've dealt with Java-style package naming, I've gone with uk.co.domainname. Once I encountered package that did the following: co.uk.domainname. Is one of these ...
5
votes
4answers
289 views

Variable name which sometimes refers to an object and sometimes to a string

Sorry for the confusing title - this is best illustrated by an example (hypothetical but hopefully illustrative). For 99% of my application a Zip Code is considered as a string, so I consistently use ...
5
votes
2answers
3k views

collection naming - singular or plural [closed]

This is related to this question but not quite the same. BTW, I'm not a native English speaker. I keep having a hard time choosing a proper name for collections - Lets say that we have a collection ...
5
votes
1answer
297 views

How to explain to your colleages to stop creating packages and classes named “Utils”?

In most of the projects at work it will eventually show up a package, a class (or multiple packages and classes) named "Utils", where every kind of function is dumped into. It becomes excruciating ...
5
votes
1answer
2k views

How should a ViewModel be named? [closed]

While starting work on a brand new ASP.net MVC application we've learned that we should have all of our available data pushed to make it easy to create a full view. While learning this we've started ...
4
votes
9answers
558 views

What is a widely accepted term for a string variable that would probably contain a file path and file name?

For functions that need to index files in a directory and rename them FileName0001, FileName0002, etc... I often need to write a function that splits the file name from the file path and rename the ...
4
votes
6answers
4k views

Naming conventions for variables [closed]

When programming, what naming conventions do you use for your variables? I don't mean when the name of the variable should be obvious; ie. sum, total, first, last. But when you name variables that don'...
4
votes
8answers
10k views

What is it called when you set properties on object initialization?

What is it called when you set properties on object initialization? var customer = new Customer() {RequestID = request.ID, AddressID = 5}; Is it considered good practice?
4
votes
2answers
1k views

Why do they name a program “mogrify” in Imagemagick? [closed]

I am not a native English speaker. Is there some trick in this name? What does it mean or imply? PS. I don't know whether this is the right SE site to post this question but if it is not could you ...
4
votes
4answers
10k views

Is it bad practice to use the same name for arguments and members? [closed]

Sometimes I write constructor code like class X { public: X( const int numberOfThingsToDo ) : numberOfThingsToDo( numberOfThingsToDo ) { } private: int numberOfThingsToDo; }; or in C# ...
4
votes
7answers
2k views

How to ensure quality of code? [closed]

I have been learning programming in C# for about a year and a half now. How should I ensure that the code that I am writing and the habits are forming are good ones? ie. I don't want to end up having ...
4
votes
4answers
917 views

Non-English Naming Conventions [duplicate]

Possible Duplicate: Do people in non-English-speaking countries code in English? I know that there are non-English based languages out there, where keywords are in some other tongue, but popular ...
4
votes
4answers
1k views

How can I deal with developers who don't use English in code? [duplicate]

Possible Duplicate: Code maintenance: keeping a bad pattern when extending new code for being consistent, or not? I'm working on a project for a Greek public organization, as a part for a course ...
4
votes
2answers
237 views

Name for a Chainable ForEach [closed]

Linq has a method Select, which takes a Func<TIn, TOut> and maps it over an iterable. I'm trying to come up with a good name for a method that takes an Action <TIn>, transforms it to ...
4
votes
1answer
251 views

What is a term for iterating over many functions with the same input?

When we call the same function on a list of things, we call that "map". What do we call it when we call a list of functions on the same data? I don't mean pipe - not feeding the output of each ...
4
votes
1answer
680 views

Why are there so many CSS properties which are essentially the same?

This answer really made me wonder. I've written CSS before and (usually) I don't really bother to support browsers other than recent firefox and chrome, but in researching I've noticed that, for the ...
4
votes
2answers
667 views

Choosing between words with different spellings for function names

A question has been bothering me for a while: when developing international projects, it is common sense to use English as the reference language since it is the language that the most people ...
4
votes
3answers
7k views

Same class and namespace name

I have a problem how to go about naming my namespaces and classes. I already figured they shouldn't both have the same name, as it causes all kinds of problems. Most notable problem for me is that I ...
4
votes
2answers
195 views

How should I name the fields in a class representing 2D and 3D sizes?

I'm working on a display library which in most cases works on a 2D plane but it has some components which display 2D projections of a 3D space. This domain has the notion of Position, Size, ...
4
votes
7answers
717 views

How can I expand my vocabulary to improve my variable names? [closed]

There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors. - Tweeted by Jeff Atwood Agreed. All software engineers can understand this. Choosing ...
4
votes
3answers
24k views

Why am I seeing more boolean naming conventions where “is” is used as the first word in the variable (eg, IsUserAdmin vs UserIsAdmin)? [closed]

I think everyone will agree that the following boolean variable/property names are standard: UserIsAdmin OrdersAreClosed The important thing to note about boolean expressions is that they are stated ...
4
votes
5answers
336 views

Is it good or bad form to name a function after the workaround it fixes? [closed]

Lets say you have to write some code to fix a bug that on first glance by another engineer would seem weird or unnecessary. Would it be good or bad form to put the code in a method named for example "...
4
votes
2answers
188 views

Are there any grammatic conventions on naming functions?

For example, I have a Selenium WebDriver and as part of my initialization I would like to check if I am able to instantiate it and start up browser. I can't come up with a proper name. Is there any ...
4
votes
2answers
211 views

Common loop variable names for indexes in 4D and above

I am curious if there are common loop index variables (of single character or not) for dealing with 4 dimensions and above? I was helping another student working through CS50x who was just learning ...
4
votes
4answers
2k views

naming convention for different types of functions (use prefixes or suffixes?)

Does anyone have suggestions for naming conventions for different types of functions, particularly wrapper functions that need to connect to and disconnect from the database vs. wrapper functions that ...
4
votes
2answers
324 views

Good abbreviations for XML … things

I've never been very good at maintaining a coherent bunch of variable names for interfacing with XML files because I never name the variables in my interfaces the same way across my source. There are ...
4
votes
2answers
4k views

Naming methods that do the same thing but return different types

Let's assume that I'm extending a graphical file chooser class (JFileChooser). This class has methods which display the file chooser dialog and return a status signature in the form of an int: ...
4
votes
2answers
835 views

C# Possible method name conflicts with optional parameters - why it is not forbidden? [closed]

Let's have a simple class, and main method: using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { ...
4
votes
3answers
262 views

Is it bad to use the same class or idiom names as in a third-party API that you're using?

FlashPunk is a third-party graphics API for simple game development in AS3, and they take what are effectively sprites or display objects of some sort and refer to them as "Entities". Entity is the ...
4
votes
2answers
2k views

How to name nested function? [closed]

When you have a function that wraps another one in Scala. What do you call the nested function? I found this : def factorial(i: Int): Int = { def fact(i: Int, accumulator: Int): Int = { if (...
4
votes
1answer
1k views

How to name filename parameter to make clear it should contain full path? [closed]

I'm seeking vital naming of string filename parameter in parameter list used in various methods where filename with full path is expected. In many cases also UNC path can be actually supplied as full ...
4
votes
3answers
185 views

What is a good rule-of-thumb for naming link-tables?

In the same way that a publication table might relate to a person table via subscriptions, or a company table might relate to a person table via employee, I'm wondering if there is a descriptive way ...
4
votes
1answer
1k views

Distinguishing between UI command & domain commands

I am building a WPF client application using the MVVM pattern that provides an interface on top of an existing set of business logic residing in a library which is shared with other applications. The ...
4
votes
2answers
106 views

Begin and Finish or Pre and Post in async call pair?

In an async call pair you would rather have a BeginDoSomething & FinishDoSomething or PreDoingSomething & PostDoingSomething pair? Cheers
4
votes
3answers
220 views

Is there a name for iterating between refactoring and feature development?

I'm working on a personal project and I've found myself switching between doing some refactoring for a day or two and then some feature-adding for a few days. I like it, and I noted it was similar to ...
4
votes
1answer
193 views

How do package managers generally deal with squatters?

How do package managers deal with packages that use a package name but then abandon it or from rogue package names that are similar that host malware in the hope that an unsuspecting developer will ...
3
votes
4answers
3k views

What do you call an iterator that returns the current, previous and next siblings of each node of a list? [closed]

What do you call an iterator that given a list [a, b, c], returns an object of the form { prev, curr, next } for each iteration? e.g, (? === undefined) { prev: ?, curr: a, next: b } { prev: a, curr: ...
3
votes
6answers
2k views

“As” Naming Convention [closed]

I'm experimenting with a naming convention I've devised and am seeking opinion. It involves the use of an "As" infix, and at this point I am envisioning it in the context of JavaScript, C# and C++ ...
3
votes
5answers
584 views

What happened to the this type of naming convention? [closed]

I have read so many docs about naming conventions, most recommending both Pascal and Camel naming conventions. Well, I agree to this, it's ok. This might not be pleasing to some, but I am just trying ...
3
votes
6answers
1k views

How to define a natural id in database?

There are a lot of manuals. I am trying to create an database to hold information of these documents. But, there is a small problem. How can I give meaningful id to the manuals? Are there any ...
3
votes
2answers
426 views

How to name a Boolean variable that represents either of two options?

I'm developing an application with Python. I want to have a Boolean variable that represent whether something is buy or sell but I'm not sure how I should name it. Here are my current ideas: isBuy ...
3
votes
5answers
344 views

Is naming a class based on its implementation acceptable?

Is naming a class according to its implementation an acceptable practice? e.g. SortedSet if the class is maintains a sorted list of unique items or TreeSet if it using a binary search tree structure ...
3
votes
6answers
4k views

Naming functions that retrieve a value

I have this personal rule to start all function/method names with a verb. My verb of choice for functions or methods that get a value based on some data structure or object is get. I'm wondering if ...
3
votes
2answers
28k views

Summary of C# naming conventions (official Microsoft conventions) [duplicate]

I am struggling with naming convetions in C# I do not know when to use PascalCase or camelCase. I have read Microsoft's naming convention, but I got lost ther http://msdn.microsoft.com/en-us/library/...