naming-conventions

Naming convention: exit status, exit code or return code?

This is maybe a silly question but what should be the proper naming for the exit code variable? exit_code exit_status return_code ...something else? I'm referring to both application or function exit codes. I know that all of them are synonyms but it would be nice to have a single one, just for consistency. Which one should be, and...

Naming Boolean (bit) Values in a SQL db

The AdventureWorks Data Dictionary specifies that the [EmailPromotion] column in the [Contact] table is an int and that: 0 = Contact does not wish to receive e-mail promotions. 1 = Contact does wish to receive e-mail promotions. and [Employee].[CurrentFlag] uses bit as follows: 0 = Inactive 1 = Active My question has two parts: I...

Better Term than "Decisecond"

I have a data element with units of tenths of a second (that is, the value "123" really means "12.3 seconds"). What is a good term for an descriptive identifier for this type of data? I'd be comfortable writing something like durationMilliseconds or durationMicroseconds, but durationDeciseconds looks odd. durationInTenthsOfSeconds does...

Ideas for good class name

How would you name a class with the following public interface: /// <summary> /// Enqeues and exectutes actions synchronously on seperated threads using the <see cref="ThreadPool"/>. /// </summary> /// <remarks> /// Syncronism is guaranteed on a per-instance base in that each enqued action will be executed /// after the pre...

.Net naming conventions vs W3C specifications

I'm having a hard time resolving a naming convention conflict I'm having with implementing part of the W3C HTML5 specification using .Net. The issue is that I like to conform to standard .Net naming conventions, which use UpperCamelCasing, but the W3C specifications indicate that the naming conventions should use lowerCamelCasing. Shou...

Why aren't constants all in upper-case in .Net?

Microsoft naming conventions for .Net put constants in Pascal Case. In fact, it explicitly tells us to avoid using all caps for constants: You might also have to capitalize identifiers to maintain compatibility with existing, unmanaged symbol schemes, where all uppercase characters are often used for enumerations and consta...

Is there such design pattern? How to call it?

I have such design: public interface MyInterface { public abstract List<Sth> getSth(); } public class MyConcreteImplementation implements MyInterface { private ConcreteSth mSth = new ConcreteSth(); public List<Sth> getSth(){ return mSth.getSth(additionalParams); } } Purpose of code above is to provide unifie...

What is the favorable naming convention for methods or properties returning a boolean value in Ruby?

I've seen all of these: is_valid is_valid? valid? Is there a preferred one? EDIT: More conditionals: has_comment has_comment? comment? was_full was_full? full? Please do add more descriptive examples. ...

Swing components naming convention?

Is there any naming convention for swing components such JButtons..? or does any body knows any good way for doing that? Thanks ...

What is the normal convention for naming and using iterators in C++?

I feel like I'm unprofessional in the way I name and use iterators. What I mean by that is that I "feel" like I should be calling them something else, but I always name them based on the "it_" prefix, and after a while, in a long function, the names start to all look alike. Additionally, I always wonder if I'm doing things a "strange" w...

Program info; conventions, am I doing it right?

Adding file information to a program. /** * @Author: Kyle * @Date: 9-29-2010 * @Description: Stack overflow question! */ Am I doing this right? I have a C programming course and I've been authoring my programs with something similar to that. Also... Where would I include version information for a file? Would I include it under the da...

Collection naming convention

Hi, how should I name array that holds widths of columns? I would use: int[] columnsWidths; but I saw in many places names like: columnWidths or colWidths Of course "widths of columns" is only an example. Moreover, I think there is also another case, when 2 words are not 2 separate words, but create some kind of name, e.g. cl...

How do F# types transfer over to C#?

If in F# I have methods like: drawBox drawSphere paintImage Would they be transferred to C#, exactly the same? If that's the case, then wouldn't it compromise the naming conventions in C#, where methods are supposed to be PascalCase? Or should I make them PascalCase in F# as well to remedy this? ...

Is it a bad practice to use the name of a type for a member function or variable?

If the answer is yes, can you tell me why? here is an example: namespace urx { struct reserved { }; struct side { urx::reserved reserved() { /*...*/ } }; } int main() { urx::side side; side.reserved(); } reserved is used for both a type name and a function name. side is used for both a type name and a variable name. b...

How to name my enum elements?

Hello, I have a problem naming the elements in my application's data model. In the application, the user has the possibility to create his own metamodel. He does so by creating entity types and a type defines which properties an entity has. However, there are three kinds of entity types: There is always exactly one instance of the ty...

Message passing nomenclature

Is there a reasonably accepted taxonomy for message passing methods? I think I've found a couple of different concepts with a somewhat confusing nomenclature (message queue, mailbox, channels, etc). I'd like to know if there is some reference (book for example) that I could refer to. ...

Java package naming and non .com domains

From what I understand Java packages often use a company's website as a package namespace. For example if stackoverflow had a Java widget library it might be called com.stackoverflow.widget. But what happens if you use an obscure TLD. Is info.example.widget acceptable? ...

What general term can be used to describe KVC/KVO, Bindings and Objective-Cs dynamic messaging?

I'm struggling to find a simple term to describe the collection of "soft" technologies used in Cocoa development: KVC/KVO Bindings Dynamic messaging Message forwarding Dynamic typing Is there a general term that can be used to lump all of them together? ...

Naming conventions for java methods that return boolean(No question mark)

I like using question mark at the end of method/function names in other languages. Java doesn't let me do this. As a work around, how else can I name boolean returning methods in java ? Using an 'is', 'has', 'should','can' in the front of method sound ok for some cases. Is there a better way to name such methods ? For e.g. createFreshSn...

Looking for Suggestions on Microsoft Visual Studio Solution and Project Naming Conventions

There doesn't seem to be any tried and true set of best practices to guide you on how to setup your solutions, projects and the assemblies they output. Microsoft seemed to have tried back in the VS.net days, but they have since retired this content. For every method I read about I read another that claims the opposite is better, or a pos...