naming-conventions

Naming functions for the past, present, and future tense?

I'm trying to come up with some clear and concise names for a Permission class that lets you check if a permission is, was, or will be, allowed/denied. I'm at a loss for what to call the future tense. class Permission: def can_read() def could_read() def will_read()? def will_be_readable()? I'm most partial to will_read(), bu...

prefixing DTO / POCOS - naming conventions?

Hi there, simple question really, i was wanting to know what naming conventions anybody puts on there DTO / POCOS .... I didn't really want to prefix like hungarian notation.. i got away from that!. But my dtos naming are clashing with my actual returned object names and although they are in a different namespace its still a bit con...

Grouping in a namespace vs. prefixing Classes

Hi, imagine a situation where you have an application that needs to import data from different sources. For each of these sources exists a seperate model (often not related to the others). So let's say i have my software component X which does all the importing, the namespace is correspondingly X. In X i have all my different parsers a...

Common namespace naming suggestion

I have a layered application with namespaces: App.Core - business layer logic services App.Data - data access layer store classes and data access objects App.Web - user interface layer I also have business objects/DTOs. They reside in App.Objects namespace, but I dont like this naming convention. Why? Because this namespace will also...

Column Naming Advice

I know there are other naming convention discussions, but the ones I saw were all general guidelines, I'm asking more for advice on good practice regarding my specific case. However, if there is another question that directly covers my case, please link it and I will gladly delete this question. I have a database for modeling electronic...

Giving a property the same name as its class

I've sometimes seen code written like this : public class B1 { } public class B2 { private B1 b1; public B1 B1 { get { return b1; } set { b1 = value; } } } i.e. class B2 has a property named "B1", which is also of type "B1". My gut instinct tells me this is not a good idea, but are there any technical reasons why you shoul...

Should I capitalize constructor names for my classes?

I use camel case which has the first letter of all variable names, functions, etc lowercased. But the class names are capitalized. Should I use: class Foo { function foo() { } } or : class Foo { function Foo() { } } Which is a better convention? I'm confused. ...

How do database naming conventions change for multitenant applications?

For multitenant databases, to you name tables differently based on: Whether the table will host multiple tenants or just rely on the exist of a tenant column If you support multiple "applications" such as salesforce.com, do you prefix the application name to the table? Do you try to keep the names the same across tables where it may no...

Variable naming conventions in CakePHP

What is the best way to name variables which contain multiple words? After going through lots of projects available in the CakePHP forge, I have noticed people use either camelCase, underscores or camelCase for variables and underscores for data sent to the view. An example of the last one would be: $activeSites = $this->Site->find('al...

How to do source cleanup / code formatting (defined in eclipse) using ant task

Hi all We have a defined a set of rules in Eclipse for code formatting and clean up. is there a way to run the code clean up using ant task ? I know that there are tools like checkstyle but these tool have thier own configurations and rules, and I don't want to maintain 2 sets of rules. I'm looking for an ant task that will use the s...

.NET Collection Naming Convention

My colleague and I have been having a discussion about what Collections should be called. For example: Class Product - Collection - Class Products or Class Product - Collection - Class ProductCollection I've had a look around to see if I can see any guidelines or reasons for using one or the other but nothing seems to spring out. Th...

C#: What would you name an IEnumerable class?

When reading this question I started to wonder a bit. Say you have these two: class ProductCollection : ICollection<Product> class ProductList : IList<Product> What would you call one that were an IEnumerable<Product>? class Product--- : IEnumerable<Product> Before I read that other question I might have called it a ProductCollecti...

Naming convention for new projects

I've tried several times to come with an answer to this question. I'm not happy with how projects are named in my shop, they are usually random named after some of these items: the client some technology used/ or expected to be used inside the project some acronyms for the business case the project would relate to some names from the d...

Explanation of naming conventions for classes, methods and variables

I'm currently in University and they're pretty particular about following their standards. They've told me this: All classes must start with a capital letter Correct public class MyClass {} Incorrect public class myClass {} public class _myClass {} All methods must start with a lowercase letter Correct public voi...

Rule of thumb for capitalizing the letters in a programming language

I was wondering if anyone knew why some programming languages that I see most frequently spelled in all caps (like an acronym), are also commonly written in lower case. FORTRAN, LISP, and COBOL come to mind but I'm sure there are many more. Perhaps there isn't any reason for this, but I'm curious to know if any of these changes are d...

Does my variable naming convention have a name?

So I go by this Delphi naming scheme of arguments start with A, class vars start with F and local vars start with M. Does that scheme have a name? I see it a lot in the Delphi source I'd like to read more about it but I'm not sure what it's called. ...

Naming of interfaces/abstract classes in PHP 5.3 (using namespaces)

Hi guys, Prior to PHP 5.3 I used to name interfaces/abstract classes like this: abstract class Framework_Package_Subpackage_Abstract {} Framework/Package/Subpackage/Abstract.php interface Framework_Package_Subpackage_Interface {} Framework/Package/Subpackage/Interface.php Now with PHP 5.3 and using namespaces I can't use my conventi...

"ID" or "Id" on User Interface

The QA manager where I work just informed me there is a bug in my desktop app due to the sign on prompt being "Operator Id" when it should be "Operator ID". Her argument being that "Id" refers to the ego portion of Freud's "psychic apparatus" and is not semantically correct. Now being an anal engineer (AE) I of course had to go and look...

WPF UserControl naming convention question

Hi. I'm creating a WPF UserControl with many elements inside. I need to work with them and I need to give them names. I've seen that in some custom controls people are naming elements this way: PART_name Should I name my elements like PART_ListBox.. etc? Or what's the purpose of this? Is it to differentiate that these names are part ...

How to avoid having the same name for a class and it's namespace, such as Technology.Technology?

I am frequently having naming conflicts between a namespace and a class within that namespace and would like to know a best practice for handling this when it seems to make sense to use these names in the first place, besides adding random prefixes. It seemed to make sense to have a Models.Technology namespace, with dozens of technology...