naming-conventions

Why are generics called generics?

At the risk of becoming the village idiot, can someone explain to me why generics are called generics? I understand their usage and benefits, but if the definition of generic is "general" and generic collections are type safe, then why isn't this a misnomer? For example, an ArrayList can hold anything that's an object: ArrayList myObj...

Is there a standard way to name a function which reads from a stream but does not advance the pointer?

I can only think of Peek() and ReadNoAdvance() atm, but I wonder if there are better or standard options. Thanks. ...

On K.I.S.S and paving cowpaths

I'm currently developing a PHP application that's using an Access database as a backend. Not by choice you understand... the database is what the client used originally and using it is part of the requirements. One of the problems with this database is that the column names have the most insane naming convention you could possibly imagin...

Database naming conventions

We are deciding the naming convention for tables, columns, procedures, etc. at our development team at work. The singular-plural table naming has already been decided, we are using singular. We are discussing wether to use a prefix for each table name or not. I would like to read suggestions about using a prefix or not, and why. Does i...

Naming variables that contain filenames?

If I've got a variable that contains the fully-qualified name of a file (for example, a project file), should it be called projectFile, projectFileName or projectPath? Or something else? ...

PHP best practices for naming conventions

I recently started these naming conventions.. all functions & variables = camelCase constants with define() = ALL_CAPS_AND_UNDERSCORES Now I see a lot of other people mix up camelCase and underscores and they seem to have some sort of convention to it... What do you use and what is best? I've heard that public and private functions sh...

Table Naming Dilemma: Singular vs. Plural Names

Convention has it that table names should be the singular of the entity that they store attributes of. I dislike any T-SQL that requires square brackets around names, but I have renamed a Users table to the singular, forever sentencing those using the table to sometimes have to use brackets. My gut feel is that it is more correct t...

Secure name for the admin area URL of a site?

A question mainly for web developers. When you develop web applications and add an admin area to it, how do you name it? Leaving it 'admin' is a bit out of fashion and insecure. Mind sharing any other nouns, verbs, adjectives or whatnot, that holds the title of any websites you know/can think of. ...

How do you reconcile common C++ naming conventions with those of the libraries

Most C++ naming conventions dictate the use of camelCaseIdentifiers: names that start with an uppercase letter for classes (Person, Booking) and names that start with a lowercase letter for fields and variables (getPrice(), isValid(), largestValue). These recommendations are completely at odds with the naming conventions of the C++ libr...

CRUD vs AGUD vs AFUD...what's your naming convention of preference

Do you write createSomething() or addSomething()? Do you write readSomething(), getSomething() or fetchSomething()? This is totally a petty gripe. In the meeting room we refer to it as CRUD, but in actual code, it's becoming AGUD. What's your naming convention of preference? Does it matter? thnx. ...

What is the preferred naming conventions du jour for c++?

I am quite confused by looking at the boost library, and stl, and then looking at people's examples. It seems that capitalized type names are interspersed with all lowercase, separated by underscores. What exactly is the way things should be done these days? I know the .NET world has their own set of conventions, but it appears to be co...

PHP - Function/variable naming

I have read a lot of popular standards manuals for open source PHP projects. A lot enforce underscores for variables spaces, and a lot enforce camelCase. Should global functions and variables be named differently to class methods/properties? I know the most important thing is consistency, but I'd like to hear some thoughts on this. W...

How many address fields would you use for a UK database?

Address records are probably used in most database, but I've seen a number of slightly different sets of fields used to store them. The number of fields seems to vary from 3-7, and sometimes all fields are simple labelled address1..addressN, other times given specific meaning (town, city, etc). This is UK specific, though I'm open to co...

Why do generics often use T?

Is there any reason for the use of 'T' in generics? Is it some kind of abbreviation? As far as I know, everything works. For example public G Say<G>(){ ... } or even public Hello Say<Hello>(){ ... } ...

What naming convention do you use for member variables?

What do you use to denote a member variable in a class? The most common time this is a problem is when you have a parameter passed into a constructor to set a member variable. Here is an example: public MyClass(string name) { name = name; // arghh!! } I've used m_name before, but that stinks of Hungarian. I've used _name before...

Project Naming

As a beginner/intermediate developer one problem I run into as my projects get bigger and more abstracted away as i use more OOP principles I have a problem with naming things. Like when i have multiple projects or class libraries I don't know what to name them. I see things from xxx.Core to xxx.Main or have even seen xxx.BLL and xxx.D...

What's a good name for an Enum for Yes & No values

Background In a C# command-line app I'm writing, several of the parameters have "yes" and "no" as the possible values. I am storing their input using the Enum type shown below. enum YesNo { Yes, No } Which is fine - the code works. No problem there. NOTE: Yes, I could store these as bool (that's how it used to work). My ...

Django model naming convention

What is the preferred naming convention for Django model classes? ...

Quick question about a naming convention for a C# CMS

I am building a CMS and the naming convention for classes has been debated between the other developer involved and myself. The problem arises specifically with "Page", as it is a public class available in a typical library. A natural response would be to call it MVCMSPage (where MVCMS is the to-be name of the cms) or to rely on referen...

Do you name your arrays plurally or singularly?

When I'm naming array-type variables, I often am confronted with a dilema: Do I name my array plurally or singularly? For example, let's say I have an array of names: In PHP I would say: $names=array("Alice","Bobby","Charles"); However, then lets say I want to reference a name in this array. For Bobby, I'd say: $names[1]. However, th...