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

0
votes
1answer
33 views

Name for an ancillary executable [on hold]

I'm a stickler for naming conventions and for their consistent use. I'm writing an application that consists of a windows service that is in charge of maintaining x number of running instances of ...
12
votes
2answers
480 views

Why does XMLHttpRequest not seem to follow a naming convention?

I've been working with the XMLHttpRequest object in JavaScript recently, and I couldn't help but notice that the casing of this name makes no sense. Why is 'XML' all in caps while 'Http' is not? ...
-2
votes
2answers
94 views

What is a good name for a class that interacts with a command line tool? [on hold]

I'm writing a program in Java that includes a component that will interact with command line tool. In particular, I want to automatically process some data from an open-source GitHub project, so one ...
6
votes
5answers
366 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(λ, φ) { ...
10
votes
8answers
3k views

Data structure for accessing units of measure

TL;DR - I'm trying to design an optimal data structure to define units within a unit of measure. A Unit of measure is essentially a value (or quantity) associated with a unit. SI Units have seven ...
0
votes
1answer
37 views

How to design method that returns a compact representation of sourcecode

Let's say we have a class that stores some textlike content like sourcecode as a string. We want the class to be able to not only show the sourcecode itself but also a more compact representation. My ...
3
votes
4answers
503 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 ...
0
votes
1answer
136 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, ...
7
votes
6answers
5k views

What naming Convention to Use for C# Function Parameters

There are situations when a name passed in Parameter will be Cast into a new type, but the name of the Passed object should remain similar. For the case of Class Attributes, we can use this operator, ...
9
votes
3answers
9k 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 ...
0
votes
1answer
73 views

Does a create() method exist as part of a pattern? [on hold]

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 ...
0
votes
0answers
40 views

type name for state machine state (as opposed to other state variables)

I need to create a typedef for a state machine state, e.g. enum ToasterStateMachineState { TSM_READY, TSM_TOASTING, TSM_DONE }; But ToasterStateMachineState seems verbose and redundant; is ...
1
vote
1answer
118 views

Use Generic of Specific Function names for similar objects

Is there a school of thought on putting focus on using generic names for functions, opposed to naming functions based on the things they do? Example Say we have a Bill / Price Sheet object, that has ...
0
votes
1answer
69 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> ...
2
votes
4answers
200 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 ...
14
votes
10answers
2k 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. ...
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 ...
1
vote
1answer
308 views

Naming in Security Protocols: Alice, Bob and Eve

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 ...
1
vote
3answers
135 views

negative boolean expressions and eager boolean OR

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)) { ...
0
votes
2answers
74 views

Should I put the name of the method I'm testing in the Unit Test method's name/assert message?

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 ...
1
vote
2answers
359 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. ...
1
vote
1answer
110 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, ...
1
vote
4answers
222 views

Design pattern name for an API wrapper class

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 ...
11
votes
13answers
4k views

Should I add an “Abstract” prefix to my abstract classes? [closed]

Suppose I have an abstract class named Task. Is there a standard or convention that would suggest I should name it AbstractTask instead?
0
votes
1answer
33 views

Naming schema for config files that generated and not for human editing?

Some configuration files have warning: automatically generated, don't edit! I have one that hold build number and VCS tag (Java .properties file). What name pick for such file? Currently I stuck to ...
0
votes
3answers
173 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 ...
-1
votes
1answer
65 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 ...
106
votes
17answers
22k views

Is there an excuse for short variable names?

This has become a large frustration with the codebase I'm currently working in; many of our variable names are short and undescriptive. I'm the only developer left on the project, and there isn't ...
52
votes
16answers
6k views

Is it bad to use Unicode characters in variable names?

I recently tried to implement a ranking algorithm, AllegSkill, to Python 3. Here's what the maths looks like: No, really. This is then what I wrote: t = (µw-µl)/c # those are used in e ...
3
votes
6answers
471 views

How to define a natural id in database?

There are a lot of manuals. I am trying to create an database to hold information of these documents. But, there is a small problem. How can I give meaningful id to the manuals? Are there any ...
0
votes
1answer
414 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 ...
13
votes
4answers
1k views

The problems with Avoiding Smurf Naming classes with namespaces

I pulled the term smurf naming from here (number 21). To save anyone not familiar the trouble, Smurf naming is the act of prefixing a bunch of related classes, variables, etc with a common prefix so ...
-3
votes
2answers
103 views

How to name a clamp function that only clamps from one side? [closed]

Clamp() is a function that ensures that provided variable is in provided range. You can find such function in .NET, in Unity, and probably anywhere. While it is useful, I often need to clamp my value ...
0
votes
1answer
156 views

Should I limit my type name suffix vocabulary when using OOP?

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 ...
0
votes
3answers
385 views

What is the general definition of something that can be included or excluded? [closed]

When an application presents a user with a list of items, it's pretty common that it permits the user to filter the items. Often a 'filter' feature is implemented as a set of include or exclude rules. ...
2
votes
1answer
285 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 ...
2
votes
2answers
196 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" ...
0
votes
3answers
264 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, ...
7
votes
4answers
478 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); } ...
3
votes
1answer
467 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 ...
1
vote
1answer
99 views

Several enum classes that declare constants with the same names

I'm working on a Java library for sorts for Magic: the Gathering. Well, without going into a lot of detail, in the game there are five different colors of magic: white, blue, black, red, and green. ...
12
votes
5answers
2k 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 ...
-1
votes
3answers
173 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: ...
1
vote
1answer
136 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 ...
4
votes
4answers
308 views

Naming boolean variables: negated or not

A few years ago, I was in a software engineering class and the teacher explained how messages, options, variables, etc. should not be negated to avoid confusion. He gave the example (something like): ...
0
votes
2answers
145 views

function naming: plural form of “if not exists” [closed]

This is a question about function naming. I am writing some code that updates the structure of a database according to a specification. Somewhere in this code I have something like this: void ...
0
votes
2answers
92 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 ...
2
votes
2answers
335 views

Project based prefix for class names

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 ...
30
votes
9answers
3k 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 ...
3
votes
3answers
98 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 ...