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

-3
votes
0answers
29 views

python function argument and local variable naming [duplicate]

I am using Python for most of my programming stuff and came across the Google and PEP 8 naming conventions. Basically, both of them suggest to use lowercase_with_underscore for both local variables ...
-1
votes
2answers
38 views

Naming convention for classes that represents different versions of the same thing [closed]

Let's imagine I have an abstract class named ProtocolA that represents the basic operations to work with the protocol A. Such protocol is in version 1, but new revisions are expected in the future. ...
-2
votes
3answers
45 views

Method naming advice required [closed]

My question will be about how do you think it would be fit to name some methods in a fluent interface. Let me try to demonstrate the problem. Consider this relation tree: A person can have dogs ...
0
votes
1answer
37 views

JSON - Ruby objects key naming

Ruby object has method/property: def tentakles_count 8 end JavaScript object has key/property: { justEnough: true } Now, when JavaScript gets serialised ruby object via XHR or WebSocket, ...
0
votes
1answer
98 views

Is this better called model, controller or something else? [closed]

I need a good name for one interface in a GUI application. The application has normal logic in standard object-oriented language, user-interface in a special language (something like XUL/XAML/...) ...
1
vote
0answers
178 views

Why does “ID” have a capital D? [closed]

Initialisms are all around us, and we've got lots of wonderful ways to format them: Capitalize all of the initials, like XMLDocument Only capitalize the first letter of the initialism, like ...
1
vote
4answers
120 views

What's in a name? Revision vs Timestamp [closed]

Apparently naming things is one of the hardest things in programming..! I have a synchronisation implementation which uses timestamps (number of seconds since unix epoch) to sync. Currently, the ...
2
votes
3answers
110 views

Using past participle for non-altering functions [closed]

I often have naming problems when I write classes and functions. Generally speaking, I try to follow the following set of rules if I have to deal with a function whose name is a verb: If the ...
0
votes
1answer
141 views

Why are Python's package names not creative? [closed]

First, I LOVE Python, and Python is my first programming language. I'm just wondering why Python's packages got kinda ugly unmemorable and sometimes very long names? I find other languages (e.g. ...
-1
votes
3answers
136 views

Should I always use “is” as prefix for boolean variables? [closed]

Should I always use is as prefix for boolean variables? What about booleans that indicate something in past? Should I write isInitialized or wasInitialized? Should I write for properties IsManyMembers ...
4
votes
5answers
204 views

Using π, φ, λ etc. as variable names while programming? [duplicate]

This is a function in the d3.v3.js file (the graph library D3.js): function d3_geo_areaRingStart() { var λ00, φ00, λ0, cosφ0, sinφ0; d3_geo_area.point = function(λ, φ) { ...
1
vote
1answer
135 views

What do you call a method that might do something? [closed]

Is it okay to call it void maybeGenerateUIDsAndDownload() ? Because sometimes it will generate UIDs and download but sometimes it will not do it.
0
votes
1answer
29 views

Naming convention for List in xsd schema

What is the best way to name a List in XSD schema? <xs:element name="CurrentEmployee" type="Employee" minOccurs="0" maxOccurs="unbounded" /> Currently I have a list of Current Employees as ...
4
votes
3answers
496 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
331 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
339 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
108 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
133 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
44 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
1answer
64 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
208 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
107 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
299 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
520 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 ...
1
vote
1answer
114 views

Naming - Differentiate between a 'User' and the 'current User'

I'm working on a site with a lot of interaction between Users. So I've named the model class User. When I refer to a page of a specific user, I have variables like user, userPoints and userUrl. When a ...
4
votes
4answers
294 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 ...
4
votes
1answer
190 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
205 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
286 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
319 views

Semantic CSS class names [on hold]

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 ...
2
votes
1answer
150 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', ...
4
votes
3answers
155 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
133 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
144 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 ...
1
vote
1answer
76 views

Tree position terminology/naming

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
92 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
143 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 ...
2
votes
2answers
274 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
431 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
60 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
202 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
132 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 ...
2
votes
3answers
170 views

How to name nested function?

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
264 views

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

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
157 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
392 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
172 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
600 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 ...