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

1
vote
1answer
53 views

Name for a Chainable ForEach

Linq has a method Select, which takes a Func<TIn, TOut> and maps it over an iterable. I'm trying to come up with a good name for a method that takes an Action <TIn>, transforms it to ...
-4
votes
0answers
59 views

Snake case, camel case and nr 3? [on hold]

Sometimes it appears code where the styles are mixed and you want programmers to use the same conventions i e either snake_case or CamelCase, doesn't really matter which you choose as long as you are ...
-3
votes
0answers
53 views

good C struct for representing another program? [on hold]

If I have a struct in C struct str_list *chunks = str_split(cmd, '|');and a function call cmd(chunks->size); then what should the function prototype look like? Mat told me to create a struct ...
1
vote
1answer
57 views

Phrase for “timestamp”-like value that increments every time there is a state change?

Is there a phrase in common use for a counter that is incremented every time the state of an object changes? It's not quite a timestamp and it's not quite a revision but maybe there is a common name ...
-4
votes
1answer
198 views

Class library naming conventions [closed]

Typically in a C# program, the entry point is in Program.cs. However, if you are creating a rather generic class library, with no Main() method, such as TCPClient.dll what is the appropriate base ...
31
votes
6answers
27k views

Naming classes, methods, functions and variables [duplicate]

There are 3 important naming conventions: with_underscores PascalCased camelCased Other variants are not important because they are not commonly used. For variables it seems that the one with ...
-6
votes
0answers
42 views

Naming of velocity + position tuple of data

The code manipulate object in 2D space, and a very common value is a tuple of four values, position in x axis, position in y axis, velocity in x axis, velocity in y axis. In C++, it is: typedef ...
0
votes
2answers
144 views

Is there a name for “leak” of CPU usage? [closed]

A counterpart to memory leak, but involving CPU time instead - the program's CPU usage slowly climbing to 100% and then the whole system slowing down - without memory footprint changing. An example ...
4
votes
3answers
339 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 ...
0
votes
4answers
89 views

Word to unambiguously represent data used at the input to a template? [closed]

I asked this on english.stackexchange.com and did not get a satisfactory response. I am trying to come up with a very specific semantically narrow term for the information/data that fed into a ...
1
vote
2answers
177 views

What do we call “ip and port”?

When I'm looping through files and coming up with dynamically created ansible playbooks and stuff like that, I've quite frequently have to work with a single variable that contains the ip and port of ...
42
votes
7answers
11k views

Should interface names begin with an “I” prefix?

I have been reading "Clean Code" by Robert Martin to hopefully, become a better programmer. While none of it so far has been really ground breaking it has made me think differently about the way I ...
1
vote
1answer
112 views

Best practices for scientific variable naming?

What are some of the conventions you use when naming variables in mathematical/scientific code? I'm looking to establish a set of conventions for an upcoming project. So here's an example formula to ...
0
votes
0answers
51 views

Namespace naming and parts of speech

I keep coming up with the following Namespace 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 "part of ...
-1
votes
1answer
34 views

How to name functions which continue a process after an asynchronous step

Say that you have an web application which prints pages in a document. Suppose that after validating the page range, the application does the following: If a billing option is turned on, it first ...
4
votes
1answer
95 views

Why would you want different identifiers for a typedef and its associated struct tag?

Ignoring (with difficulty) Occam's Razor which would seem to put this quickly to rest, what advantage would this have: typedef struct s_header { struct s_header *next; //... } Header; over ...
1
vote
4answers
227 views

Naming: objectAction or actionObject? [closed]

The question, Stored procedure Naming conventions?, and Joel's excellent Making Wrong Code Look Wrong article come closest to addressing my question, but I'm looking for a more general set of criteria ...
5
votes
3answers
439 views

“Smart create” method naming

Every class of a model in my application has a create method. The framework gives me the default implementation of create which is “create in the DB”. Sometimes I need to perform some extra actions ...
13
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
150 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 ...
2
votes
1answer
114 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
232 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 ...
9
votes
5answers
618 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 ...
15
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
9k 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
3k 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
49 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
182 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
881 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
68 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
121 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
10k 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
40 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 ...
2
votes
1answer
47 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 ...
0
votes
4answers
494 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
72 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
154 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
551 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
854 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
210 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
57 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
147 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
75 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 ...
8
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 ...
-4
votes
3answers
348 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
3k 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 ...