naming-conventions

F# naming convention

Hi, Is there an "official" naming / casing convention for F#? I'm always in doubt of using C# style or not: Class.MyFunctionName or Module.my_function_name In F# you're meant to mix BCL classes and F# library ones: they have different casing and the code looks very ugly. Thanks ...

What are the recommended prefix naming conventions for components in Flex 3?

I'm looking for a standard way to name components in my Flex application. For example, all TextFields begin with "txt" in their ID attribute (i.e., "txtFirstName"). Rather than re-invent the wheel, is anyone familiar with a list of prefix naming conventions that I can use? ...

Do you prefer verbose naming when it comes to database columns?

Which is your preference? Let's say we have a generic Product table that has an ID, a name, and a foreign key reference to a category. Would you prefer to name your table like: CREATE TABLE Products ( ProductID int NOT NULL IDENTITY(1,1) PRIMARY KEY, CategoryID int NOT NULL FOREIGN KEY REFERENCES Categories(CategoryID), Pr...

What strategy do you use for package naming in Java projects and why?

I thought about this awhile ago and it recently resurfaced as my shop is doing its first real Java web app. As an intro, I see two main package naming strategies. (To be clear, I'm not referring to the whole 'domain.company.project' part of this, I'm talking about the package convention beneath that.) Anyway, the package naming conven...

Interface naming in Java

Most OO languages prefix their interface names with a capital I, why does Java not do this? What was the rationale for not following this convention? To demonstrate what I mean, if I wanted to have a User interface and a User implementation I'd have two choices in Java: Class = User, Interface = UserInterface Class = UserImpl,...

Thoughts on naming controls in asp .net web forms

I've been using FxCop for a while, almost all of the rules it suggests make sense, but when it comes to naming controls it throws a wobbly. I tend to name things like this: btnSavePerson lblForename txtPostcode ddlEthnicity and so on. Now, I only use prefixes for controls, I found that identifying them was a bit of a pain. I don't ha...

What does variable names beginning with _ mean ?

When writing my first asp.net MVC application using C#, I see that there are some variables whose name start with an underscore character(_). What does this mean? Is there any specific meaning for this? ...

instance variable/ method argument naming in Objective C

What conventions are people here following for naming of instance variables and method arguments - particularly when method arguments are used to set ivars (instance variables)? In C++ I used to use the m_ prefix for ivars a lot. In C# I followed the convention of disambiguating purely by use of this. for ivars. I've since adopted the e...

Do you code variables in your language?

I am just working on a project where the library has an object with the property color, however being British I always use colour when writing variables and properties. I also just found some legacy code where the British developer used color in a variable name. Is American English the default for development now? ...

Naming Convention for State / Region / Province

I am building a class that represents a US State or Canadian Province. What should the class be called? Some ideas: Region: Problem with this is that .Net has a RegionInfo class that uses the term Region to represent a country (and not a State or Province). State: Problem with this is that it could cause confusion with Application St...

What is a good naming convention for domain objects versus their relational tables?

I have seen this issue twice now and want to see what a best practice is for resolving this naming convention. Suppose I have an ORM (Linq to SQL in this case) and I map a table called User. Then I create my POCO called User also. Although the mapped table exists in something like MyApp.Data.User and the POCO resides in something l...

Can Method names start with Get in .NET

I came across a recent Audit report in our company for the code we maintain which says that we should not use Get in the method (not properties) naming like in GetSearchResults or GetXyzInformation. I looked up the MS guidelines (http://msdn.microsoft.com/en-us/library/4df752aw(VS.71).aspx) for method naming and as per that Get is allow...

.NET naming convention for "ID" (anything identification: Capitalization)

I am in the process of unifying these inconsistent naming conventions and this one problem has been a bit driving me crazy lately. In the code base I am working with has no convention regarding "ID"; "ID", "Id" and even "iD" are used inconsistently. **Question: In .NET, how do you guys capitalize "ID"? For an example, nodeID, nodeId? ...

Underscore or camelcase?

I'm very unsure when it comes to naming conventions. I really want to adopt a stringent naming convention for class-names, variables, function-names, html-attributes or database schemata. But whenever I stick with - say camelcase - I am screwed up when working with the PHP language because they use underscores heavily. Or I realize that ...

Correct: Java "enterprise" edition = Java "internet" edition?

I am reading books on middleware, Spring, Hibernate, etc., and am wondering myself why the developer invented a new name, i.e. "enterprise edition" for Java "web" or "internet" libraries? As I have a quite individual mindset, "enterprise" edition sounds almost like "socialist" edition... what do I need to know to differentiate better? ...

What would you name this object?

So I have a table like so: ========================= ID | Col2 | col3 | col4 | ========================= -> 21 | balh | blah | foo | 22 | balh | blah | foo | I am making a object that can read the data from one row using the column name in an expression. Something like this: myrow.getValue(col => col.Col2) The proble...

What is the "proper" tag prefix for the AjaxControlToolkit?

I've seen many examples where they just use the "asp" prefix. Is this a good practice? (The reason I'm asking is because the templates that create the default for a new website appear to be problematic. There's an apparent naming collision on the BulletedList control.) ...

What convention do you use for backup file names?

What convention do you use, or what conventions have you seen in other programs? (It's for a research project) ...

Variable Naming Conventions For Maps / Lists

I am getting into Groovy language, which has dynamic typing (as well as optional static typing). It also has native support for Lists, Maps, and Ranges, so I find myself using lists and maps a lot, especially lists of lists, lists of maps, maps of lists, etc. In static languages (esp with Generics) you always have an idea of what yo...

Why is an IoC/DI container called a 'container'?

I'm just trying to understand where the label 'container' came from. Anyone know? Seems like many things could be called 'containers'. ...