naming

Help me name this property (C#)

Imagine I created this class: public class ColoredPolygon { public Point[] Vertices { get; set; } public Brush Brush { get; set; } } Inside Visual Studio isn't difficult to see which "Brush" is the class and which is the property. But something tells me that is not a best practice to name a property after its class. How w...

A question about organizing classes and naming them.

Hi, I am writing a set of classes: RAR, ZIP and Trip. They all share a common interest: they are archive formats. So, I initially thought about doing this: 1) Write a base abstract class abstract class Archive {} and place it at "libraries/archive/archive.php". 2) Write zip, rar and trip classes class Archive_Zip extends Archive ...

What is the preferred way of notating methods in comments?

Hey! Sometimes one has to refer to another method when commenting. Here some example in PHP: class A { /** * @see B::bar */ public function foo() { B::bar(); } } class B { public static function bar() { // ... } } So what if there would be a non-static method bar in class B? What...

Best practice for parameter naming in Java constructors and simple setters

Is there a standard acceptable convention for parameters in Java to straightforward constructors and setters? (I've seen the answer for C++, but practices are often different between the two communities) Suppose that I have a class C with a foo field. I have commonly seen the following three options: 1) Use the actual field name with ...

Should I use a SQL Server keyword as a column name?

I am designing a database and recently named a column in a table DayOfWeek, completely forgetting that DayOfWeek is a built-in function in SQL Server. Now I am deciding if I should just leave it as is and reference the column with square brackets [DayOfWeek] or change the column name to avoid any conflicts in the future. I am not too f...

Why was the method java.lang.Thread.join() named like that?

Does anybody know why the method join() member of a java.lang.Thread was named like that? Its javadoc is: Waits for this thread to die. When join is called on some thread calling thread is waiting for the other to die and continue execution. Supposedly calling thread will die as well, but still it's not clear why the author used th...

Classnames for Common Application Buildingblocks

Are you tired of the alway old Manager and Handler classes? Used all ...Thing, ...Dingus, Doodad, ...Entity, ...Gizmo or ...Object Suffixes? I certainly am and did. So here I want to collect usefull Classnames. I think this Article described it best: Do not use “Manager” or “Helper” or other null words in a type name. If you...

What would be a good naming guideline to use in Asynchronous Programming Model?

Hello all, I am doing some refactoring on a piece of code to transform all blocking operations to their async counterparts. My code is in C# and is doing an UPnP query followed by an HTTP query. For this, I use the APM methods of UdpClient and WebClient (BeginReceive, and so on). My single method is now a succession of Call_1 -> Callba...

What is a request-response pair called?

For example in HTTP you send a request and receive a response; is there a noun that describes that request-response pair? I'd thought of "dialog" or "conversation" however those imply multiple request-response pairs, whereas I'm looking for a word that indicates exactly one. The reason for asking is that I need to name an object which ...

Variable naming and team members who speak another language

I work with several developers in India and one of our biggest difficulties is their naming of variables. At first I was very frustrated and couldn't understand why they wouldn't just properly name things (was it laziness?) However, I realized that they probably aren't used to naming variables, becausee all of the code they read is in En...

Need help naming a class which represents a value and its linear variation.

While doing some refactoring I've found that I'm quite often using a pair or floats to represent an initial value and how much this value linearly varies over time. I want to create a struct to hold both fields but I just can't find the right name for it. It should look something like this: struct XXX { float Value; float Slope...

Source control vs. Revision Control?

Which is the correct name for a system which stores versions of source code, like SVN or TFS? I've always called it source control, but places like Wikipedia calls it revision control? To make this more complicated sites like this one have a tag for both? ...

What are good guidelines for naming PowerShell verbs?

I'm early on in my PowerShell learning, and I'm wondering if there are some good guidelines for verbs in Posh for cmdlets (or advanced functions, whatever they're called in CTP3). If I do a get-verb I can see the lot of them. But I'm still not sure how I should lay out my modules. Here's the example I'm running into right now. I have a...

Function naming: ActionIfCondition()

I often need to use a function which performs and action X is condition Y is set. What is the best way to name such a function? I don't want to repeat if statements, since they could be complex. For instance, if I want to trim a string if a property is set, function could be named: void TrimIfOptionSet(string) -- too unwieldy, espec...

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...

Choosing a name for an open source library

How important it is that a Google search for the name will return no result? If the library is written in Java and a search for 'java libname' returns 10,000s results, does it mean you should try harder and find a name that's availble? ...

How to generate random variable names in C++ using macros?

I'm creating a macro in C++ that declares a variable and assigns some value to it. Depending on how the macro is used, the second occurrence of the macro can override the value of the first variable. For instance: #define MY_MACRO int my_variable_[random-number-here] = getCurrentTime(); The other motivation to use that is to avoid sel...

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...

Mass Renaming of Tables and Stored Procedures

I need to rename all of my tables, stored procedures and obviously the code within each stored procedure that was referencing the old table names. Why is the best way to do this? Some methods I have considered: SP_Rename - Gets half the job done. However this doesn't change the code within the SP itself In addition to RedGates' Refa...

How to override methods in Coldfusion (adding and changing arguments etc.)?

I have two almost identical Beans. Bean "Item" contains a unique identifier (primary key), a name and an array that contains structs with data for different Users that are related to the "Item". Bean "User" contains a unique identifier (primary key), a firstname, a lastname and an array that contains structs with data of different Item...