naming-conventions

Does this match any known design pattern?

I'm working on a simple, internal ASP.NET app for a small company. I've designed the data access layer so it's database-agnostic. I have the following: IDataHelper - An interface requiring methods such as FillDataTable(), ExecuteNonQuery(), etc. MySqlHelper - Implements IDataHelper for MySQL, the only database I support so far. Stati...

What should I name a table that maps two tables together?

Let's say I have two tables: Table: Color Columns: Id, ColorName, ColorCode Table: Shape Columns: Id, ShapeName, VertexList What should I call the table that maps color to shape? Table: ??? Columns: ColorId, ShapeId ...

Database column naming question

Let's suppose there is a table called AIRPORT and I have to choose between two naming conventions: to name attributes like AP_CODE, AP_NAME and so on or to name them just like CODE, NAME The question is whether it is more efficient to follow the first way or to use synonym (i.e. AP) and reference attributes like AP.CODE? Thanks in adva...

When, if ever, should the name of a property contain the name of the class?

public class Fruit { // choose one public int Id { get; set; } public int FruitId get; set; } // redundant or usefully more descriptive? // choose one public string Name { get; set; } public string FruitName { get; set;} // redundant or usefully more descriptive? public string Fruit { get; set; } // or what ...

C++ header file convention

I am working on a small game using C++, and I used Eclipse CDT's class generator. It created a .h file with the class definitions and a .cpp file that included body-less methods for said class. So if I followed the template, I'd have a .cpp file filled with the methods declarations, and a .cpp file with method bodies. However, I can't ...

DB Tables naming conventions

Hello, I am trying to find out what are the popular naming conventions for DB tables. Therefor I have 2 questions: Lets say you have a table with persons in it. Each row is a person. How would you call the table - 'PERSONS' or 'PERSON'? Now lets say there is another table named 'PERMISSIONS' and you are creating a new table which is m...

Is there a well-established naming convention for PHP namespaces?

So far, I've seen many different naming conventions used for PHP namespaces. Some people use PascalCase\Just\Like\For\Classes, some use underscored\lower_case\names, some even use the Java convention for package names: com\domain\project\package. The question is very simple -- can any of these (or other) conventions be called well-establ...

How to mitigate class declaration being far from its owner namespace declaration in a file?

So, I've seen how useful namespaces can be to organize declarations into their respective groups, but now comes an issue with this. The difference between making a library in C and a library in C++ is in C you must prefix your declarations with what they belong to, for example a library we'll dub MyMath might have a vector class, well t...

Is putting class name in member routines redundant?

Say you have a class Block... class Block { and it has a function that allows you to show the block on screen. Would you call it... ShowBlock( ... ) or just Show( ... ) This has been irking me, and I'd like to hear others thoughts. On one hand, ShowBlock is completely obvious whenever its used. However, since it will be called f...

How do I get a list of event handlers with nonstandard names in my code?

I'm in the middle of performing a large refactoring which will involve renaming a lot of events. This will leave our code with a lot of code like this: thing.NewEventName += thing_OldEventName; How do I get a list of event handlers with nonstandard names in my code? Should I be thinking about a regex search, or should I be looking a...

Naming Classes - How to avoid calling everything a "<WhatEver>Manager"?

A long time ago I have read an article (I believe a blog entry) which put me on the "right" track on naming objects: Be very very scrupulous about naming things in your program. For example if my application was (as a typical business app) handling users, companies and addresses I'd have a User, a Company and an Address domain class - a...

PHP file naming conventions (.class, .inc)

I see .class and .inc included in file names a lot of the time. My current understanding is that this is just a best practice to make the purpose/contents of the file clear. Is there any instance in PHP where a .class or .inc file name has a special purpose and truly means something? ...

Should primitive datatypes be capitalized?

If you were to invent a new language, do you think primitive datatypes should be capitalized, like Int, Float, Double, String to be consistent with standard class naming conventions? Why or why not? By "primitive" I don't mean that they can't be (or behave like) objects. I guess I should have said "basic" datatypes. ...

What is this naming convention?

I am looking through code that has multiple naming conventions from multiple developers - a real treat. Amongst them are Hungarian ("s_year", "s_day") as well as this other style ("yearS", "dayS"). Does anyone know what this style is called? For bonus points, do you know where/when it originated? Disclaimer: Bonus points are hypothet...

What naming convention for a C API.

We are working on a game engine that is written in C and we are currently using the following naming convention: ABClass object; ABClassMethod(object, args) AB Being our prefix. Our API, even if working on objects, has no inheritance, polymorphism or anything, we just have datatypes and methods working on them. Our Constants are nam...

Plural/singular naming in methods returning lists.

it seems a trivial point, until you realize that you need consistency. Not being a native English speaker, I prefer to ask both for grammar and for style. Which one must be preferred among these method names, returning a list of URIs, each one associated to an object? objectUriList() objectsUriList() objectUrisList() objectsUrisList() ...

why list comprehension is called so in python?

No flaming please, asking as a community wiki so nobody gets reputation here. I know python is not the first language to have list comprehension. I'm just interest in the history of the name. I'm particularly interested in why it's called comprehension ...

Is there a common name in use for an object that gets data from a database?

I'm developing an API for use by one of our vendors to access data in our databases and I need to name my classes. I'm thinking about names such as Retriever, Accessor, and Controller (eg. TimesRetriever, TimesAccessor, TimesController, etc). These classes will provide read only access to data (that I'll be summarizing) in our database...

Should folder names start with a period?

Are there any guidelines or standards out there for folder names starting with a period? (e.g.: .NET). I have an installer that requires this to happen and right now we are using 'DotNET' instead of '.NET' for our folder names. Thanks! ...

Custom Binding in ASP.NET MVC with naming-conventions

Hey all I've got a View where I use a naming-convention on my text-fields, to indicate what should be done with the content once it is posted back to my controller. The format is similar to: <input type="text" name="RegistrationLine#ID" /> for updates <input type="text" name="CreateRegistrationLine#LineNumber" /> for create Now sinc...