naming-conventions

For what reason do we have the lower_case_with_underscores naming convention?

Depending on your interpretation this may or may not be a rhetorical question, but it really baffles me. What sense does this convention make? I understand naming conventions don't necessarily have to have a rhyme or reason behind them, but why deviate from the already popular camelCase? Is there a rhyme and reason behind lower_case_with...

How to name a method that has an out parameter?

Hi, What is the common preference to name a method that has an out parameter inside? Usually I use Get as a prefix to mention that the method returns a value (like GetMyBusiness). But what if there is an out parameter that will be set after the method call? Should the method name mention this and focus only the return value? thanks...

Is it confusing to call this class a "factory"?

My understanding of a factory is that it encapsulates instantiation of concrete classes that all inherit a common abstract class or interface. This allows the client to be decoupled from the process of determining which concrete class to create, which in turn means you can add or remove concrete classes from your program without having t...

What to call the intermediate layer of the program?

We have a program consisting of three parts. There's the backend which is the NT service handling the requests. Also there's a COM object that implements a predefined interface, is consumed by client software and passes the requests to the service. Since we need to have both 32-bit and 64-bit versions of the COM object we split it into...

Naming Conventions for Methods / Classes / Packages

What naming conventions do you use for everyday code? I'm pondering this because I currently have a project in Python that contains 3 packages, each with a unique purpose. Now, I've been putting general-purpose, 'utility' methods into the first package I created for the project, however I'm contemplating moving these methods to a separat...

Prefix "Is" in Method Name for Verification Methods

I've been reading Code Complete lately, based off of many references here and also by a friend, and had a naming question for the community. Should the prefix "Is" be used on boolean methods that determine whether an event was successful? Here is a code example of two different naming schemes I tried: migrationSuccessful = CopyData();...

Why does CakePHP use different plural/singular naming conventions?

Can somebody perhaps explain here why on earth CakePHP has a convention of using plural names for db tables and controllers and singular for models? Why not always use singular terms, or always plural? For me it seems confusing to always have to think "now do I use plural or singular here?" (Or is there an easy way to remember??) And th...

Case Conventions in wpf using MVVM

Is there a standard for case and naming conventions in wpf/mvvm that differs from C#? I am accustomed to camelCase with the first character being lower case for private and upper case for public methods/properties. In the sample MVVM code I have been examining I have seen a lot of leading _ characters, is this a holdover from another p...

FTP In/Out Folder Name Best Practices

What best practices (if any) do you adhere to regarding setting up outgoing and incoming folders for your FTP clients? We typically use "outgoing" and "incoming", but no matter how you phrase the direction, it can be interpreted in two ways, depending on which end the names are relative to. For example, an "incoming" folder on my end...

(Conventions) C# Class names

Hello, I'm not too quite sure about what i should do about a grouped set of classes. My situation: I have 11 classes that relate only to the class Character.cs, but all of those classes (including Character.cs and CharacterManager.cs) are within the namespace Models.Characters. Which is the more "proper" or preferred way of naming ...

Should I keep the package name when extending a class?

I plan to extend a JSF renderer. The package name is oracle.adfinternal.view.faces.renderkit.rich Should the extended class be in the same package structure: oracle.adfinternal.view.faces.renderkit.rich or even oracle.adfinternal.view.faces.renderkit.rich.[subpackage] or can/should I put it into my own package? com.company.renderkits. ...

SQL Join Table Naming Convention

I have 2 tables: Users and Roles, and I have a table that joins these together. The only thing in the join table is Ids that link the 2 tables. What should I call this table? I've never really seen a good naming convention for this. Conventions I've seen before: UsersToRolesJoin UsersToRolesLink UsersToRolesMembership UsersRoles Ex...

What's the best possible name for a backup server in a development environment?

Hi, I run an office network and we have many servers. We try to give them nice server names regarding their functions, avoiding stupid names like 'dev01' or stuff like that. For testing our server is named 'pandora'. For development (where all stupid things happens) is named 'homer'. The question is, what's the best possible name...

C++ naming: read_input() vs. readInput()

Hi, Which naming convention is more preferable in C++? The `underscore' method or the camelCase method? I have coded in Java for a while and I am used to the camelCase naming conventions. Which one is more prevalent? Also, while defining a class, is there any preferred ordering of private/public/protected variables/methods? Are friend...

Whats the best way to name id & classes in CSS and HTML

When naming classes and ids for CSS what is the best method to use. In this case I need there to be some kind of naming convention so that other people can pick up rules and understand how to name their own ids and classes using the same pattern. Any suggestions? Some of the sites we create can get pretty complex but use an overall struc...

naming convention for shell script and makefile

hi, yet another newbie question i have a few makefiles that store shared variables, such as CC=gcc , how should i name them ? candidates are common.mk Make.common Makefile.common which is more classic? similarly, i have some shell scripts, which should i choose among the following: do_this_please.sh do-this-please.sh DoThisPlease.sh ...

Safe to have page resources without file extensions?

I need to decide on naming conventions for a new website. I can use mod_rewrite at will. My favourite solution would be to work with no file extension at all. www.exampledomain.com/language/pagename this would lead to "pagename" being treated as a directory. I would have to take that into account when using relative links. Are there...

What is the current scheme for naming variables and functions?

Is there a standard way to name them or is it programmer's call? Thank you. ...

Should a class have the same name as the namespace?

I'm designing a namespace to hold a set of classes that will handle user related tasks for a several different applications. (Log-in, authenticate etc) The problem is the namespace will be called Fusion.User but then it requires a class in that namespace that makes sense to call User. Should you have a class with the same name as the n...

Recommendations for naming C# classes/methods intended to replace existing APIs.

Long explanation aside, I have a situation where I need to basically re-implement a .NET framework class in order to extend the behavior in a manner that is not compatible with an inheritance or composition/delegation strategy. The question is not a matter of whether the course of action I am to take is what you would do, or recommend, i...