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

REST API Resource Naming Conventions - User or Users (pluralisation)

Long Version For some, myself included, one of the most painful and headache causing parts of building a REST API is determining the name for each resource and the accompanying endpoints. Whilst it is, of course, down to personal preference; there…
Ben Carey
  • 16,540
  • 19
  • 87
  • 169
3
votes
1 answer

Is that compulsory to apply class name to each and every element in HTML while using BEM (Block,Element, Modifiers) naming convention?

I am trying to put the BEM naming convention in action but having some confusions about naming the HTML elements. I really want to understand do I really need to provide the class name for each HTML element. Let's say I have the following code and…
Amit Kumar
  • 301
  • 2
  • 13
3
votes
0 answers

Package structure by layer or feature in maven multi module project?

I have been reading about why it is more convenient to structure the packages by functionality. I understand that it has greater modularity and that it is easier to navigate in the packages. However, what happens with projects with modules by…
SerchRac
  • 171
  • 1
  • 12
3
votes
2 answers

Using sqldf with r variable containing underscore in its name

This code > A <- data.frame(col1 = c(1,2,3),col2 = c("red","blue","green")) > color_num <- 2 > fn$sqldf("select * from A where col1 >= '$color_num'") yields the error Error in eval(parse(text = paste(..., sep = "")), env) : object 'color' not…
Rookatu
  • 1,487
  • 3
  • 21
  • 50
3
votes
1 answer

Gitignore like file convention

I'm developing a script with (Groovy/Java) which compare two folders and generate a diff patch file in zip format. The thing now is i have to ignore some file within the iteration because they should not be included in the patch…
Rcordoval
  • 1,932
  • 2
  • 19
  • 25
3
votes
4 answers

"foop": a naming convention? It's a helper recursive function for "foo"; what does the suffix "p" mean?

I've come across the following code snippet (a function definition): choose (x:xs) = choosep x xs where choosep x [] = x choosep x (_:_) = x choosep _ (x:xs) = choosep x xs in Curry programming language in a "standard…
3
votes
4 answers

Should my database tables be prefixed?

Quick question: I have the following tables in a database called 'galaxy' - where galaxy the name of my web application. The tables: galaxy_user galaxy_user_profile galaxy_user_subscription galaxy_subscription_type Is it necessary or wise to include…
JCraine
  • 1,159
  • 2
  • 20
  • 38
3
votes
7 answers

Is there a best way to handle naming fads?

In the last year and a bit of working on my team's code base I have noticed a steady progression of naming conventions. For example, there are a lot of classes that are named to express that they are a class that helps you do something. Here's the…
mezoid
  • 28,090
  • 37
  • 107
  • 148
3
votes
3 answers

Change POJO name while generating from hibernate

I'd like to know how i can change the name of my POJO when generating it using hibernate. My tables have a naming convention of : FR_ and TRN_. While generating the POJOs I'd like the remove the FR and TRN and append VO to the name. For…
Varun Achar
  • 14,781
  • 7
  • 57
  • 74
3
votes
2 answers

TCL - List with Variables

I am having trouble creating a list of lists that contains a mixture of text and variables in TCL. I have a user input variable that I then want to plug into a list. I will skip the user select option for brevity. set a 0.1 set b 20.0 set c { …
Fenix713
  • 33
  • 1
  • 3
3
votes
1 answer

Naming conventions for responsive variables in SuitCSS

I recently started using suitCSS naming conventions in my Sass (not using default PostCSS setup) and it's not clear what's the correct way of naming variables: Variables used inside of component's media queries. In official docs, I only saw the…
3
votes
1 answer

Naming Event Handlers: How to make the first letter uppercase

I usually name the controls of my window application starting with a lowercase letter. Eg: startButton optionsListBox And when I suscribe (through VS) to an event of one of those controls, it automatically gives names…
Oscar Mederos
  • 29,016
  • 22
  • 84
  • 124
3
votes
1 answer

Perl module naming convention

I have checked On the Naming of Modules, perldoc perlvar and perldoc perlmod but can not find best practices for naming modules whose name is an acronym: SMTP, ORM. At once on CPAN both variants names are seen: SMTP and Smtp If my new module name is…
Eugen Konkov
  • 22,193
  • 17
  • 108
  • 158
3
votes
1 answer

Naming convention for checked and unchecked exceptions in Java

I am writing an application wehre I have some custom exception classes. The naming convention what I use for the custom exception classes is Error.java. For…
zappee
  • 20,148
  • 14
  • 73
  • 129
3
votes
1 answer

Java - interface methods naming convention

I've read many questions about interfaces naming conventions, but none about their methods. Take for example this interface. public interface TableProvider { ServiceProxy getServiceProxy(); JsonParser getJsonParser(); String…
LppEdd
  • 20,274
  • 11
  • 84
  • 139