Questions tagged [naming-standards]

Naming standards is about defining rules about the use of symbols such as the name of namespaces, packages, modules, types, functions, or variables

Naming standards is about defining rules about the use of symbols such as the name of namespaces, packages, modules, types, functions, or variables

171 questions
310
votes
2 answers

Python file naming convention?

I've seen this part of PEP-8 https://www.python.org/dev/peps/pep-0008/#package-and-module-names I'm not clear on whether this refers to the file name of a module/class/package. If I had one example of each, should the filenames be all lower case…
darkace
  • 3,211
149
votes
17 answers

Coding standard for clarity: comment every line of code?

I've worked in shops that produce life critical software and I've dealt with commenting rules that were meant to keep the code readable and potentially save lives. In my experience though the requirement becomes a brain dead chore to be ticked off…
81
votes
3 answers

Naming of bool methods: Is vs. Can vs.?

Which is the better name for a method that returns a boolean? IsSupportContentType or CanSupportContentType
Mediator
  • 879
72
votes
3 answers

Readme.txt vs. README.txt

I have just forked a project in Github, made my changes etc. This got me wondering: I see mostly README.txt in opensource projects and the file I edited was Readme.txt. Is this some sort of standartisation or should I have left it as is?
70
votes
8 answers

Naming issues: Should "ISomething" be renamed to "Something"?

Uncle Bob's chapter on names in Clean Code recommends that you avoid encodings in names, mainly regarding Hungarian notation. He also specifically mentions removing the I prefix from interfaces, but doesn't show examples of this. Let's assume the…
66
votes
1 answer

Swift Protocol Naming Conventions

Coming from a mainly c# background, I'm used to using the term "interface" for describing an object with no implementation that defines behaviour. In c#, the convention is to prepend interface names with "I", as in IEnumerable, etc. Of course, the…
Michael Daw
  • 763
  • 1
  • 5
  • 5
50
votes
3 answers

Why does convention say DB table names should be singular but RESTful resources plural?

It's a pretty established convention that database table names, in SQL at least, should be singular. SELECT * FROM user; See this question and discussion. It's also a pretty established convention that RESTful API resource names should be plural.…
smitelli
  • 609
  • 1
  • 5
  • 4
40
votes
6 answers

What is the philosophy/reasoning behind C#'s Pascal-casing method names?

I'm just starting to learn C#. Coming from a background in Java, C++ and Objective-C, I find C#'s Pascal-casing its method-names rather unique, and a tad difficult to get used to at first. What is the reasoning and philosophy behind this? I'm…
36
votes
9 answers

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 IsStuffDone()? Both names could be misinterpreted…
33
votes
2 answers

Why does software use the Win32 name?

If a software/library has some support for the Windows platform they almost always name their directories and variables as win32. This is most prevalent in C/C++ projects. Even the MinGW project's target triple uses win32. Is there a reason for…
33
votes
2 answers

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? They're both acronyms! Surely it'd make more sense…
Alec
  • 441
29
votes
8 answers

C# - Why are prefixes on fields discouraged?

Back in the old days, we did Hungarian notation. That's now considered passé, and for the most part I don't use it anymore, but I still find use for the m_ prefix to indicate member fields. For me, if I'm reading through someone else's code, and I…
27
votes
1 answer

What is the history for naming constants in all uppercase?

What is the history behind the convention of naming constants in all uppercase? My intuition is that it started with the C preprocessor, where people developed a practice to name preprocessor macros in all uppercase so that they would effectively…
jamesdlin
  • 428
  • 4
  • 11
27
votes
3 answers

Environment naming standards in software development?

My project is currently suffering from environment naming issues. Different people have different assumptions as to what environments should be named or what the names designate, and it's causing confusion when discussing them. I've done a bit of…
Marcus_33
  • 373
  • 1
  • 3
  • 7
25
votes
12 answers

What is the reason for using lowercase for the first word in a local variable (eg, employeeCount, firstName)

I take a good deal of criticism from other programmers due to my use of full proper casing for all my variables. For example, your typical programmer will use employeeCount for a variable name, but I use EmployeeCount. I use full proper casing for…
oscilatingcretin
  • 607
  • 2
  • 7
  • 13
1
2 3
11 12