naming-conventions

How to choose a name for projects in solution?

Maybe that's silly, but I'm confused again when trying to find appropriate names for my projects. I have a solution with two projects. First project is a library, which will be used by other libraries in the future, for creating plugins for my app. Second project is a exe, which uses first project to create GUI and do some stuff, eg. lo...

naming convention - underscore in C++/C# variables

It's usually to see a _var variable name in a class field. What does the underscore mean? Is there a reference for all these special naming convention? Thanks. ...

Variable/function naming for 2-D and 3-D grouped objects

I am working on a UI where the top level, logical grouping of display objects is 2-D or 3-D (variety of objects can be displayed either two dimensionally or three dimensionally.) My language of choice does not allow for numeric characters to be the first character of an identifier (not actually aware of any that do) so I'm looking for a...

Pointer Naming Preferences

Possible Duplicate: Whats your preferred pointer declaration style, and why? Just curious: What's you standard method when declaring pointers? Why? SomeClass *instance; OR SomeClass* instance; I prefer the second method as it keeps the entire type together (it's a 'SomeClass pointer'). But I know many prefer the first an...

What are good Ant target naming conventions?

I'm about to create some complex Ant build files and I wanted find out what people think are best practices for naming ant tasks. It is going to build some Java, C++, compresses JavaScript, generate docs and lots more. What tasks do you always add to an any script? Things like clean, build? How to you name targets that make up a single...

Naming convention JUnit suffix or prefix Test

Class under test MyClass.java JUnit test case name alternatives: TestMyClass.java MyClassTest.java http://moreunit.sourceforge.net seems to use "Test" as prefix default but I have seen both uses. Both seems to be recognized when running the entire project as unit test in eclipse as it is the annotation inside classes that are parsed ...

Naming convention for Maven Artifacts

We are currently trying to mavenize the existing projects in our company. We have executed a POC and are currently documenting our learnings and guidelines. I have come up the following naming convention for the maven artifacts. Please share your comments on the same Note: In our company, projectname is always unique For a single level...

Rails -- Would like to create a controller with a dash or underscore in name

Hello, I wanted to create some basic html pages to add to my rails app. I figured the restful way to do it would be to create a controller. The problem is I'd like the pages to be a two word title. => ex. www.mydomain.com/foo-bar/ For SEO reasons it really must be two words, and I need the separation...using www.mydomain.com/foobar...

Local constants naming: UpperCamelCase or lower?

Which naming convention do you use for local constants in C# and why? const int Pi = 3; const int pi = 3; ...

Should threads in Java be named for easier debugging?

What are the best practices around thread naming in Java? Are there any naming conventions to follow? ...

What's a good naming convention for methods that take conditional action?

Let's say I have a method, Foo(). There are only certain times when Foo() is appropriate, as determined by the method ShouldFooNow(). However, there are many times when the program must consider if Foo() is appropriate at this time. So instead of writing: if ShouldFooNow(): Foo() everywhere, I just make that into one function: def...

Need inspiration for naming classes and methods.

Possible Duplicates: Anyone else find naming classes and methods one of the most difficult part in programming? Whats the best approach to naming classes? Finding appropriate abstraction names can sometime be time-consuming, especially if your mother tongue is not english. I was wondering if there exists somewhere some sort...

.NET class prefix and postfix naming conventions

Developer teams usually have some class naming conventions based on class functionality and roles it plays in patterns. For example, we use the following postfixes: Info for data structure classes (only public properties, no methods, such as business entities). Helper for classes with common functionality used all over the project (S...

.NET naming convention for conversion methods: ToType() or AsType() ?

Is there any semantic difference between ToXXXX conversion methods and AsXXXX conversion methods in the .NET framework? Examples of such methods are Object.ToString and Enumerable.AsEnumerable<T>. If no: Are there still recommendations when to name a conversion method AsXXXX and when to name it ToXXXX? If yes: Is there a .NET framewor...

Do you use singular or plural in names of arrays, maps, sets, etc.?

I have a quick question that is not particular technical, but I sometimes wonder what's better ... Do you use singular or plural in names of arrays, maps, sets, etc.? Example: Singular 1 std::map<string,double> age; 2 age["diego maradonna"] = 49; Plural 1 std::map<string,double> ages; 2 ages["diego maradonna"] = 49; In the pl...

If you are using an interface-based design approach, how do you name the more behavioural interfaces?

I'm developing a library containing multiple controls (or components). I'm using an interface based approach to type design, but eventually it led me to a question that bothers me for a long time. If you use an interface-based design approach, how do yo name the behaviour interfaces? For example, let's assume you have some getter setter ...

what is the convention for word separator in java package names?

how should one seperate words in package names com.stackoverflow.my_package (underscore) com.stackoverflow.my-package (hypens) com.stackoverflow.MyPackage (camel-case) What is the general standard? ...

What's a good name for a method that gets or creates an object?

Say you have a cache, and a method that will do something like the following: if (wanted Foo is not in cache) cache.Add(new Foo()) Return Foo from cache What would you call that method? GetFoo(), GetOrCreateFoo() or something else (and better)? Or should this really be divided into two methods? ...

C# Field Naming Guidelines?

I am going to be working on a bit of C# code own my own but I want to make sure that I follow the most widely accepted naming conventions incase I want to bring on other developers, release my code, or sell my code. Right now I am following the naming convention that Microsoft has set as they seem to be the most widely accepted. The on...

Java method naming conventions: Too many getters

Why do Java method names use the "get" prefix so extensively? At least in my Java programs there are a lot of methods with names starting with the word "get". The percentage of get-methods is suspiciously high. I am starting to feel that the word "get" is losing its meaning because of inflation. It is noise in my code. I have noticed th...