Give meaning and explanation with the fewest number of characters in a form that is most accepted by your team or community at large.

learn more… | top users | synonyms

27
votes
17answers
3k views

Is it a good practice to name the returned variable “result”? [closed]

Is it a good practice to call the variable a method returns with a variable name result? For instance: public Zorglub calculate() { Zorglub result = [...] [...] return result; } Or ...
25
votes
9answers
3k views

Why should identifiers not begin with a number?

Most programming languages appear to be designed to not allow one to declare an identifier that starts with a number. I was just curious to know the reason. I have already searched the web, but ...
2
votes
3answers
261 views

Standard semantic name for 3rd table in 3NF

For 3 tables that are in 3NF, a many-to-many relationship, is there a standard name or term to describe the 3rd table, the one that associates the other tables? Basically, I'm looking for a semantic ...
10
votes
4answers
712 views

Should we rename overloaded methods?

Assume an interface containing these methods : Car find(long id); List<Car> find(String model); Is it better to rename them like this? Car findById(long id); List findByModel(String ...
4
votes
4answers
870 views

How can I deal with developers who don't use English in code? [duplicate]

Possible Duplicate: Code maintenance: keeping a bad pattern when extending new code for being consistent, or not? I'm working on a project for a Greek public organization, as a part for a ...
5
votes
2answers
2k views

How to name a private method in a language which doesn't support privacy?

What's the coding standard for naming a private method in a language which does not have the private modifier? Specifically, I am talking about Javascript. Below I've placed an underscore at the end ...
0
votes
2answers
227 views

Semantic or structure - which should get preference for variable naming?

We've a call stack in our project. The program is written for microcontroller, the language is C. The call stack is basically an array of integers. The variable that represents this call stack ends ...
20
votes
8answers
915 views

Are there good techniques or tests for naming types?

An awkward, open question, but it's a problem I'm always bumping against: Software that's easy to maintain and work with is software designed well. Trying to make a design intuitive means naming your ...
8
votes
2answers
8k views

Naming conventions for instance, local and parameter variables

I was discussing with a senior developper coding conventions to apply to our projects (mainly Java/JEE projects). I disagreed with one convention he proposed: Instance variable names should start ...
3
votes
7answers
922 views

Any standards for naming variables in for loops (instead of i,j,k) [duplicate]

Possible Duplicate: Why do most of us use 'i' as a loop counter variable? I was just writing a nested loop and got to the point where I was using l and m as variables to control for ...
3
votes
3answers
334 views

Naming conventions for the only envisioned implementation of an interface

If you decide "Program to An Interface" trumps YAGNI and decide to create a supertype where you don't envision anything other than one obvious implementation - is there a convention for naming the ...
0
votes
3answers
696 views

Collection providing lookup by one of several keys [closed]

What do you call a collection in which each item may be looked up by one of multiple keys? A partial, simplified definition in C# might be: class MyDataStructure<TKey1, TKey2, TValue> { ...
0
votes
2answers
195 views

Naming Rules: Standards, Reserved, and what do they depend on? [closed]

I want to know the rules of naming (AlwaysCapitalize, _underscore, firstSmallLetter, etc...) for each of Namespaces, Classes, Interfaces, Exceptions, Data Members, Methods, Variables, etc.... also I ...
11
votes
5answers
1k views

What's the idiomatic name for a throwaway variable? [closed]

Velocity Template Language's set directive requires a variable on the left hand side. This doesn't work. #set ( $entries.add("d") ) Even though I have no use for the return value of add("d"), I ...
8
votes
5answers
286 views

How do you avoid name similarities between your classes and the native ones?

I just ran into an "interesting problem", which I would like your opinion about: I am developing a system and for many reasons (meaning: abstraction, technology independence, etc) we create our own ...
7
votes
2answers
127 views

What do you do when working with multiple languages with different capitalization schemes?

I'm making a webapp using Django. The Python convention for naming variables is lowercase_with_underscores, but the Javascript convention is camelCase. In addition, I've seen many people use ...
4
votes
5answers
430 views

What happened to the this type of naming convention?

I have read so many docs about naming conventions, most recommending both Pascal and Camel naming conventions. Well, I agree to this, it's ok. This might not be pleasing to some, but I am just trying ...
0
votes
1answer
75 views

Name user object and user table correctly [closed]

It's maybe simple but I think about this every time I build a new application. How do you name the class for the current user of the application and for the orm class of the user table? Usually I ...
8
votes
6answers
2k views

Is the term “web portal” obsolete?

My boss uses the term "portal" for the project I work on all the time. To me, the word makes me think of Yahoo in the late 90s. Does the word "portal" have old-school connotations, or is it just me? ...
11
votes
8answers
2k views

Meaningful concise method naming guidelines

Recently I started releasing an open source project, while I was the only user of the library I did not care about the names, but know I want to assign clever names to each methods to make it easier ...
32
votes
6answers
4k views

Should interface names begin with an “I” prefix?

I have been reading "Clean Code" by Robert Martin to hopefully, become a better programmer. While none of it so far has been really ground breaking it has made me think differently about the way I ...
1
vote
1answer
176 views

Is there a standard name for this search approach? [closed]

In order to create a (Lucene) query, an "incomplete" domain object is used. All properties with a value are used for the query, the rest is ignored. In the absence of a better name, we call it ...
3
votes
1answer
711 views

Should the name of my program be a verb (“frobnicate”) or a noun (“frobnicator”)? [closed]

If I have a program that takes some input data, frobnicates the data, and outputs the result, should the name of the program be the verb, "frobincate", or the noun, "frobnicator"? Here's a ...
126
votes
19answers
32k views

Why is naming a table's Primary Key column “Id” considered bad practice? [closed]

My t-sql teacher told us that naming our PK column "Id" is considered bad practice without any further explanations. Why is naming a table PK column "Id" is considered bad practice?
3
votes
1answer
341 views

Are there restrictions on table and column names in DB2?

I'm working with a DB2 database and I can't help but notice - these table and column names are really confusing! I realize that good names are important in every facet of software development, and ...
4
votes
3answers
210 views

When should I prefix names with the project name?

If you work with SharePoint, you'll see classes like SPList, SPSite etc. I've seen variations of this on other projects, in other technologies, e.g. for a CRM project, classes named ...
20
votes
13answers
3k views

Is Systems Hungarian notation still a useful practice? [closed]

I searched the forum, but I couldn't find the answers why it should be avoided, only why it's not a silver bullet. So I don't think this question is a duplicate. Is there a VALID reason why I should ...
2
votes
3answers
275 views

What is the general accepted way to name variables that end and start with the same letter? [closed]

Is something like this acceptable or is it frowned upon? String newsSymbol It just looks strange to me, but it's the best way to describe what the variable is and the data it will hold. I could ...
9
votes
4answers
320 views

File naming convention for images stored in version control?

My application has an icon file which is stored in version control. Now tomorrow I might decide to change the icon. I'm debating between two possible naming conventions for the icon file: Keep ...
1
vote
2answers
881 views

Is there a difference between property and attribute?

These two words are completely synonymous for me, but I wonder if there's actually a useful semantic difference that I can incorporate into coding/naming conventions/process.
4
votes
7answers
3k views

What is it called when you set properties on object initialization?

What is it called when you set properties on object initialization? var customer = new Customer() {RequestID = request.ID, AddressID = 5}; Is it considered good practice?
5
votes
5answers
296 views

Is it good or bad form to name a function after the workaround it fixes?

Lets say you have to write some code to fix a bug that on first glance by another engineer would seem weird or unnecessary. Would it be good or bad form to put the code in a method named for example ...
10
votes
3answers
652 views

What's the reasoning behind the “I” prefix naming convention for interfaces in .NET?

I know the "I" convention has been around since COM, but I've never understood why it hasn't been reconsidered like every other naming convention before .NET has. Consumption wise, the only thing ...
14
votes
5answers
2k views

Why it is called “hash table”, or “hash function”? Hash doesn't make any sense to me here

It's now about 4 years of development that I'm using, hearing, talking about, and implementing hash tables and hash functions. But I really never understand why it's called hash? I remember the first ...
1
vote
1answer
195 views

Namespaces and naming

I'm having some trouble working this one out, probably more than I should. This is a pretty large project, with a very clearly defined structure, with no obvious problems, but I can't seem to figure ...
5
votes
3answers
1k views

What should I name this helper class? [closed]

Usually when writing unit tests I create a helper class with extension methods. I use these methods exclusively for generating generic data for things that I am too lazy to type out. I usually name ...
0
votes
1answer
139 views

C++ wrapper for “releasing” a singleton object

I have a class like this template <typename T, typename Policy> AutoObjectRelease { public: AutoObjectRelease(T& obj):obj_(obj){} ~AutoObjectRelease(){ ...
5
votes
5answers
1k views

When inheriting from a class in C#, which naming convention is preferred?

If you inherit from Tile, for example, should the subclass be called CollisionTile or just Collision? What about for painting tools in an application like Paint? PenTool or just Pen? Are there any ...
4
votes
4answers
3k views

Naming for a REST webservice

I have a rest webservice with an endpoint www.foobar.com/service.svc/MAC (migration authorisation code). Posting and getting to that adds and gets one MAC respectively. I now need to impliment a new ...
8
votes
6answers
2k views

If this is camelCase what-is-this? [closed]

The naming convention for a term like doSomething is camel case. What would the naming convention of do-something be called?
20
votes
4answers
5k views

Classes naming: singular or plural?

It is always difficult for me to choose between singular and plural forms for classes names: CustomerRepository vs. CustomersRepository CustomerService vs. CustomersService CustomerController vs. ...
1
vote
3answers
4k views

Why am I seeing more boolean naming conventions where “is” is used as the first word in the variable (eg, IsUserAdmin vs UserIsAdmin)? [closed]

I think everyone will agree that the following boolean variable/property names are standard: UserIsAdmin OrdersAreClosed The important thing to note about boolean expressions is that they are ...
76
votes
16answers
18k views

What is the benefit of not using Hungarian notation?

One of the things I struggle with is not using Hungarian notation. I don't want to have to go to the variable definition just to see what type it is. When a project gets extensive, it's nice to be ...
13
votes
7answers
708 views

What is more standard shortening for “regular expression”, “regex” or “regexp”? [closed]

I want to know what is more standard way to call regular expression in short way. I have seen both, regex and regexp. Google says regex has almost 2 as much hits that regexp, but it depends on way I ...
4
votes
4answers
389 views

Naming conventions and organization of packages

I've been programming in Java, C#, Python and AS3 most of the time and in all of these languages there are packages (or something like that). The problem I found is with the naming convention, or even ...
10
votes
8answers
2k views

Why did Microsoft make parameters, local variables and private fields have the same name naming convention?

I asked this question quite some time ago: How do you name your private variables in C#? In one of the answers, I was pointed to Microsoft's MSDN page that shows that private variables/fields should ...
5
votes
2answers
658 views

Java class version specific naming conventions

I have to create an Adapter between two software (mech. simulation, non-cs). Assuming we have a class named ThatThing. I have to handle various vendor specific implementations. These versions don't ...
18
votes
6answers
317 views

Should the internal naming (classes, methods, database tables, etc) of entities be changed if the marketing and UI naming changes?

We've had a long living product for about 8 years now. Over time, the names of concepts and entities change. Should we put the work in to rename all the code base and database tables and columns to ...
4
votes
4answers
395 views

What is the name of this code-get-together…hackathon, codecamp, codejazz or?

Recently there's risen this small subculture in Denmark with geeks meeting up and hacking along on their sparetime projects together. The base is that there is no session, there is no keynote or ...
0
votes
2answers
236 views

Name for this pattern?

I'm writing a class that will handle thread synchronisation. It would have a begin method which would increment a counter and an end method that would de-increment a counter. It'll have another ...