naming-conventions

C# naming convention for constants other than Pascal and All Caps

In my project currently we are using All caps as naming convention for constants. I would like to change it and I'm OK with Pascal Casing but my team lead has a strong argument that it will not visibly distinguish constant from Properties and other Types. Please help me with any other suggestions. RESULT As @Paolo Tedesco and most of t...

How do you deal with naming conventions for rails partials?

For example, I might have an partial something like: <div> <%= f.label :some_field %><br/> <%= f.text_field :some_field %> </div> which works for edit AND new actions. I also will have one like: <div> <%=h some_field %> </div> for the show action. So you would think that all your partials go under one directory like shared or...

How to distinguish properties from constants if they both use PascalCasing for naming?

As stated in the framework design guidelines and the WWW in general, the current guideline is to name your constants like this LastTemplateIndex as opposed to LAST_TEMPLATE_INDEX With the PascalCasing approach, how do you differentiate between a Property and a Constant. ErrorCodes.ServerDown is fine. But what about private constants wi...

Misc. Naming: Can I place underscores instead of camel casing in modern languages?

Hi! I would like to ask some kind of permission (I hope that doesn't sound strange) from the people who have influence on the naming conventions in modern languages like F#, Scala, etc. My problem is - I just can't read camelCased code and wish I could write underscored_names at least in my internal implementations (not in API interfac...

What to do if 2 (or more) relationship tables would have the same name?

So I know the convention for naming M-M relationship tables in SQL is to have something like so: For tables User and Data the relationship table would be called UserData User_Data or something similar (from here) What happens then if you need to have multiple relationships between User and Data, representing each in its own t...

Mixing Plural AND Singular naming

Hi, here's the quick version of the situation: We are developing some C# App and the team decided this Naming convention: We have for example an entity called User which is stored in the DB, we have the old master/slave pages to manage the User catallog. We are using a sort of MVC pattern, so for the master we have this controller call...

Java Interfaces/Implementation naming convention

How do you name different classes / interfaces you create? Sometimes I don't have implementation information to add to the implementation name - like interface FileHandler and class SqlFileHandler. hen this happens I usually name the interface in the "normal" name, like Truck and name the actual class TruckClass. How do you name inter...

Common coding style for Python?

Hi, I'm pretty new to Python, and I want to develop my first serious open source project. I want to ask what is the common coding style for python projects. I'll put also what I'm doing right now. 1.- What is the most widely used column width? (the eternal question) I'm currently sticking to 80 columns (and it's a pain!) 2.- What quot...

i18n - What are some naming-convention to use in creating language files?

I'm developing a CMS that required i18n support. The translation strings are stored as an array in a language file (ie, en.php). Are there any naming conventions for this.. How can I improve on the sample language file below... // General 'general.title' => 'CMS - USA / English', 'general.save' => 'Save', 'general.choose_category' ...

What's the right name for non MVC ASP.Net code?

I'm building a ASP.Net MVC site, which has some small islands of non MVC code. Is this best called ASP.Net Classic, or Legacy ASP.Net? Is there some better name two distinguish the two? ...

Most awkward/misleading method in the .Net API?

In light of this question I thought it'd be really neat to have a similar question about C#/.Net. So, what is the most awkward or misleading method name of the .Net and/or C# API? ...

Table and column naming conventions when plural and singular forms are odd or the same

In my search I found mostly arguments for whether to use plurality in database naming conventions, and ways to handle it in either case. I have decided I prefer plural table names, so I don't want to argue that. I need to represent an animal's species and genus and so on in a database. The plural and singular form for 'species' are the ...

Naming Conventions for .NET / C# / WPF Projects

What is a widely accepted naming convention for .NET/C#/WPF projects? ...

Possible Conflict with Class name & Property Name?

If you have a namespace that contains a property in ClassA and a class that has the name of that Property somewhere else in your project and both are in the same namespace this won't cause conflicts will it? So lets say I have a class named Car namespace Dealer { class Vehicle { // the main class that defines vehicle, so ...

python: naming a module that has a two-word name

I'm trying to put together a really simple module with one .py source file in it, and have already run into a roadblock. I was going to call it scons-config but import scons-config doesn't work in Python. I found this SO question and looked at PEP8 style guide but am kind of bewildered, it doesn't talk about two-word-name conventions. W...

MyClassBase or BaseMyClass?

Possible Duplicates: Using Base in a Class Name C# Class naming convention: Is it BaseClass or ClassBase or AbstractClass Naming Conventions for Abstract Classes What is the better way to name base abstract classes? I still can't decide where to put 'Base' word. Should it be 'BaseMyClass' or 'MyClassBase'? How do you name...

What should I call the operation that limits a string's length?

This is a language-agnostic question - unless you count English as a language. I've got this list of items which can have very long names. For aesthetic purposes, these names must be made shorter in some cases, adding dots (...) to indicate that the name is longer. So for example, if article.name returns this: lorem ipsum dolor sit am...

Best practice for naming unit and integration test methods?

The title says it all. I've recently inherited an application that is written by different people at different times and looking for guidance on how to standardize. ...

Why do exceptions usually have the suffix 'Exception' in the class name?

It seems to me that it is rendundant information as the usage of the class will make it apparent that it is an exception. Furthermore, in PHP, the class must extend the Exception class so it will be apparent that it is an exception when looking at the class on its own. Despite this, developers usually apply the suffix 'Exception'. Why i...

What is a good naming convention to differentiate a class name from a property in C#?

I run into this frequently enough that I thought I'd see what others had to say about it. Using the StyleCop conventions, I find that I often have a property name that is hard to make different than the class name it is accessing. For example: public class ProjectManager { // Stuff here } public class OtherClass { private Pro...