naming-conventions

How should you implement Serialization? (interface/convention wise)

I implement an xml serialization based on Marc's answer. Should this be part of the class itself, ie Apple.Serialize/Deserialize? Although Deserialize would be static in that case, as you might not have an instance to call it on. Or should I have another class for Serialize/Deserialize? If so, these seem to be generic enough? What sho...

How do I configure NHibernate (or Fluent NHib) to add a table name prefix to all table names?

In the current application I'm developing I'm using fluent nhibernate to configure nhibernate for use as an ORM. I want to be able to add a prefix to all the table names used in the application, so that if I use a database that is already servicing another application, there are no naming conflicts between the two applications. So for...

How to deal with changing feature and product names in source code?

What is a good strategy for dealing with changing product and feature names in source code. Here's the situation I find myself in over and over again (most of you can relate?)... Product name starts off as "DaBomb" Major features are "Exploder", "Lantern" and "Flag". Time passes, and the Feature names are changed to "Boom", "Lighthous...

Saxon Genitive in Naming Conventions?

What do you call your functions when names that contain a saxon genitive like "Verify Task's Priority" and "Change Argument's Priority" or "Increase Action's Delay"? Do you drop the apostrophe? verifyTasksPriority(), changeArgumentsPriority(), increaseActionsDelay() Do you drop both the apostrophe and the "s"? verifyTaskPriority(), cha...

column name "descriptor" -> 'MyDAL.CompanyTable.Descriptor' hides inherited member

I wanted to take advantage of SubSonic's default behavior to find the first non-key string column to use as the object description. Usually I just name that colun description and then [bracket] it in t/sql. This time I decided to name the column "Descriptor". That leads to this warning - Warning 3 'SW21Console.DAL.CompanyTable.Descr...

Linq2sql naming convention

I have just started using Linq2sql, it generates all of the Classes after my tables which is awesome. my problem is that i have a lot of objects that have the same name as my tables. this is forcing my to fully namespace everything which i don’t really like as i think it makes my code look messy. Has anyone found an elegant way to get ...

Best practices for naming user controls?

I've created quite a few user controls to encapsulate GUI functionality used in multiple places in my app. I've noticed I usually have a tendency to describe the function of the control and tack "Control" on the end of the name, but not always. I'd like to standardize the naming and wanted to know if there's a best practice for naming Us...

Naming convention for actually choosing the words in Python, PEP8 compliant

I’m looking for a better way to name everything in Python. Yes, I’ve read PEP8, Spolsky’s wonderful rant, and various other articles. But I’m looking for more guidance in choosing the actual words. And yes I know A Foolish Consistency is the Hobgoblin of Little Minds. But, you can keep consistent with PEP8 etc, and still not h...

Javascript Method Naming lowercase vs uppercase

I am for the most part a developer in ASP.NET and C#. I name my variables starting in lowercase and my methods starting in uppercase. but most javascript examples I study have functions starting in lowercase. Why is this and does it matter? function someMethod() { alert('foo'); } vs function SomeMethod() { alert('bar'); } ...

Does functional programming mandate new naming conventions?

I recently started studying functional programming using Haskell and came upon this article on the official Haskell wiki: How to read Haskell. The article claims that short variable names such as x, xs, and f are fitting for Haskell code, because of conciseness and abstraction. In essence, it claims that functional programming is such a...

Boolean method naming readability

Simple question, from a readability standpoint, which method name do you prefer for a boolean method: public boolean isUserExist(...) or: public boolean doesUserExist(...) or: public boolean userExists(...) ...

Using double negatives to test for conditions

To validate user inputs, I am unsure of which of two alternatives is better 1 isNull( Object input ) 2 notNull( Object input ) apache's commons lang library chose #2 but I am uncomfortable with double negatives. What do you say ? ...

Naming Database Tables and Views

I recently asked a colleague why they had included _TABLE at the end of all their database table names. They said it had been a standard at another orgainisation they had worked for. Other colleagues use V_ at the start of views. Is this good practice? ...

map.resource and naming convention for singleton

Hello, I am relatively new to ruby on rails, so this question might be easy. Rails does a lot of magic and I am not sure where to look up such things, because I don't know which part of the framework is to blame. I basically did the authlogic_example and fiddled around with the code afterwards. My routes.rb looks like this map.root ...

How do I explain my colleagues that filenames should not contain uppercase characters or special characters?

For what I know, it's best practice to name files like this: file_name.txt - or if you want to file-name.txt. Now some people seem to like to name their files fileName.txt or FILENAME.TXT or "File Name.txt" - how do explain them that it's not a good idea? Why exactly is the aforementioned file naming best practice? I only vaguely know ...

What is the name of the pattern?

Hi. I often design system where I have a class in my system that has a bunch of protected methods. The protected methods are that because they should be accessible to specializations, and as such, I consider the protected methods to be a contract between my general class and any specialized classes. Therefore I want to test that these...

Property function style conventions being effected by void*.

I'm designing a public API in C++ and believe I'd like to retain C++ property-function style conventions that look like int& Value(), and const int& Value() const as opposed to get/set prefixes which return/assign by value because I feel the usage patterns are more concise and equally readable, while blending into existing C++ code very ...

How to automatically convert underscore_identifiers into CamelCaseIdentifiers ?

I have large C++ code base. It is quite inconsistent where uses underscore_identifiers and where CamelCaseIdentifiers, but is consistent within groups of files. Think about it as a smaller library merged into bigger one. I want to standardize it within this project to Google C++ Style Guide. How can I semi-automatize it ? Preferably wit...

Use of special characters in function names

In Ruby, a standard convention is to use a question mark at the end of a method name to indicate the method returns a boolean result: [].empty? #=> true Another standard convention is to end a method name with an exclamation point if the method is destructive (that is, it modifies the original data): mylist.sort! # sort mylist in-p...

camel case method names

I understand the reason to camel case variable names, but I've always wondered why you would camel case a method name? why is it toString() and not ToString()? What purpose does it serve? ...