naming-conventions

MySQL naming conventions, should field name include the table name?

Hi, A friend told me that I should include the table name in the field name of the same table, I wondering why? And should it be like this? Example: (Table) Users (Fields) user_id, username, passowrd, last_login_time I see that the prefix 'user_' is meaningless since I know it's already it's for a user. But I'd like to hear from y...

Database naming conventions

I'm starting a new project and want to begin with a database naming convention that won't become a hindrance in the future. I want a consistent convention for tables and columns. At a previous employer I have seen all objects in upper case with underscores separating words. e.g. CREATE TABLE USER_TYPES (USER_TYPE_ID INT); Is this t...

FilterOperators or FilterOperatorType - The correct naming format for an enum in C#

Which is the appropriate (more readable) way of naming enumerator? will you consider: enum FilterOperators { IsEqual, Contains, StartsWith } class QueryFilter { FilterOperators Operator{get;set;} } var filter = new QueryFilter(); filter.Operator = FilterOperators.IsEqual; Or is this preferable enum FilterOperatorT...

How to have userfriendly names for enumerations?

Hi, I have an enumeration like Enum Complexity { NotSoComplex, LittleComplex, Complex, VeryComplex } And I want to use it in a dropdown list, but don't want to see such Camel names in list (looks really odd for users). Instead I would like to have in normal wording, like Not so complex Little complex (etc) Also, my applicat...

Sun's Java Package Naming Convention: sun vs. com.sun

In JRE, Sun's internal packages are prefixed with 2 top-level domains (sun and com). For example, com.sun.security.jgss sun.security.jgss It seems pretty random to me which prefix they choose. I am curious what rules Sun uses for this. ...

What's the rationale behind the Qt way of naming classes?

I am wondering why Qt uses Q before every class name rather than putting everything in a namespace. Is there any particular reason, such as making the names easy to search for, or is it just about brand names? ...

Naming convention for a variable that works like a constant

I have a variable that I'm using like a constant (it will never change). I can't declare it as a constant because the value gets added at runtime. Would you capitalize the variable name to help yourself understand that data's meaning? Or would you not because this defies convention and make things more confusing? The larger question: ...

Fluent NHibernate primary key constraint naming conventions

Is there any way to create a naming convention for my primary key constraints in Fluent NHibernate? I know you can name foreign key constraints, but it does not appear possible to name the primary key constraint. ...

The right file name for an enum?

I have a DataType (text, numeric, date, boolean, money) enum and I need to put that in a file. How should I call the file and where in my DataAccessLayer.Generic namespace should I put the file into? Right now the file is called enum.vb and is in the DataAccessLayer.Generic.DataTypes namespace. The Result is DataAccessLayer.Generic.DataT...

Will bad things happen to me if I name my arrays, collections, lists, enumerables, etc. just the plural of what they contain?

I have always thought it was "best practice" to be explicit in naming my collection variables. So, if I had a collection of Car objects, I would typically name a Car[] carArray and a List<Car> carList. And then 99% of the time, I end up just doing something like... foreach (Car car in carArray) { ... } ...and I'm thinking, I coul...

naming convention of temp local variables

What is the standard way to name a temp variable in the local function? let me give you an illustration of what I am doing. I get a pointer to a structure, so I want store one of its members locally to avoid a de-referenced, and then any modification assign back to the pointer. To be more concrete: struct Foo { double m_d; }; vo...

Naming convention of foreign keys

Hello there When making relations between tables (in mysql), I have encountered a naming dilemma. For example, if I was creating a site where a project could be created by multiple users and also read by multiple users, to link a questions and user tables, I would potentially need two tables. **project_authors** questionId userId a...

Primary key/foreign Key naming convention

In our dev group we have a raging debate regarding the naming convention for Primary and Foreign Keys. There's basically two schools of thought in our group: 1) Primary Table (Employee) Primary Key is called ID Foreign table (Event) Foreign key is called EmployeeID 2) Primary Table (Employee) Primary Key is called EmployeeID Forei...

Naming Conventions: What to name a method that returns a boolean?

I have an interface in c# that helps retrieving of data from a custom archive on server. The interface looks like this: public interface IRetrieveData { bool OkToRetrieve(SomeData data); // Method in question... bool RetrieveToLocal(SomeData data); } This interface is implemented by the clients that retrieve the data to the lo...

Database name convention: DATETIME column

What is your naming convention for DATETIME columns (in my case, using MS SQL Server) For a column that stores when the row was created CreatedDatetime makes sense, or LastModifiedDatetime. But for a simple table, let's say one called Event, would you create columns called: EventID, // Primary key EventDatetime, ...

How important are naming conventions for getters in Java?

I’m a huge believer in consistency, and hence conventions. However, I’m currently developing a framework in Java where these conventions (specifically the get/set prefix convention) seem to get in the way of readability. For example, some classes will have id and name properties and using o.getId() instead of o.id() seems utterly pointl...

C# Project folder naming conventions

Hi! I have a project called Data which is a data layer. In this project, all files are just lying in the top folder. I have enumerations, POCOs, repositories, partial classes and so on. If i want to move those files into subfolders, what would be the preffered folder name for each folder? Is there any convention? The "Repositories" fo...

What does the postfix "_t" stand for in C?

Possible Duplicate: What does a type followed by _t (underscore-t) represent? While typing in my IDE (Xcode), autocomplete pops up already-defined words when I'm partway thru entering some variable name. I occasionally see names that have '_t' at the end of them. What naming convention is that and what does it mean? Is ther...

configuration filename convention

Hi, Is there a general naming conventions for configuration files for a simple python program? Thanks, Udi ...

Opinions on using My as a class name prefix

Personally, I've never liked the MyObject naming of classes. I would guess that the status quo would agree but I'd like to see the other side of the argument and if there's any validity to it. ...