Questions tagged [naming]
Give meaning and explanation with the fewest number of characters in a form that is most accepted by your team or community at large.
656
questions
2
votes
3
answers
480
views
8085 assembly question. Why flag stacks named d0-d7?
I'm trying to make my C programming exciting by learning assembly programming.
I've encountered an image of flag registers in 8085 assembly programming. In that image blocks are named from d0-d7(...
4
votes
2
answers
2k
views
Should naming conventions be consistent or not across multiple programming languages in one project? [duplicate]
I saw this question on SO: here; the question is kind of old and not many viewed, so I want to ask it again.
I currently work on a project using C++, C# and Actionscript-3, the conventions of C++ and ...
3
votes
1
answer
370
views
Naming Active-Low Outputs [closed]
I'm writing some software for an embedded system. I am trying to think of clear names for my single pin output functions.
Normally, when I'm working with active-high outputs (ON = 1, OFF = 0), I am ...
3
votes
2
answers
679
views
How to use scala case classes when delegation is needed
Let's assume in our application we want to model cars. We also want to model a car repository where we store some registered cars. How should that be modeled in scala?
Here comes my approach: First, ...
6
votes
6
answers
3k
views
Object creation: when should I expose a factory vs wrapping class?
I am having some problems trying to figure out when to use a factory or to wrapper class. This question is slightly geared towards C# I guess, so I'm not sure if this is the correct place to ask.
Say ...
3
votes
1
answer
322
views
What do you call classes that do arbitrary work in your project? [closed]
I work on a lot of projects with different teams. Every project has its own conventions, including what to call arbitrary classes that don't lend themselves to obvious names.
As a counter-example, it'...
0
votes
1
answer
107
views
Does a create() method exist as part of a pattern? [closed]
Is there something special(i.e. a design pattern being related) to a method named create()?
Background
The case is, I often make some instances of objects (of the same class/prototype). These objects ...
0
votes
1
answer
220
views
Inverse property naming (ORM scenario) [closed]
I have a class that represents a process. In this process there are inputs boxes and output boxes.
public class Process
{
public long ProcessId { get; set; }
public virtual List<Box> ...
3
votes
5
answers
361
views
Is naming a class based on its implementation acceptable?
Is naming a class according to its implementation an acceptable practice?
e.g. SortedSet if the class is maintains a sorted list of unique items or TreeSet if it using a binary search tree structure ...
16
votes
10
answers
7k
views
Why do we use non-descriptive internal codenames? [closed]
I think using codenames are quite widespread. Our company is using them too.
But my main concern is these names are usually not documented anywhere. And the meaning is spread by the word of mouth. ...
3
votes
1
answer
4k
views
Human names in programming examples [duplicate]
In small programming examples, it is established that one will probably use foo, bar, and/or baz as variable/function names.
Are there accepted human names one can use? For example, if a program is ...
0
votes
3
answers
200
views
negative boolean expressions and eager boolean OR [closed]
I come across these kinds of expressions and I have hard time reading it.
How do you read it properly to see if it is the right logic when debugging.
if (!(userLoggedIn || isAdmin)) {
console....
-1
votes
2
answers
179
views
Should I put the name of the method I'm testing in the Unit Test method's name/assert message? [closed]
Given that a method's name might change in time, is it a good idea to specify the name of the method whose return value I am asserting as a part of the Unit Test method's name? What about the message ...
41
votes
2
answers
68k
views
Naming conventions DAL, BAL, and UI Layer [closed]
I am developing a typical Web Application with the following layers
UI Layer (MVC)
Business Logic Layer (BAL)
Data Access Layer (DAL)
Each layer has its own DTO object including the BAL and DAL. My ...
1
vote
1
answer
277
views
What are classes that produce a result, but are necessarily classes because of the complexity of the task?
What generic name is given to classes that encapsulate a collection of esoteric functions which together perform some larger cohesive but entirely self-contained task useful to the wider application, ...
11
votes
4
answers
15k
views
Design pattern name for an API wrapper class [closed]
I am writing a class that wraps (the parts of) an external API I am using. Let's take the GitHub API as an example.
My imaginary GitHub class now has a fetchUser() and fetchRepository() method. When ...
1
vote
3
answers
875
views
Is there a programming pattern, design pattern, or naming convention for moving data between related schemas? [closed]
I'm working on a web application that is publicly accessible. (Really) Long story short, we have two sets of tables in the database with relatively the same names and relatively the same data. The ...
0
votes
1
answer
542
views
Naming a recursive association entity [closed]
For my current project, I need to create a database table to store a recursive association. I've done a lot of searching and have read answers on questions, such as Naming convention for associative ...
-2
votes
1
answer
242
views
Should I limit my type name suffix vocabulary when using OOP? [closed]
My co-workers tend to think that it is better to limit non-domain type suffixes to a small fixed set of OOP-pattern inspired words, e.g.:
*Service
*Repository
*Factory
*Manager
*Provider
I believe ...
3
votes
1
answer
1k
views
Naming: StartDate or StartDateTime when working with DateTimes [closed]
I am using a lot of DateTimes in my application. Now I usually name it like StartDateTime, EndDateTime, etc, to imply there is also a time involved.
I am getting a bit tired of this (it is tiresome ...
33
votes
2
answers
54k
views
Naming convention: Final fields (not static)
Today I had a discussion with a co-worker about the naming of final fields in Java classes.
In his opionion final fields should also be considered constants since their values won't change after the ...
3
votes
2
answers
4k
views
Does the pattern of passing in one object instead of many parameters to a constructor have a name?
If you have a constructor that takes a lot of parameters, like this:
public OrgUnitsHalRepresentation(List<OrgUnitSummaryHalRepresentation> orgUnitSummaryHalRepresentationList,
int count, ...
8
votes
4
answers
1k
views
"Immutable" interfaces
I am confused about the notion of immutability. Consider the following structure of a simplistic calculator:
Here are the interfaces:
interface IOperationalInterface {
int Sum(int a, int b);
}
...
16
votes
3
answers
30k
views
Multiple classes with the same name, but different namespaces?
I've run into some code (C# if it matters) that has classes which have the same name, but differ in their namespaces. They all tend to represent the same logical thing, but often are different "views" ...
5
votes
1
answer
835
views
Why are there so many CSS properties which are essentially the same?
This answer really made me wonder.
I've written CSS before and (usually) I don't really bother to support browsers other than recent firefox and chrome, but in researching I've noticed that, for the ...
21
votes
5
answers
6k
views
Is it a bad practice to give two very different files with the same general purpose the same name?
Is it a bad practice to give two very different files with the same general purpose the same name, separating them into different directories?
<script src="client_scripts/app/player_stats/...
1
vote
3
answers
4k
views
What are the bytes between the MSB and LSB named? [closed]
I've searched around and can't find anything on what the middle bytes of a >16-bit integer are called, if anything. Are there standard names for these bytes?
E.g. the number 0x0D0C0B0A would have:
...
0
votes
2
answers
153
views
Should I use check or checked? [closed]
I'm designing a library that binds to html elements on a page. In this particular case the input[type='checkbox'] will be checked if the likeItem property returns true and unchecked if the likeItem ...
6
votes
2
answers
5k
views
Project based prefix for class names [closed]
My project leader uses project based prefixes for class names, lets say projects name ABC, he create User class name as ABCUser. and he says he do this becasuse if he wants to make User.aspx Users get ...
4
votes
3
answers
335
views
Is it bad to use the same class or idiom names as in a third-party API that you're using?
FlashPunk is a third-party graphics API for simple game development in AS3, and they take what are effectively sprites or display objects of some sort and refer to them as "Entities". Entity is the ...
36
votes
9
answers
13k
views
How to name a method that both performs a task and returns a boolean as a status?
If there is a method
bool DoStuff() {
try {
// doing stuff...
return true;
}
catch (SomeSpecificException ex) {
return false;
}
}
should it rather be called ...
7
votes
1
answer
4k
views
Naming in Security Protocols: Alice, Bob and Eve [closed]
Among computer scientists and programmers, there's the common habit of naming people in the context of security protocols e.g. Alice, Bob or Eve. Descriptions of more elaborate attack vector sometimes ...
20
votes
2
answers
2k
views
Should one always know what an API is doing just by looking at the code?
Recently I have been developing my own API and with that invested interest in API design I have been keenly interested how I can improve my API design.
One aspect that has come up a couple times is (...
1
vote
2
answers
994
views
c# naming - What are common conventions for a suffix to distinguish between read-only and writable interfaces [closed]
Assume an interface that allows queries on a spatial tree
public ISpatialTree
{
int FindChildIndex(Vector point);
bool IsLeaf { get; }
ICollection<ISpatialTree> Children { get; }
}
...
6
votes
2
answers
684
views
Should duck typing affect naming conventions?
I'm a C++/C# developer and recently I've started to learn Python. I think I understand the concept of duck typing right now except for one thing.
When I'm coding in C++ or C# I sometimes create ...
4
votes
1
answer
2k
views
How to name filename parameter to make clear it should contain full path? [closed]
I'm seeking vital naming of string filename parameter in parameter list used in various methods where filename with full path is expected. In many cases also UNC path can be actually supplied as full ...
-1
votes
2
answers
784
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. ...
-3
votes
3
answers
150
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 and ...
0
votes
1
answer
630
views
JSON - Ruby objects key naming [closed]
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, ...
1
vote
4
answers
466
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 ...
67
votes
2
answers
58k
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 ...
8
votes
5
answers
4k
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(λ, φ) {
d3_geo_area....
5
votes
3
answers
4k
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);
}
This ...
8
votes
5
answers
430
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 ...
6
votes
3
answers
1k
views
How do I effectively address code-review feedback about class and method names without a suggestion for a better or alternate name?
Part of code review feedback is suggesting better names for methods and classes. How can I address feedback about class and method names which does not suggest an alternative?
For example, I might ...
1
vote
1
answer
1k
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
1
answer
701
views
Naming of type parameters in java [closed]
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 ...
3
votes
1
answer
591
views
Nomenclature for wildcard vs regex expressions
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} <-- '...
5
votes
2
answers
40k
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 http://msdn.microsoft.com/en-us/library/...
13
votes
3
answers
14k
views
How to name arrays or list when the nouns are both singular and plural? [closed]
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?
*...