naming-conventions

Need advice on wordy naming of methods

I'm writing an API for creating geometric shapes, and I'm running into some difficulties naming my methods. Let's take a simple case: Creating a circle. Most of us might be familiar with a method like graphics.drawEllipse(x, y, w, h). To draw a circle, you need to know the top left coordinate, and the width and height of the circle. ...

How to properly name a class with respect to its namespace?

One can often see class names carrying a reference to the namespace to which they belong. One of the most popular examples is the .NET 'Xml' namespace where every single class defined in it is prefixed with the 'Xml' tag. This has always seemed pretty redundant to me, but recently I've realized that in some cases it could be useful... b...

How do you name your many-to-many relationship tables?

I've seen a few different naming schemes throughout multiple languages when it comes to many-to-many relationships, so I was wondering: what naming scheme do you use for naming these relationships? Please include the platform for which you are developing. Use Posts and Tags as examples for the tables that would be related. Examples: ...

is placing Entity in the name of a Domain Class a good practice?

currently i am discussing if placing entity at the end of each entity is a good practice for example public class CustomerEntity:BaseEntity{} instead of public class Customer:BaseEntity{} in my career i had seen both, but how do you do it nowadays? ...

Naming convention for controls

Microsoft has naming guidelines on their website (here). Also I have the Framework Design Guidelines book. What I could not find was a guideline about naming controls. For example a button, when dropped to a form, it gets the typename + number, camel-cased as default name, such as "button1". This is what I do: I delete the number and...

Singular or plural controller and helper names in Rails

Is there any disadvantage to using singular names for controllers and helpers? Nothing seems to rely on this. It even seems helpers don't have to make the same choice about singular vs. plural as their corresponding controllers, at least according to my limited experimentation. Is that true? ...

Equivalent to exclamation mark for method names from ruby in other languages

In Ruby, methods with side effects or methods that change the object passed as parameters have "!" as a postfix. For example: "SomeString".gsub!(/S/, "s") would be changing the String object, while "SomeString".gsub(/S/, "s") would work on a copy of the String object, and would not change the state of any objects outside of the method...

Python sequence naming convention

Since there is no explicit typing in python, I want to be able to make the difference between sequences and non-sequences using a naming convention. I have been programming with python for a little while now, and I still haven't found any logical/practical way to name sequences. Of course, I went through the famous PEP8, and made some re...

Why should (or shouldn't) I prefix fields with 'm_' in C#?

I've been a C++ programmer for almost 12 years now. When I moved to C# two years ago I brought with me the same coding style I was so accustomed to. Soon I realized how much useless it was in C# and gradually started to drop all of my old habits... but the 'm_' thing. I've never been a fan of Hungarian notation, I've always found it pre...

How do you name constructor argument and member variables?

Exact duplicate of "Naming convention for params of ctors and setters" I don't use prefix while naming internal variables of a class (I know some do but I am not starting "why do you..." debate). I just prefer it that way. The problem is that sometimes same parameters are passed in contructor and I end up being confused how to name them...

Microsoft VB.NET naming convention

Is there any standard naming convention for VB.NET ? Based your programming experiences, would like to share your naming convention for VB.NET ? Are there any guides for this kind of good practice besides patterns & practices Guidance Explorer and Guidance Share ? Thanks. Happy Weekend. ...

How do you give names to your programs?

Each time I create a new project/application I spend a lot of time thinking of a nice name for it. For example, I'm currently creating some program that imports some XML files, and I already spent more time thinking about the name than programming it. How do you do it? ...

Variable\Property naming convention

When im naming a variable for a directory should i end the variable name with path, folder or directory. Im writing my code in .net.. ...

Which naming conventions do you use for SVN Branches and Tags?

Our company is creating a naming convention for SVN branches and tags, and I'm not confortable with the idea of using only date or build number on branches/tag names. I think we need names that brings a greater definition about what this path represents, what effort is being done, etc. What do you think / use? ...

C# Correct paramName for ArgumentException in Property Setter

If an invalid value is passed to a property setter and an ArgumentException-ish exception is thrown, what should be passed as paramName? "value", since it seemingly is the actual argument? Wouldn't it be more clear to pass the name of the propery instead? ...

Interface naming convention

This is a subjective thing of course, but I don't see anything positive in prefixing interface names with an 'I'. To me, Thing is practically always more readable than IThing. My question then is, why does this convention exist anyway? Indeed, it makes easier to identify interfaces among all types. But wouldn't a similar argument extend...

UI Element Naming

What naming conventions do you use for user interface elements (including dialog boxes)? Controls: I use [Descriptive Name][Control Type] (e.g. OKButton, MainTableLayout) Windows: I use [Descriptive Name]Window (e.g. SearchWindow, CustomerListWindow) Occasionally, I will shorten a control type name if it is still legible ("Grid" inste...

Create a regular class or an Inner class for a Parameter Object?

Instead of passing many arguments to a method, I was encapsulating it into an argument object. note: simplied for demo For such a case, what would be a better practice? • Create a class and name it as InventorySaveArgs? -- or -- • Create a nested class and name it as SaveArgs? And would you also explain why one would choose...

Naming conventions for template types?

Traditionally, the names of template types are just a single upper-case letter: template<class A, class B, class C> class Foo {}; But I hesitate to do this because it's non-descriptive and hard therefore to read. So, wouldn't something like this be better: template<class AtomT, class BioT, class ChemT> class Foo {}; I also tend to ...

Naming conventions for GoTo labels

How do you name your GoTo labels? I use rarely often so I'm having a hard time finding good names. Please refrain from the classical 'goto is evil and eat your code alive discussion' ...