naming

What names do you use for the “Solution Platforms” in Visual Studio?

The Visual Studio Default config says: “Any CPU”, does anybody change that? If so, what would you use and why? ...

Which name is more correct in my case: manager or factory (or something else)?

I have next code: PhotoFactory factory = PhotoFactory.getFactory (PhotoResource.PICASA); PhotoSession session = factory.openSession (login, password); PhotoAlbum album = factory.createAlbum (); Photo photo = factory.createPhoto (); album.addPhoto (photo); if (session.canUpload ()) { session.uploadAlbum (album); } session.close (); ...

database, table and column naming conventions

Hello, Do you know how to use the naming conventions in mysql database? I've downloaded a mysql sample database. Here it is: CREATE DATABASE IF NOT EXISTS classicmodels DEFAULT CHARACTER SET latin1; USE classicmodels ; DROP TABLE IF EXISTS customers ; CREATE TABLE customers ( customerNumber int(11) NOT NULL, customerName ...

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...

Is there a common name for a function that takes a list of lists and returns a single list containing the contents of those lists?

EDIT: My question was originally "Is there a standard name for a function that flattens a list of lists, but only one level deep?", but Chuck's answer is phrased much closer to what I actually wanted to ask, so I renamed it. All three answers were useful to me, though. Thanks. 'flatten' seems to be a well-accepted name for a function th...

How can I best avoid using reserved or key words in my language or framework?

Naming things is hard. When naming my classes, variables, and methods I strive to avoid collisions with reserved words or keywords in my languages (MSSQL, VB.NET or C#, HTML, CSS, jQuery) and framework (.NET). Too often I make mistakes and don't realize it until it's too late to easily go back and rename. A scenario: (1) first create ...

Naming form fields in a web page

How do you name your field names in a web page without revealing the structure of your database tables? ...

Package name for CurrentDate class

I'm about to write a class called CurrentDate and need a solid package name. The obvious answers are com.destroytoday.date or com.destroytoday.time, but I'm not sure if I'll have more date-related classes in the future to justify an entire package. Are there any names I can use that would allow non-date-related classes in the future? To...

Good name for the opposite of the "canary" metaphor

The "canary" is a common metaphor (for example in buffer overflow checks) for detecting mis-behaving operations by setting a flag before and verifying that it is still set after. Is there a common term for the opposite, when the operation should kill the "canary"? ...

HTML: Naming conventions for ID attributes

Lately I've been doing a lot of front-end work. Some developers here have been naming their elements things like "divPhotoGalleryContainer" and sometimes I'll just see "galleryContainer." Is there a good naming convention? Is adding "div" really useful? ...

Console class init function name

I developed a static Console class that writes any traces, successes, and errors to a log file. It requires a file path String and a LoaderInfo instance to get started. At the moment, the function is named start(path, loaderInfo). I'm not really feeling the name "start", so I'm wondering if there's something more accurate. To me, start m...

Naming: solution, projects, namespaces and assemblies

Hello everyone. I'm working on naming guidelines for solutions, projects, their default namespaces and asseblies (Visual Sudio). Now it looks like that: For example, we have a company named "Company" and a project named "Project". The project has business logic in separate dll, UI (WPF/WinForms) and a web part. There are names of things...

Package name for a loop class

I wrote a class that performs an asynchronous loop. It needs a package name. I already have a util package, but feel resistant to put half of my classes in that package. If it really belongs there, I'll put it there, but I'd feel much better if I can find a more appropriate/specific package. What do you think? ...

How can include a dot character in enum type name in javascript?

Hi all, I'm using javascript and have this enumeration: filterType = { Campaign : 'Campaign', Class : 'Class', Date : 'Date', DateGeq : 'DateGeq', DateLeq : 'DateLeq', DateRange : 'DateRange', Status : 'Status' } I'd like to name it as: Filter.filterType = { Campaign : 'Campaign', Class : 'Class', Dat...

Naming preference: getSupportedModes() vs supportedModes()?

I'm having hard time deciding which name to choose for my method. I think they both are pretty much self-explanatory, but the latter is faster to type, so, my current preference is supportedModes(). What do you think? ...

Subsonic 3.0 - Prefix all column names

Hi, Problem. Subsonic 3 build against an existing, medium sized DB Lots of columns, some badly named so conflicting against reserved words, Subsonic functions etc. Want to be able to prefix all column names (not tables) with something, eg. 'c' for column so that the appear together in intellisense drop down and solve naming issues in...

What should the assembly names be for an application providing both a GUI and command-line interface?

I've written a few desktop applications in .NET that provide both a front-end GUI for normal use as well as a command-line interface for other needs (e.g. extending, scheduling, automating, advanced usage, etc). What is the best practice for naming the two executables, since they are built to the same directory? I've seen or done some of...

Naming of types when using an ORM

I am working on a project where a number of types have the suffix "Instance". For example, we have the concept of tabs in the application, so we have a TabInstance type. To me this seems redundant and even confusing / wrong, as there is already the concept of an instance in OO terminology. The system uses nHibernate as an ORM - I wond...

SQL database design suggestion : Naming a database table

I have to create a table and store Active Directory SIDs representing an User or a Group. How would you name the category representing both an User and a Group ? Edit 1. Table will contain four columns : ID ( PK ), SID's Name, SID's value and another column for SID's Type ( 0 for User, 1 for Group ). Please suggest the table name...

Name a loader error

I wrote a loader class that has a tries property that indicates how many times to retry loading a url if an error code is returned. For instance with Twitter, the loader would retry loading a method call if a fail whale is returned, since the next call would probably return success. I specify the many errors that can be dispatched with ...