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

5
votes
3answers
743 views

Extension method naming convention [closed]

We are using some utility methods in our company to simplify programming. So we have following string extension: public static bool IsNoE(this string s) { return string.IsNullOrEmpty(s); } ...
9
votes
5answers
345 views

How to make it obvious that a function is being accessed from the outside?

This is a C specific question. I am trying to keep everything possible inside the translation unit boundaries, exposing only a few functions through the .h file. That is, I am giving static linkage to ...
5
votes
4answers
367 views

Meaningful names in weakly typed language like JS

I've been learning java for about a year, but recently entered the world of javascript. I'm having trouble coming up with meaningful names in function parameters, so that I'll be able to tell and ...
0
votes
1answer
126 views

Names for generic classes - how to avoid naming them just “object”? Use synonyms?

When programming, I often end up naming some generic class (think of an abstract base class for stuff you manage in your project) something like FooObject, FooComponent or FooItem (where Foo is an ...
1
vote
1answer
166 views

Naming of type parameters in java

We all know that it is good to use descriptive identifier names. However, the convention in java is to use a single letter for a type parameter identifier. The default most people go to is T, but if ...
0
votes
1answer
67 views

Nomenclature for wildcard vs regex expressions [closed]

When I see the term pattern in a description of syntax I infer a regular expression is being specified. Is there a separate term that specifies a wildcard expression? ^foo.*(bar|baz){3} <-- ...
0
votes
3answers
143 views

Naming interfaces for persistent values

I have 2 distinct types of persistent values that I'm having trouble naming well. They're defined with the following Java-esque structure, borrowing Guava's Optional for the example and using generic ...
0
votes
2answers
1k views

Summary of C# naming conventions (official Microsoft conventions) [duplicate]

I am struggling with naming convetions in C# I do not know when to use PascalCase or camelCase. I have read Microsoft's naming convention, but I got lost ther ...
1
vote
3answers
145 views

How to name arrays or list when the nouns are both singular and plural?

Generally variables are named in the singular Car car; and arrays and list with the pluras: List<Car> cars; or Car[] cars; But what about nouns like fish or media* that are already plural? ...
4
votes
2answers
341 views

Why are “class” variables misspelled? [duplicate]

I have started to see variable initialisations like that in Java libraries: Class clazz = new Class(); or Class klass = new Class(); Is there a particular reason for people to misspell the word ...
9
votes
3answers
625 views

How should I mark types in C and C++ programs?

In this answer of mine, I used _t at end of types, which ended at best, controversial. This is the practice I use in my current projects. typedef struct { int x; int y; } point_t; This was ...
4
votes
4answers
323 views

Why is the following naming guideline different between OO and non-OO languages?

I am working with a non-OO language and I'm trying to name my routines consistently. I came acrross the following guideline from Steve McConnell's Code Complete: To name a procedure, use a strong ...
5
votes
1answer
251 views

Should methods that return boolean be named after a question or an assertion? [closed]

Many naming conventions recommend that methods returning a boolean (also called predicate methods) should be named after a question. My question is: don't they really mean the methods should be named ...
2
votes
2answers
212 views

What kind of transform is this?

I have a function that linearly "remaps" a value from a given interval to an other interval? The function remaps a value from a given interval [oldMin, oldMax] to another interval [newMin, newMax] ...
7
votes
3answers
316 views

What is the name of the functional argument in fold

In the higher order function fold/reduce what is the name, if any, of the functional argument? I am working on a monadic tabular processing library where rows are folded to produce simple analyses ...
3
votes
2answers
758 views

Semantic CSS class names [closed]

I always read articles that suggest to not use presentational CSS class names. Currently I'm working on a small website project. The footer on this website looks like this: Although it's pretty ...
3
votes
1answer
412 views

When defining directory path, should a trailing slash be included?

Say I'm defining a directory and then including files from it. Is it better practice to do: define('PATH', 'C:/xampp/htdocs/includes/'); require PATH.'header.php; or: define('PATH', ...
2
votes
3answers
243 views

Naming convention for higher order functions?

Is there a naming convention for higher order functions? That is, functions which return other functions. An example in Javascript: function onlyDivisibleBy(div) { // <-- higher order function ...
-1
votes
2answers
144 views

Naming methods that perform HTTP GET/POST calls? [closed]

In the application I am currently working on, there are generally 3 types of HTTP calls: pure GETs pure POSTs (updating the model with new data) "GET" POSTs (posting down an object to get some data ...
1
vote
4answers
148 views

Naming a release

OS X 10.9 not just called 10.9 but also Mavericks. iOS7 is just called iOS7. Android releases are named after sweets. What is the rationale of giving a name to a release version? What are the ...
0
votes
1answer
92 views

Tree position terminology/naming [closed]

This is a naming things question. I am processing trees (XML documents), and there are often special rules applied to nodes based on structure. It's been very difficult coming up with concise naming ...
0
votes
1answer
170 views

Naming a predicate: “precondition” or “precondition_is_met”?

In my web app framework, each page can have a precondition that needs to be satisfied before it can be displayed to the user. For example, if user 1 and user 2 are playing a back-and-forth ...
1
vote
3answers
180 views

How important is to avoid name collisions between libraries belonging to different domains?

I have written a small open source Java library for facilitating conversions between different types of objects (in the style of Google's gson, but quite more general). It seems to me that a nice ...
4
votes
4answers
600 views

Naming boolean field that is a verb

In Java, by convention getter and setter for boolean fields will be isField() and setField(). This works perfectly fine with field names that are adjectives like active, visible, closed, etc. But how ...
3
votes
3answers
793 views

Naming convention for array, plural or singular? [closed]

Let's say we have a class that represents a Sudoku grid. In that grid we have a collection of cells. Now, if I simply made a collection of these cells accessible through the class the naming it would ...
2
votes
1answer
63 views

A good name for ValueObject that contains database update/create column values [closed]

We all know these fields, database admins so like to add: UserCreated & DateCreated UserUpdated & DateUpdated They need to be displayed in the UI so I want to put them in some ValueObject ...
2
votes
5answers
218 views

Short function names for often used function or general concept

I am a bit in a dilemma: Let's suppose I have a very general function and a specialization of it for convenience reasons. Let's also assume that the specialized function is used 90 per cent of the ...
15
votes
3answers
1k views

Is it poor practice to name a property/member the same as the declaring type in C#?

For instance, a class like: class Dog { } //never mind that there's nothing in it... and then a property like: Dog Dog { get; set; } I've been told that if I can't come up with a more ...
16
votes
4answers
2k views

Is it ever a good idea to use the design pattern name in the implementing classes?

Recently I came across a moderately large python codebase with lots of MyClassAbstractFactory, MyClassManager, MyClassProxy, MyClassAdapter etc. classes. While on the one hand those names pointed me ...
2
votes
1answer
140 views

State pattern long state class names

I am using state pattern on 28 states in my application. The states are for membership cards that has 7 major states, there are 4 boolean attributes for the membership card that actually affects the ...
1
vote
2answers
228 views

How to name nested function? [closed]

When you have a function that wraps another one in Scala. What do you call the nested function? I found this : def factorial(i: Int): Int = { def fact(i: Int, accumulator: Int): Int = { if ...
2
votes
2answers
276 views

What are appropriate metaphors for the pieces of a word processor? [closed]

A word processor is a complicated creature of many layers and pieces, but it represents a relatively simple concept: a piece of paper with writing on it. This leads to the problem of having many ...
1
vote
1answer
163 views

Is there a good name for “classic” .NET?

So, as Microsoft has created many forks and branches off of .NET, there have been a few different product names come up: Silverlight .NETCore/WinRT/.Net for Windows Store Apps .NET for Windows ...
5
votes
1answer
783 views

Should I use mMember and sStatic naming convention in Android?

Android source code and many Android open-source apps and libs use m prefix for member fields and s prefix for static member fields: private static boolean sStarted; private long mTimestamp; I ...
2
votes
2answers
230 views

collection naming - singular or plural

This is related to this question but not quite the same. BTW, I'm not a native English speaker. I keep having a hard time choosing a proper name for collections - Lets say that we have a collection ...
0
votes
5answers
607 views

Changing a variable through a series of statements … What is this technique called?

I'm looking at a function that that has several statements like this: n = returnDifferentVersionOf(n); I.e., the value of the same variable n changes progressively several times during the course ...
2
votes
2answers
97 views

Should I put the datatype of a class attribute in its name?

Most of my system's class attributes are just text, but in this case it makes more sense to place this particular class's attributes into one single hash (from a "keep the source code pretty" aspect). ...
4
votes
4answers
1k views

Can a method that must be overridden be considered private?

Suppose I have a class C with a method f() which is meant to be used only within C's implementation, but which should be overridden by C's subclasses. Is it reasonable, or "pythonic", to consider it ...
2
votes
1answer
95 views

What to name a new interface that is replacing an existing one?

We're redesigning our application's plugin interface, so we're using the Adapter pattern with our proof-of-concept design to show that the new interface will function without committing to using it in ...
6
votes
2answers
2k views

Naming conventions for Java classes that have a static main method?

After reading gnat's answer to Why a static main method in Java and C#, rather than a constructor? I take his answer to mean that the purpose of a Java class with a static main method is to define a ...
1
vote
3answers
153 views

How to call something that can be both a user and a usergroup? [closed]

My idea is, to create an abstract class / interface which can be extended into a user, and into a usergroup. There actually is a good reason for there being this interface connecting the groups with ...
0
votes
2answers
884 views

When should we clean up old, no longer used GIT branches? [duplicate]

We have several bugfix branches that are starting to pile up. They have been merged into master, and deployed to production. Is there a good benchmark for when these branches should be cleaned up? ...
10
votes
3answers
203 views

Which is better for small bug fixes and small features - naming branches by ticket number or naming them by feature description?

I am in the middle of a disagreement (cordial, of course) with my lead about proper branch naming. This applies to bug-fix and small feature branches, not long-running feature branches. For ...
3
votes
1answer
139 views

Is there a name for a randomized heap?

I've made a container which functions like a Binary Heap in terms of insertions and popping the root element. The key difference is that the comparison steps are all replaced with a random call for ...
0
votes
1answer
239 views

How to justify efforts to make capitalization of class and property names uniform? [closed]

In this thread, an Oracle Product Manager (username "Alex Keh") refused to make Oracle's EF provider to conform with .NET's PascalCase coding standard for class names and property names, saying that ...
30
votes
9answers
2k views

Why do old C-style method names continue being used in modern languages?

I understand that in the earlier days of computing, shorter method names like printf made sense, because storage was limited. But why do modern languages like Python and Go still use the less readable ...
47
votes
5answers
6k views

Why is Inversion of Control named that way?

The words invert or control are not used at all to define Inversion of Control in the definitions that I've seen. Definitions Wikipedia inversion of control (IoC) is a programming technique, ...
4
votes
2answers
816 views

Java naming conventions vs. C++/C naming conventions

I am a Java developer who is starting to pick up more and more C++/C (yes I know they're different, bear with me). One thing that struck me as odd was the different naming conventions used by these ...
1
vote
1answer
115 views

Is there a name for this tree variant?

So I've created (and I'm sure someone else has come up with this before - I'm not claiming to have invented it) a data structure which consists of a binary search tree, only instead of each node ...
0
votes
2answers
260 views

Which is Preferable: FirstName LastName or Forename Surname etc [closed]

It seems there are many different ways to represent the same information: FirstName, MiddleName, LastName Forename, MiddleName, Surname GivenName, MiddleName, FamilyName Which one is preferable? It ...