naming

Is it a bad idea to expose inheritance hierarchy in namespace structure?

I've got a group of inter-related classes that are all overridden together to create a particular implementation. I'm wondering if it is a good idea to enclose the interrelated subclasses in a namespace. For example purposes, consider the following namespaces and classes: namespace Protocol { public abstract class Message { } publi...

How to check set of files conform to a naming scheme

I have a bunch of files (TV episodes, although that is fairly arbitrary) that I want to check match a specific naming/organisation scheme.. Currently: I have three arrays of regex, one for valid filenames, one for files missing an episode name, and one for valid paths. Then, I loop though each valid-filename regex, if it matches, appen...

What are the naming conventions of an AS3 class?

I'm trying to write a RegEx for a code generator (in C#) to determine a proper class or package name of an AS3 class. I know Must start with a letter (capital or otherwise) any other digit can be alphanumeric cannot have spaces Is there anything else? ...

What's the best approach to naming classes?

Coming up with good, precise names for classes is notoriously difficult. Done right, it makes code more self-documenting and provides a vocabulary for reasoning about code at a higher level of abstraction. Classes which implement a particular design pattern might be given a name based on the well known pattern name (e.g. FooFactory, Fo...

Naming products

Choosing a name it's difficult... at least for me, it's agonizing. I've been know for using names of animals and characters of sci-fi series for the internal code name of a project... but the public name of a product it's very difficult for me. So how did you choose the name of the product you're working on? ...

Arbitrary Naming Convention Question About Business Objects

Ok, do you do Business.Name or Business.BusinessName SubCategory.ID or SubCategory.SubCategoryID What about in your database? Why? I'm torn with both. Would love there to be a "right answer" ...

What are the preferred conventions in naming attributes, methods and classes in different languages?

Are the naming conventions similar in different languages? If not, what are the differences? ...

.NET Testing Naming Conventions

What are the best conventions of naming testing-assemblies in .NET (or any other language or platform)? What I'm mainly split between are these options (please provide others!): Company.Website - the project Company.Website.Tests or Company.Website Company.WebsiteTests The problem with the first solution is that it looks like .T...

Is there a specific name for the node that coresponds to a subtree?

I'm designing a web site navigation hierarchy. It's a tree of nodes. Nodes represent web pages. Some nodes on the tree are special. I need a name for them. There are multiple such nodes. Each is the "root" of a sub-tree with pages that have a distinct logo, style sheet, or layout. Think of different departments. What should I name...

What's the use/meaning of the @ character in variable names in C#?

I discovered that you can start your variable name with a '@' character in C#. In my C# project I was using a web service (I added a web reference to my project) that was written in Java. One of the interface objects defined in the WSDL had a member variable with the name "params". Obviously this is a reserved word in C# so you can't ha...

Is there a .NET function to validate a class name?

I am using CodeDom to generate dynamic code based on user values. One of those values controls what the name of the class I'm generating is. I know I could sterilize the name based on language rules about valid class names using regular expressions, but I'd like to know if there is a specific method built into the framework to validate a...

What are reserved filenames for various platforms?

I'm not asking about general syntactic rules for file names. I mean gotchas that jump out of nowhere and bite you. For example, trying to name a file "COM<n>" on Windows? ...

Too many "pattern suffixes" - design smell?

I just found myself creating a class called "InstructionBuilderFactoryMapFactory". That's 4 "pattern suffixes" on one class. It immediately reminded me of this: http://www.jroller.com/landers/entry/the_design_pattern_facade_pattern Is this a design smell? Should I impose a limit on this number? I know some programmers have similar...

How do you choose your project codename?

We use code names to name branches and to have an easy way to reference the next version, before Marketing has decided what number or even name to give it when it is officially launched. I have used names of planets, moons and cities, since they offer an easy successive list to choose from, and have even used names of STDs in an attempt...

What is the worst class/variable/function name you have ever encountered

Naming things well is arguably Job 1 for professional programmers. Yet we have all suffered from some bad naming choices from time to time. So just to vent a little, what are some doozies that you may have run across? Just to get things started: One of our original developers wasn't sure what to call a secondary key - on what turned ...

What is the opposite of 'parse'?

I have a function, parseQuery, that parses a SQL query into an abstract representation of that query. I'm about to write a function that takes an abstract representation of a query and returns a SQL query string. What should I call the second function? ...

Whats a good naming convention for large scope function variables?

You can have different naming convention for class members, static objects, global objects, and structs. Some of the examples of them are as bellow. _member m_member or in java case, the usage of this.member But is there any good technique or naming convention for function variables scope. That convey when a single variable has complet...

Do you use "kibibyte" as a unit of measurement in your programs?

For decades, in the field of computing (except disk manufacturers), a KB (kilobyte) was understood to mean 1024 bytes. In the past few years, there has been a movement to use KiB ("kibibyte") to mean 1024 bytes, and change the meaning of kilobyte to be 1000 bytes, dooming us to many more years of confusion. On the other hand, the movemen...

Proper naming of enum values for C#

How do you think, is it a good idea to have such an enum: enum AvailableSpace { Percent10, Percent20, SqF500, SqF600 } The question is about the semantics of the values names, i.e. both percentage and square feet. I really believe that it's not a good idea, but I could not find and guidelines, etc. in support of this. EDI...

Naming your projects: does it matter?

I work on a variety of projects using different languages and platforms. Parts of them I abstract out into their own separate projects, and I want to open some of these up to the public. What gets me stuck is the christening. So, does it matter? Should I just choose something and stick with it? And if it does matter, what's better: a ...