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.

1
vote
5answers
314 views

Case convention- Why the variation between languages?

Coming from a Java background, I'm very used to camelCase. When writing C, using the underscore wasn't a big adjustment, since it was only used sparingly when writing simple Unix apps. In the ...
4
votes
2answers
106 views

Begin and Finish or Pre and Post in async call pair?

In an async call pair you would rather have a BeginDoSomething & FinishDoSomething or PreDoingSomething & PostDoingSomething pair? Cheers
2
votes
2answers
3k views

Naming controllers and their methods

I currently use one controller per action. One of the problems—sort of—I encountered is when naming the methods of these controllers, which only have one. Should I use a generic method name like get() ...
12
votes
1answer
15k views

What does “flatten” mean?

If I had a tree, would "flatten" intuitively imply get a list of all items in the tree, traversing from left to right? If i have a linked list, would "flatten" intuitively imply get a list of ...
19
votes
2answers
38k views

Difference between Handler, Manager and Controller

Is there any difference between naming a class "Handler", "Manager" or "Controller"? IE: PurchaseManager, PurchaseHandler, PurchaseController. Do these suffices convey the same meaning or is there a ...
2
votes
4answers
308 views

Is this a proper use of the word “enumerate”?

I'm reading a book that has a section about processes. In it is this sentence: The next method to enumerate processes is the GetProcessById method. This method does exactly what its name implies: ...
2
votes
3answers
890 views

What should I name these methods? [closed]

I have two interfaces, one with and one without generic type parameters. The non-generic interface is used internally so that I can store instances of the generic interface in a collection. All would ...
8
votes
7answers
2k views

Use of past tense (passive voice) to connote immutability? (E.g. Array.Transposed vs. Array.Transpose)

[Note: The below is a bit C# heavy in its syntax and conventions, such as citing FxCop rules, because this is my background, but the intent of this discussion is to be language-agnostic and the code ...
1
vote
1answer
392 views

Good extension name for a war file with source

Is there a name for a Java Webapp's war that includes the source code? We will be using a webserver that accepts Java Web Projects with source code) uploaded into the docroot folder, so docroot/admin....
-2
votes
2answers
203 views

What do you call a cron that cksums all your files and writes them to a database? [closed]

It is a way to take inventory of many cgi scripts and web applications in a Software Service environment. It will be a way of creating changelogs and to keep track of which customers have which ...
1
vote
3answers
137 views

What's good practice for holding a very short, predefined set of data?

When I was working on a programming project. I came across a problem where I had to store data in two different variables. The first one was a piece of data, and the second one was, well, another ...
11
votes
6answers
2k views

How do early version numbers work for new products?

I'm currently writing a small desktop application for a friend, but I'm doing it primarily as a learning experience for myself. In the spirit of getting educated and doing things The Right Way, I want ...
5
votes
1answer
2k views

How should a ViewModel be named? [closed]

While starting work on a brand new ASP.net MVC application we've learned that we should have all of our available data pushed to make it easy to create a full view. While learning this we've started ...
10
votes
3answers
2k views

Struggling not to use Hungarian notation

I've seen arguments for and against Systems Hungarian. For some years I've been working on a legacy project that uses this system by naming every variable, function with a prefix of the variable type ...
2
votes
2answers
182 views

Is it good idea to write variable names that match application specific terms?

Let us say I am writing a Facebook like application. I write code like below $this->get_user_friends(); then next morning the boss says that we don't want to call Friends friends anymore, we ...
2
votes
1answer
613 views

How do you name “javascript:” prefix in inline event handlers?

In the following code: <a onclick="javascript:alert()"> how do you name the javascript: part? Protocol, pseudo-protocol, scheme, label, prefix? I am only trying to figure out a common name ...
5
votes
3answers
859 views

Were they joking when they named PHP? [closed]

PHP stands for: PHP: Hypertext Preprocessor This a recursive loop, if I'm not mistaken. Did the creator of PHP have this in mind when he named PHP? Is this the only language where the name has ...
7
votes
10answers
9k views

Variable names: underscores, no underscores, or camel case? [closed]

Variable names can be written in many ways, but the most common that I'm familiar with are: thisisavariable, this_is_a_variable, and thisIsAVariable. Which of these are preferred, and why?
-1
votes
3answers
178 views

Naming a class that decides to retrieve things from cache or a service + architecture evaluation [closed]

I'm a junior developer and I'm working on a pet project that I want to learn as much as possible from. I have the following scenario: There's a WCF service that I use to retrieve and update data, ...
7
votes
3answers
7k views

Python lower_case_with_underscores style convention: underscores not popular? [closed]

PEP8 recommends using lowercase, with words separated by underscores as necessary to improve readability for variable and function names. I've seen this interpreted as ...
0
votes
3answers
378 views

What is a single word I can use to describe a non-query SQL statement? [closed]

I'm trying to come up with a good name for a data access object that executes non-query SQL statements. I know DML is a valid term, but I wanted to make sure it is the best. Right now we have ...
4
votes
7answers
2k views

How to ensure quality of code? [closed]

I have been learning programming in C# for about a year and a half now. How should I ensure that the code that I am writing and the habits are forming are good ones? ie. I don't want to end up having ...
24
votes
5answers
30k views

What to do if I hate C++ header files?

I was always confused about header files. They are so strange: you include .h file which doesn't include .cpp but .cpp are somehow compiled too. Recently I joined a team project, and of course, ...
20
votes
13answers
8k views

Are short abbreviated method/function names that don't use full words bad practice or a matter of style? [duplicate]

Is there nowadays any case for brevity over clarity with method names? Tonight I came across the Python method repr() which seems like a bad name for a method to me. It's not an English word. It ...
16
votes
6answers
936 views

“A”, “an”, and “the” in method and function names: What's your take? [closed]

I'm sure many of us have seen method names like this at one point or another: UploadTheFileToTheServerPlease CreateATemporaryFile WriteTheRecordToTheDatabase ResetTheSystemClock That is, method ...
4
votes
2answers
324 views

Good abbreviations for XML … things

I've never been very good at maintaining a coherent bunch of variable names for interfacing with XML files because I never name the variables in my interfaces the same way across my source. There are ...
14
votes
9answers
875 views

What do you do when your naming convention clashes with your language?

Okay, this is one of those little things that always bugged me. I typically don't abbreviate identifiers, and the only time I use a short identifier (e.g., i) is for a tight loop. So it irritates me ...
7
votes
2answers
145 views

Test descriptions/name, say what the test is? or what it means when it fails? [closed]

The API docs for Test::More::ok is ok($got eq $expected, $test_name); right now in one of my apps I have $test_name print what the test is testing. So for example in one of my tests I have set this ...
14
votes
4answers
239 views

Merits of Namepsaces/Packages

Some programming languages (e.g. Java and C++) have language features called "packages" or "namespaces". How useful is it really to have namespaces? It is possible to mark functions and classes as ...
28
votes
5answers
17k views

Is the Java package name convention flawed? [closed]

We're all familiar with the Java package name convention of turning the domain name around. I.e. www.evilcorp.com would, by convention, chose to have their java packages com.evilcorp.stuff. ...
14
votes
3answers
8k views

Are my method or variable names too long? [closed]

So I was currently in the middle of coding, unfortunately for me, I was in "The Zone" then I thought to myself, are my method/variable names to long? POP out of the Zone I go! So I came here to ...
2
votes
1answer
225 views

Best place to put classes that extend the .net framework?

I have no clue where to put the following class and I've noticed I just keep putting them in a helpers folder which isn't much helpfull towards reusability in future projects. Example: I want to ...
6
votes
2answers
3k views

How would you name import and export functions in Java? [closed]

I have a Java class that handles import and export of data. It started out as a simple private void export() { } private void import() { } Of course, I wrote the export first, committed it, and then ...
1
vote
3answers
225 views

Should I bother with trying to come up with names for these? [closed]

If you were to run across code like this in your travels would the short names bother you? let setPropertyAssignment = parser { let! a = setIdentifierName let! b = propertyName ...