naming-conventions

Programming Jargon or Terms d'art (duck punching, etc)

monkey patching, duck typing, and even duck punching are common terms d'art in the ruby world. What other fun terms have you come across while discussing code with other programmers? I'm not aware of many outside the ruby space, except perhaps $foo (to mean any substituted idea, like "my current $boss is pissing me off" or some such). F...

that, self or me — which one to prefer in JavaScript?

While coding JavaScript sometimes you store the reference of object this in a local variable for different purposes (to set proper scope, to help code obfuscators, etc.). There are coders who prefer aliasing this to that to make it obvious its intention. Other guys use self since it's pointing to the object itself. I even saw source code...

C# naming convention for extension methods for interface

I typically name my C# interfaces as IThing. I'm creating an extension method class for IThing, but I don't know what to name it. On one hand, calling it ThingExtensions seems to imply it is an extension class to some Thing class instead of to the IThing interface. It also makes the extension class be sorted away from the interface it...

With database table design, Is there an advantage of using special naming convention for a Many-to-many table (a junction table)?

Whenever there is a many-to-many relationship, I think there will be immediately a many-to-many table needed (also called a junction table). Is there any advantage of using special naming convention for these tables, as opposed to the other 1 to many tables? Or are there popular special naming conventions used by companies designing da...

Is there a dictionary about common programming vocabulary?

When I need a name for a new class that extends behaviour of an existing class, I usually have hard time to come up with a name for it. For example, if I have a class MyClass, then the new class could be named something like MyClassAdapter, MyClassCalculator, MyClassDispatcher, MyClassParser,... This new name should of course represent...

How is this statement making sense? (Sun's naming convention for Java variables)

I've been quoting this segment from Sun's document for the past few days, and only now do I stop and think about what it's saying, and I can't make sense out of it. Please keep in mind that English is not my first language. Naming conventions << clickable to official source Variables: Except for variables, all instance, class, and c...

Python package name conventions

Is there a package naming convention for Python like Java's com.company.actualpackage? Most of the time I see simple, potentially colliding package names like "web". If there is no such convention, is there a reason for it? What do you think of using the Java naming convention in the Python world? ...

What's your convention for typedef'ing shared_ptr?

I'm flip-flopping between naming conventions for typedef'ing the boost::shared_ptr template. For example: typedef boost::shared_ptr<Foo> FooPtr; Before settling on a convention, I'd like to see what others use. What is your convention? EDIT: To those nesting the typedef inside Foo, doesn't it bother you that Foo is now "aware" of ho...

naming a method - using set() when *not* setting a property?

Is setX() method name appropriate for only for setting class property X? For instance, I have a class where the output is a string of an html table. Before you can you can call getTable, you have to call setTable(), which just looks at a other properties and decides how to construct the table. It doesn't actually directly set any class ...

In MVC file structure, what is Views/XXFolder/xxTemplateFile what is XXFolder known as?

I'm a bit confused about mvc terminology. Using the question title as an example, a view corresponds to an action, which means xxTemplateFile would be considered to represent the view. xxFolder does not represent an area. So could it be a View Collection? or View Container? Cheers, ...

The right way to write "ID" in columns in SQL

My first question in here. I like the site so much :) I've a SQL table called Product. In that table I want to make a column for the ID of the product, and I really want to know the right way to write ID because I make a lot of ID columns in the long run. So is it: "ID" or "Id" ? And also a foreign key in another table, is that called...

Accessing a namespace containing .base in its name from F#

As the title says, I'm trying to use a class declared in a namespace which contains "base" in its name. Think of a situation like the following: open Foo.base.Bar In C# I'd just use @ before base but F# seems to ignore that and to think that @ is the infix operator used for list concatenation. Since the namespace belongs to a third-par...

Code style for private methods in C#

I just found out, that it seems a common pattern to user UpperFirstLetterPascalCase() for private methods. I for myself, find this completely inconsistent with naming rules of private instance fields and variables and I find it difficult to read/debug, too. I would want to ask, why using a first upper letter for methods could be a bette...

What programming/techy name should I give my new pup?

I am getting a Border Collie puppy tomorrow. If I can get my wife to agree to do so I want to give it a techy/programming type of name. The vast majority of my development is in Microsoft .NET / C# on mobile devices (WinMo and tablets) as well as Silverlight and ASP.NET. I would like the name to be something in that area although I am op...

Grammatically correct double-noun identifiers, plural versions

Consider compounds of two nouns, which in natural English would most often appear in the form "noun of noun", e.g. "direction of light", "output of a filter". When programming, we usually write "LightDirection" and "FilterOutput". Now, I have a problem with plural nouns. There are two cases: 1) singular of plural e.g. "union of (two)...

What is the origin / meaning of these variable naming conventions?

What is the general meaning and where did it start to have variables with leading or trailing underscores? ex: _varName and varName_ I have always thought a leading underscore indicated the variable was a pointer but I don't know where I got this idea. Recently I have seen these naming conventions used in Java which makes that reasonin...

Variable naming for arrays/lists/collections - C#

What should I call a variable instantiated with some type of array? Is it okay to simply use a pluralised form of the type being held? IList<Person> people = new List<Person>(); or should I append something like 'List' to the name? IList<Person> personList = new List<Person>(); Also, is it generally acceptable to have loops like thi...

What's the difference between 'service' and 'server'?

I can imagine that the 'server' can be a machine/host but can be also a program like ftp server, smtp server, etc.. The 'service' on the other hand refers mainly to applications/programms.. Why can then for example the Sql Server cannot be called as Sql Service? It has the same semanthics. Or the other way round: MS Azure service: why i...

SQL Server Index Naming Conventions

Is there some standard way to name indexes for SQL Server? It seems that the primary key index is named PK_ and non-clustered indexes typically start with IX_. Are there any naming conventions beyond that for unique indexes? ...

filename for class files: file.class.php or file.php?

i have seen a lot of coders choosing this filename convention: file.class.php. is this a standard of naming class files? just curious. so i know if i should follow it for all class files in the future. thanks ...