Questions tagged [naming]

A general purpose tag to cover anything concerning naming, be it files, programming constructs, data etc.

A general purpose tag to cover anything concerning naming, be it files, programming constructs, data etc.

1723 questions
91
votes
0 answers

Why are we using i as a counter in loops?

Why are we using for (int i = 0 ; i < count ; i++){ } Why the i? Why not for (int a = 0; a < count; a++){ } I do it, you do it, everyone does it, but WHY? *Edit I found out an old saying about Fortran which is more funny than correct which says…
Eric
  • 19,525
  • 19
  • 84
  • 147
84
votes
9 answers

Parameter naming: filename or fileName?

I try to be grammatically correct in my naming*. I've always used filename instead of fileName. The java convention also seems to use this, but FxCop prefers fileName. There's a discussion on WikiPedia about it. The more I read, the more I feel…
Steve Dunn
  • 21,044
  • 11
  • 62
  • 87
82
votes
3 answers

When setting environment variables in Apache RewriteRule directives, what causes the variable name to be prefixed with "REDIRECT_"?

I am trying to set Apache environment variables (for use in PHP) with the [E=VAR:VAL] flag on RewriteRule rules in an .htaccess file. I have already discovered the variables are accessed in PHP as server variables $_SERVER rather than $_ENV (which…
trowel
  • 961
  • 1
  • 8
  • 8
78
votes
9 answers

What is the purpose of constraint naming

What is the purpose of naming your constraints (unique, primary key, foreign key)? Say I have a table which is using natural keys as a primary key: CREATE TABLE Order ( LoginName VARCHAR(50) NOT NULL, ProductName VARCHAR(50) …
Andrew
  • 11,068
  • 17
  • 52
  • 62
77
votes
12 answers

What is a request-response pair called?

For example in HTTP you send a request and receive a response; is there a noun that describes that request-response pair? I'd thought of "dialog" or "conversation" however those imply multiple request-response pairs, whereas I'm looking for a word…
Greg Beech
  • 133,383
  • 43
  • 204
  • 250
73
votes
2 answers

Why is it called "Rust"?

Why is the Rust programming language called "Rust"? Is there anything known about who named it, and why? (I am having a hard time coming up with a positive association).
Thilo
  • 257,207
  • 101
  • 511
  • 656
70
votes
2 answers

Why are underscores better than hyphens for file names?

From Building Skills in Python: A file name like exercise_1.py is better than the name exercise-1.py. We can run both programs equally well from the command line, but the name with the hyphen limits our ability to write larger and more…
atp
  • 30,132
  • 47
  • 125
  • 187
67
votes
3 answers

Folder naming convention for python projects

What is the naming convention in python community to set names for project folders and subfolders? my-great-python-project my_great_python_project myGreatPythonProject MyGreatPythonProject I find mixed up in the github. Appreciate your expert…
CognitiveRobot
  • 1,337
  • 1
  • 9
  • 26
62
votes
12 answers

Source control vs. Revision Control?

Which is the correct name for a system which stores versions of source code, like SVN or TFS? I've always called it source control, but places like Wikipedia calls it revision control? To make this more complicated sites like this one have a tag…
Robert MacLean
  • 38,975
  • 25
  • 98
  • 152
50
votes
24 answers

How to name variables

What rules do you use to name your variables? Where are single letter vars allowed? How much info do you put in the name? How about for example code? What are your preferred meaningless variable names? (after foo & bar) Why are they spelled "foo"…
BCS
  • 75,627
  • 68
  • 187
  • 294
48
votes
13 answers

Best practice for parameter naming in Java constructors and simple setters

Is there a standard acceptable convention for parameters in Java to straightforward constructors and setters? (I've seen the answer for C++, but practices are often different between the two communities) Suppose that I have a class C with a foo…
Uri
  • 88,451
  • 51
  • 221
  • 321
47
votes
5 answers

Java Queues - why "poll" and "offer"?

Ok, so I've been using Java for a long time now and have recently been preparing for my OCJP exam. I was wondering if anyone might be able to provide any insight into why the method names "poll" (as opposed to the more traditional "pop") and "offer"…
zpangwin
  • 1,082
  • 1
  • 12
  • 17
47
votes
4 answers

How to access the NUnit test name programmatically?

Is there some global state somewhere that I can access the currently-running test name? I have tests which output files into a directory and read them back in. I'd like each test to create a directory to play in and then clean up after itself, and I…
TALlama
  • 16,017
  • 8
  • 38
  • 47
47
votes
6 answers

Is the word "Helper" in a class name a code smell?

We seems to be abstracting a lot of logic way from web pages and creating "helper" classes. Sadly, these classes are all sounding the same, e.g ADHelper, (Active Directory) AuthenicationHelper, SharePointHelper Do other people have a large number of…
Kye
  • 5,919
  • 10
  • 49
  • 84
45
votes
3 answers

Max name length of variable or method in Java

Is there a max length for class/method/variable names in Java? the JLS doesn't seem to mention that. I know very long names are problematic anyway from code readability and maintainability perspective, but just out of curiosity is there a limitation…
talg
  • 1,759
  • 6
  • 22
  • 30