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

10
votes
9answers
5k 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 ...
1
vote
2answers
145 views

How are non-folder files called? [closed]

Maybe it looks like a weird question, but what term should be attributed inside the code for files that are not folders to differentiate them from folders? If I need write 2 functions isFolder() and ...
0
votes
0answers
28 views

Bounded Context naming and parts of speech

I keep coming up with the following Bounded Context names. They feel right when I just type them out in a text editor, but it's bothering me that they're not the same .. I'm going to use the word ...
2
votes
1answer
78 views

ASP.NET MVC Middle tier object naming

As a corporate developer who works alone I find myself creating and writing a lot of websites that consist of screens that are basically wrappers for a DB table. So for instance on a screen that ...
1
vote
2answers
169 views

How to deal with Classes having the same name (different packages)

My R&D team have Java packages containing classes with the same name. For instance: com.myapp.model Device ... com.myapp.data Device ... We had a discussion, the names conflict when both ...
-1
votes
0answers
22 views

Is it legally fine to name a project or a library with a famous person name? [migrated]

I wonder if there are any legal reasons for that to be not ok? There are many precedents, e.g. Sinatra, Kafka, Shakespeare, Django etc , so are there any limitations ? (living people etc)
9
votes
5answers
599 views

How to refer to ByRef and ByVal in a dropdown label? [closed]

The MSDN page on ByRef and ByVal keywords isn't very helpful; unless I somehow skipped it, they're simply being referred to as "keywords" everywhere. One of the main contributors of the Rubberduck ...
14
votes
8answers
4k views

Meaningful concise method naming guidelines

Recently I started releasing an open source project, while I was the only user of the library I did not care about the names, but know I want to assign clever names to each methods to make it easier ...
1
vote
3answers
8k views

Why am I seeing more boolean naming conventions where “is” is used as the first word in the variable (eg, IsUserAdmin vs UserIsAdmin)? [closed]

I think everyone will agree that the following boolean variable/property names are standard: UserIsAdmin OrdersAreClosed The important thing to note about boolean expressions is that they are ...
11
votes
3answers
2k views

What package name to choose for a small, open-source Java project? [closed]

I'd like to publish a small open-source library in Java. I wonder what package name should I choose? I'm not a company and I don't have a domain that I could use as the basis for naming the package ...
38
votes
12answers
2k views

Intentional misspellings to avoid reserved words

I often see code that include intentional misspellings of common words that for better or worse have become reserved words: klass or clazz for class: Class clazz = ThisClass.class kount for count in ...
0
votes
1answer
43 views

Super classes that represent a wordly hierarchy: naming conventions [closed]

I'm unsure whether this post is allowed, considering it may be subjective. However, I have seen many posts concerning naming conventions (on programmers, as well as on StackOverflow - where I'm a more ...
1
vote
1answer
165 views

Why do you reduce multiple inheritance to the diamond problem?

Whenever I read something like this: Many programmers exhibit a slight, involuntary shudder whenever multiple inheritance is mentioned. Ask them to identify the source of their unease and they ...
5
votes
4answers
877 views

How narrow or broad should constant names be?

I always seem to come back to this question and cannot settle on a convention that I'm comfortable with or that I can concretely define: when naming a constant, how narrowly or broadly should it be ...
-1
votes
1answer
56 views

How to abbreviate “Local” for a time variable, like UTC [closed]

In a database I work on, most of the datetimes I store are converted to and from UTC so all of my datetime columns end in UTC such as CanceledUTC. I have a situation where I need to store a "local" ...
1
vote
1answer
102 views

What does `Resolving` mean in programing? [closed]

I see many places where the word Resolve is used, in Dependency Injection (resolve an implementation to an interface), Package Manager (ex: Resolve packages dependencies), Web (ex: Resolve a ...
6
votes
2answers
9k views

Naming convention: field starting with “m” or “s”

I saw lot of code (for example some Android source code) where fields name start with a m while static fields start with s Example (taken from Android View class source): private ...
-1
votes
1answer
37 views

What is the broadly understood name of sub-command to check environment of the application? [closed]

Our CLI tool needs to have a sub command that verifies environment (amount of available disk space, RAM, GPU, versions of OS and drivers etc) to find out whether it can run. What would be the best ...
-3
votes
2answers
96 views

What might be a simple, expressive acronym for the usage of JSON to represent an HTML structure? [closed]

This is going to be subjective, but I think there can only be a few good possibilities for an answer, so it shouldn't be a problem. I'm not the first one to use JSON to represent an HTML hierarchy. ...
2
votes
1answer
44 views

Should a class go inside the package which pertains to it?

<?= $vars['title'] ?> For example, if we were writing a library from scratch, and we had File, FileHandle, DirHandle, and FileSystem classes, would each of these go inside a package/namespace ...
-1
votes
4answers
381 views

What does the prefix “on” in a function (e.g.“onButtonPressed”) mean?

Sometimes I'll see some functions use "on" as a prefix, for example, on a button listener: onButtonPressed(); and there are other examples: onStateChanged(); onNotified(); onResume(); Does the ...
1
vote
0answers
71 views

Word for method that gets and sets? [closed]

Is there a word for the API pattern where a method may get or set, depending on whether it is called with an argument or none? This style is often used in JavaScript: obj.prop(); // ...
1
vote
0answers
142 views

What is a good name for functions like 'sum', 'max', 'min'? [closed]

Suppose you have a function that allows you to find the sum/minimum/maximum of a data field: void g(DataField* d, Operation* op){ // applies op->f(...) on all fields of d } Operation would be ...
6
votes
6answers
504 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 ...
19
votes
1answer
844 views

What are the standards for dealing with pluralia tantum in your code? [closed]

When using variables of which their plural and singular are both the same, how do you name them? Are there any standards out there? For example: Series[] series // Plural Series series // ...
3
votes
2answers
179 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, ...
32
votes
9answers
2k views

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

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 ...
1
vote
1answer
52 views

Name pattern for quickly find descendents with SQL (PATH column with [TopId]…[DirectAncestorId].[OwnId]) NO nested sets

I read a long time ago about a pattern/technique for easily querying for all "descendants" of a record (no need to use CONNECT TO, which is not standard and not available with JPA). I remembered the ...
9
votes
2answers
1k views

What does Uncle Bob mean by 'noun phrase names'?

I am reading Clean Code by Uncle Bob. Because I am not a native-English speaker, I couldn't understand following statement: Classes and objects should have noun or noun phrase names like ...
1
vote
4answers
143 views

Better way of handling pre conditions and logging

1. Imagine you have the following: void Foo::doFoo() { if (!isConditionValid()) { log("doFoo not possible because condition is not valid"); return; } if ...
7
votes
2answers
2k views

Should APIs be in en_US or en_GB or both? [closed]

Should I write APIs in US spelling or British spelling? Or should I provide with mapping both of them to a single one and internally using anyone which I like so that both of them works ? At present ...
3
votes
1answer
74 views

Namespace by topic or by purpose? [closed]

The project I'm working on has quite a few classes. These classes can be grouped in two different ways. I'm trying to decide which grouping is best as for namespacing. Currently I a set of user facing ...
7
votes
6answers
7k views

What naming conventions do you use for php classes? [closed]

I really like using ClassNames and memberNames as convention but I am not sure how I would name the file containing a class. I like making my classes defined in a file with the exact same name as the ...
-6
votes
3answers
283 views

Why different languages have different syntax? [duplicate]

Different programming language always/most of the time use different syntax. For example take PHP, Java and Python. In Php & Java semicolons are compulsory at the end of the line, yet Python ...
20
votes
4answers
2k views

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

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 ...
152
votes
19answers
55k views

Why is naming a table's Primary Key column “Id” considered bad practice? [closed]

My t-sql teacher told us that naming our PK column "Id" is considered bad practice without any further explanations. Why is naming a table PK column "Id" is considered bad practice?
1
vote
2answers
106 views

Naming convention for getting the primitive backing a type? [closed]

I have a class that is backed by a double value, and I am wondering about accessor method names that preserve abstraction. Based on my experience in Java, there seems to be at least two precedents: ...
35
votes
9answers
3k views

Scientific evidence that supports using long variable names instead of abbreviations?

Is there any scientific evidence that the human brain can read and understand fully written variable names better/faster than abbreviated ones? Like PersistenceManager persistenceManager; in ...
1
vote
2answers
406 views

Use of “this” in Golang

On the closest thing Golang has to a style guide found here, under Receiver Names this is written: The name of a method's receiver should be a reflection of its identity; often a one or two letter ...
10
votes
2answers
6k 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 ...
15
votes
4answers
553 views

Semantically more appropriate package name than `util` for the following things?

As a strawman consider the package java.util it is a dumping ground for various classes that in most cases do not share anything in common other than the person that put them there was lazy or ...
2
votes
7answers
361 views

Vocabulary: Should I call this apply or map? [closed]

So, I'm tasked with organizing the code and building a library with all the common code among our products. One thing that seems to happen all the time and I wanted to abstract is posted below in ...
15
votes
7answers
1k views

What's the idea behind naming classes with “Info” suffix, for example: “SomeClass” and “SomeClassInfo”?

I'm working in a project which deals with physical devices, and I've been confused as how to properly name some classes in this project. Considering the actual devices (sensors and receivers) are one ...
2
votes
4answers
1k views

What do you call an iterator that returns the current, previous and next siblings of each node of a list? [closed]

What do you call an iterator that given a list [a, b, c], returns an object of the form { prev, curr, next } for each iteration? e.g, (? === undefined) { prev: ?, curr: a, next: b } { prev: a, curr: ...
60
votes
6answers
12k 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, ...
1
vote
4answers
219 views

Is there a name for refactoring technique that turns hardcoded values into configurable parameters? [closed]

What is that technique called when you take values in the code that are hardcoded and make them variable, possibly constructing elaborate OO constructs to make that variable properly configurable? ...
1
vote
2answers
176 views

Should method names getX and setX only be used for fields and have no other effects? [duplicate]

Should I avoid using getX() and setX() as names for methods that aren't "traditional" getters or setters? (Let's define traditional as it only gets/sets the field and has no other effects.) I guess ...
1
vote
1answer
109 views

How to name complex DAL/repository methods? [closed]

I'm beginning working with repository pattern. When it comes to simple queries I don't have problems with names. GetById GetByDay UpdateById If a method retrieves data filtered by two values also ...
1
vote
1answer
272 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 ...
2
votes
1answer
111 views

Ambiguity of seemingly clear method names in APIs

(The question is language-agnostic, but to illustrate the point, I wrote the examples in C#.) Say I'm trying to model the behavior of "components" that communicate via "ports". I might model this ...