Questions tagged [naming-conventions]

Do not use this tag to ask what you should name something. Naming conventions refer to general rules governing names assigned to programming constructs such as variables and methods. These conventions facilitate readability, and thus improved maintainability of code by enforcing naming consistency across disparate modules.

Naming conventions refer to general rules governing names assigned to programming constructs such as variables and methods. These conventions facilitate readability, and thus improved maintainability of code by enforcing naming consistency across disparate modules.

Examples

4026 questions
3
votes
2 answers

What is the favorable naming convention for methods or properties returning a boolean value in Ruby?

I've seen all of these: is_valid is_valid? valid? Is there a preferred one? EDIT: More conditionals: has_comment has_comment? comment? was_full was_full? full? Please do add more descriptive examples.
randomguy
  • 12,042
  • 16
  • 71
  • 101
3
votes
5 answers

Naming conventions for model in multi layer application

I'm a new developer I have never worked in big enterprise company so I have a question about naming conventions in multi-layer application. I have a WPF/MVVM application, with EF data layer. I also want to adjust DDD principles. So, I three models…
3
votes
6 answers

What's the significance of TLD-first domain-like identifiers?

"TLD-first domain-like identifiers" is a mouthful but that's all I can come up with. I've seen these used in various places over the years and wondered what the history/reason behind this convention is, since you might be forgiven in thinking that…
xyz
  • 27,223
  • 29
  • 105
  • 125
3
votes
2 answers

Laravel and variable naming conventions (snake case + camel case)

We are following the Laravel standard of naming model attributes as snake_case_variables. Although Laravel is just the API layer in our system that talks to a Javascript frontend and many other applications. All the consumers of our API have a…
AndrewMcLagan
  • 13,459
  • 23
  • 91
  • 158
3
votes
2 answers

What is the right naming for "VPNAPIs" class

What is the right way to write the name of a class "VPNAPIs"? Is it VpnApis, VPNAPIs or VpnAPIs? VPN: Virtual Private Network. API: Application Program Interface.
hex
  • 515
  • 2
  • 4
  • 13
3
votes
2 answers

What are the conventions for ordering parameters in Python?

What are the conventions for ordering parameters in Python? For instance, def plot_graph(G, filename, ...) # OR def plot_graph(filename, G, ...) There is no discussion in PEP 0008 -- Style Guide for Python Code | Python.org Excerpt from the…
SparkAndShine
  • 17,001
  • 22
  • 90
  • 134
3
votes
3 answers

Is any meaning difference between 'Storage' and 'Repository' in the class-naming conventions?

For example, I usually name SessionStorage but ProductRepository... It is something mental I couldn't explain to myself. Does anybody understand the meaning of suffixes Repository and Storage? :)
Alexander
  • 287
  • 4
  • 13
3
votes
1 answer

How to set ReSharper variable naming rules so that it allows underscores?

Whenever I use a variable name that stands for a primary key as int pk_MyObject = GetPrimaryKey(myObject) ReSharper complains about the pk_MyObject and offers me to rename it pkMyObject. How can I add a new rule to ReSharper so that it does not…
pencilCake
  • 51,323
  • 85
  • 226
  • 363
3
votes
1 answer

What table naming convention is best for ORM

I recently started work at a new shop that uses a table naming convention like the following: Users UserRoles UserUserRoles UserProfiles UserProfileLanguages The convention I've been using is: Users Roles UserRoleMaps Profiles Languages When my…
Derek Hunziker
  • 12,996
  • 4
  • 57
  • 105
3
votes
2 answers

Naming conventions for Code Contract classes of Interface types

I'm using the Code Contracts classes in the System.Diagnostics.Contracts namespace to define some contracts for my objects and I'm wondering how others name their contract classes when the contract is defined against a base interface. Let me…
Matt B
  • 8,315
  • 2
  • 44
  • 65
3
votes
1 answer

Camel case name for class with "IPv4"

I have class named Ipv4Address. What would be idiomatic camel case name for it? By idiomatic I mean meeting Google Java Style and meeting Checkstyle AbbreviationAsWordInName check. This question does not answer my question - I'm asking here…
Michal Kordas
  • 10,475
  • 7
  • 58
  • 103
3
votes
1 answer

good name for "add one more entry" pattern class

I am creating a GUI in java and there are multiple places where I want a form with a button to add one more entry ( see an example of the form here. It is in french, but I think it does not matter. ). Since the logic to add/delete entries is the…
fredq
  • 141
  • 4
3
votes
2 answers

MATLAB: How can I use a variables value in another variables name?

I am wondering if this is possible. My code looks like this: indexStop = find(firstinSeq(x,4) ~= ... littledataPassed(y:length(littledataPassed),4), 1, 'first'); for z= 0:(n-1) indexProcess =…
Maxwell
  • 257
  • 2
  • 7
3
votes
2 answers

Uppercase for variable on PHP, good or not?

Is it recommended to write code in uppercase ? Like: $VARIABLE = "JohnDoe"; REQUIRE_ONCE 'class.username.php'; $_USERNAME = NEW USERNAME(); $_USERNAME->ADD($VARIABLE); Thanks.
Laurie Cos
  • 75
  • 2
  • 8
3
votes
9 answers

Naming variables that contain filenames?

If I've got a variable that contains the fully-qualified name of a file (for example, a project file), should it be called projectFile, projectFileName or projectPath? Or something else?
Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
1 2 3
99
100