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

learn more… | top users | synonyms

9
votes
2answers
1k views

What does Uncle Bob mean by 'noun phrase names'?

I am reading Clean Code by Uncle Bob. Because I am not a native-English speaker, I couldn't understand following statement: Classes and objects should have noun or noun phrase names like ...
13
votes
9answers
5k views

Data structure for accessing units of measure

TL;DR - I'm trying to design an optimal data structure to define units within a unit of measure. A Unit of measure is essentially a value (or quantity) associated with a unit. SI Units have seven ...
2
votes
3answers
991 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
3answers
2k views

What Http verb should the route to log out of your web app be? [closed]

Browser support issues aside, if you're being an Http/hateoas stickler what verbs should the request to log into/out of a site be? DELETE would seem like the obvious choice but I'm not sure what the ...
21
votes
2answers
3k views

Boolean Method Naming Affirmative vs Negative

Should boolean methods always take the affirmative form, even when they will only ever be used in the negative form? Say I wanted to check whether an entity exists before creating one, my argument is ...
25
votes
4answers
31k views

What's the dominant naming convention for variables in PHP: camelcase or underscores? [closed]

The consensus seems to be that one should follow the convention of the platform they're developing for. See: Underscore or camelcase? Naming conventions: camelCase versus underscore_case? However, ...
-1
votes
1answer
154 views

Naming a class that does Importing and exporting of data

I've been thinking about creating a class that handles importing and exporting of data, and I feel that naming it FooImporterExporter might look too long, I wan't to see if there's a name convention ...
9
votes
1answer
439 views

Naming of related classes and interfaces

I have created an ObjectParser class which parses data into strongly typed objects using an IObjectParserDataSource as the data source (the data could be an Excel file, text file, array, query string, ...
4
votes
1answer
264 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 ...
6
votes
1answer
301 views

Term for a Class with Multiple Interfaces

Say I have a class that implements multiple interfaces. I pass the same instance around using a different interface, depending on what the consumer is interested in. I am trying to remember what this ...
3
votes
2answers
396 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 ...
18
votes
4answers
2k views

The problems with Avoiding Smurf Naming classes with namespaces

I pulled the term smurf naming from here (number 21). To save anyone not familiar the trouble, Smurf naming is the act of prefixing a bunch of related classes, variables, etc with a common prefix so ...
3
votes
4answers
631 views

Derived Class Method Naming

I'm having a hard time coming up with a good naming convention for methods in derived classes that serve the same purpose as the methods in the base class. For example, if both the base class, and the ...
3
votes
3answers
228 views

Is it correct to exclude argument names from function prototypes?

I was recently creating a small technical documentation for an application. The document is to be used by newly hired programmers to get acquainted with the application. It is much friendlier than the ...
3
votes
2answers
430 views

Is there a name for this design pattern? [closed]

I don't like singletons, but I have to compromise now (but only as temporary measure). However I don't want to go completely singleton. I'd rather want to use this pattern: interface ...
1
vote
3answers
581 views

Is there an accepted name for a fake object injected via a preprocessor seam?

I am dealing with some old, sloppy C++ code in which there is a structure with a lot of data members and functions. I want to test a class that I have implemented which uses the struct, but this ...
11
votes
2answers
755 views

The suffix Exception on exceptions in java

Specifying a suffix of Exception on exception classes feels like a code smell to me (Redundant information - the rest of the name implies an error state and it inherits from Exception). However, it ...
0
votes
1answer
782 views

Is C# namespace should be Project-Name? [closed]

I am working with multiple websites (freelancer) and a good amount of them I write using C# MVC4. I created a very good boilerplace project that I plan to use on every next starting mvc4 application ...
0
votes
5answers
257 views

Naming for a class that consumes an iterator pattern [closed]

The iterator pattern is very clearly defined. What would you call the consumer of an iterator?
2
votes
2answers
375 views

organising classes / folder structure for TDD-based development

Due to test-driven development, one ends up with many classes doing just one thing. It is quite a headache just to see where such classes would be placed inside the folder structure. First of all, ...
27
votes
9answers
2k views

Is it considered poor practice to include a bug number in a method name for a temporary workaround?

My coworker who is a senior guy is blocking me on a code review because he wants me to name a method 'PerformSqlClient216147Workaround' because it's a workaround for some defect ###. Now, my method ...
82
votes
6answers
13k views

Should the variable be named Id or ID? [closed]

This is a bit pedantic, but I've seen some people use Id as in: private int userId; public int getUserId(); and others use: private int userID; public int getUserID(); Is one of these a better ...
0
votes
2answers
136 views

addIfNotExist alternative [closed]

Is there are any standards or conventions on naming methods which add something if it not exist into another something. For example: Store.instance().addItemIfNotExist(item) IfNotExist is really ...
15
votes
3answers
2k views

How can I avoid using my own name in the identifiers, packages, or namespaces of open sources projects I create?

I do a lot of development in my own time. These projects I work on are all just for fun and learning (so far). I commonly do Java development with Maven but I have also been known to dabble in .NET ...
0
votes
1answer
329 views

Name for a tree where nodes hold a reference to their parent as well as their children [closed]

I am creating a tree where some nodes have a reference to their parent as well as their children. It feels like a tree version of a doubly linked list. Is there a name for this?
43
votes
7answers
4k views

How to name a variable when the word is both a noun and a verb

I have run into a corner-case problem with the general guidance of: nouns for variables verbs for functions Specifically, I have a case where the word is ambiguous - it can be either a verb or a ...
8
votes
4answers
288 views

Word for the superset of files and folders [closed]

I'm trying to come up with a name for a class that can represent both files and folders. Anyone know a word for this?
3
votes
1answer
189 views

Advices on structure and names for namespaces and classes [closed]

I'm resistant to calling the "main" class the same as the namespace, but I sometimes find myself needing it. Considering I'm using the Vendor.Namespace.[Subnamespace].Class formula, imagine this ...
22
votes
8answers
2k views

How and why to decide between naming methods with “get” and “find” prefixes

I always have trouble figuring out if I should name a certain method starting with getSomething versus findSomething. The problem resides in creating helpers for poorly designed APIs. This usually ...
3
votes
1answer
128 views

Representing domain objects

This is related to my recent question regarding naming awkward domain objects. A number of answers indicated I was using the wrong representation for the domain objects. To summarize, I chose to use ...
10
votes
5answers
561 views

Guidance in naming awkward domain-specific objects?

I'm modeling a chemical system, and I'm having problems with naming my elements / items within an enum. I'm not sure if I should use: the atomic formula the chemical name an abbreviated chemical ...
5
votes
3answers
650 views

Why the name 'continue' [closed]

The 'continue' keyword in Java (and probably in many other programming languages) is used to skip further execution of the current iteration. Why was the name 'continue' chosen? Why not something ...
4
votes
1answer
557 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 ...
1
vote
1answer
143 views

Am I missing a pattern?

I have a class that is a singleton and off of the singleton are properties that hold the instances of all the performance counters in my application. public interface IPerformanceCounters { ...
4
votes
1answer
668 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 ...
9
votes
3answers
6k views

What should I use for a package name if I don't have a domain? [duplicate]

Possible Duplicate: What is the point of Java’s package naming convention? What package name to choose for a small, open-source Java project? I write Java (and derivative languages with ...
6
votes
2answers
10k views

Naming convention: field starting with “m” or “s”

I saw lot of code (for example some Android source code) where fields name start with a m while static fields start with s Example (taken from Android View class source): private ...
-1
votes
4answers
146 views

Identifier for the “completed” stage of a process: 0, 99, something else? [closed]

Say, that you are handling a multi-step process (like a complex registration form, with a number of steps the user has go through in order). You need to be able to save the current state of the ...
2
votes
4answers
659 views

Function names - “standardized” prefixes

Imagine you have such routines /*just do X. Fail if any precondition is not met*/ doX() /*take care of preconditions and then do X*/ takeCareOfPreconditionsCheckIfNeededAtAllAndThenDoX() A little ...
118
votes
17answers
26k views

Is there an excuse for short variable names?

This has become a large frustration with the codebase I'm currently working in; many of our variable names are short and undescriptive. I'm the only developer left on the project, and there isn't ...
5
votes
3answers
292 views

How to name an subclass that add a minor, detailed thing? [closed]

What is the most concise (yet descriptive) way of naming a subclass that only add a specific minor thing to the parent? I encountered this case a lot in WPF, where sometime I have to add a small ...
2
votes
1answer
395 views

What is meaning of the term “Sans” in a class name?

I was reading code of a java project where I found a class name like "UserSansXml". This class is dealing with user objects. I wanted to know the meaning of "sans".
5
votes
3answers
1k views

Inspection, code review - is it really testing?

ISTQB, Wikipedia or other sources classify verification acitivities (reviews etc.) as a static testing, yet other do not. If we can say that peer reviews and inspections are actually a kind of a ...
4
votes
2answers
2k 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: ...
1
vote
2answers
382 views

What do you call a queue when the word queue is reserved? [closed]

I'm working on a rails app, and in rails queue is a reserved word. I need to make a Queue model for my app, and I'm stuck because I don't know what else to call it. Has anyone else run into this ...
11
votes
3answers
2k views

What package name to choose for a small, open-source Java project? [closed]

I'd like to publish a small open-source library in Java. I wonder what package name should I choose? I'm not a company and I don't have a domain that I could use as the basis for naming the package ...
2
votes
7answers
363 views

Vocabulary: Should I call this apply or map? [closed]

So, I'm tasked with organizing the code and building a library with all the common code among our products. One thing that seems to happen all the time and I wanted to abstract is posted below in ...
7
votes
1answer
3k views

What should be done with class names that conflict (common) framework names

What should be done exactly when the most obvious class name for a component is taken by a framework? In my case, I need to make a class that describes an HTTP request. Of course, the most common name ...
11
votes
3answers
2k views

Naming Convention for Dedicated Thread Locking objects [closed]

A relatively minor question, but I haven't been able to find official documentation or even blog opinion/discussions on it. Simply put: when I have a private object whose sole purpose is to serve for ...
3
votes
4answers
1k 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# ...