Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [conventions]

The tag has no usage guidance.

0
votes
1answer
58 views

Difference between failed and canceled task

In case we hav functions (f_1,....,f_n) which runs in this order somewhere in the future. I would like to define a relationship between those functions such that if f_i failed due to expection then ...
-1
votes
1answer
62 views

Method naming conventions [on hold]

I am aware of the following well-known method naming conventions: valueOf(X), of(X), from(X), toX, getX, setX, isX Are there other method naming conventions that apply in specific situations?
1
vote
1answer
47 views

Naming Convention [closed]

When we determine names for the variables, there are two important issues that the people mention: The variable names must be explanatory. For the sake of this, their names can be long.` The variable ...
34
votes
4answers
6k views

Is it enough for methods to be distinguished just by argument name (not type)?

Is it enough for methods to be distinguished just by argument name (not type) or is it better to name it more explicitly? For example T Find<T>(int id) vs T FindById<T>(int id). Is there ...
2
votes
1answer
46 views

Does any scale exist (e.g. naming convention to be used for sizes) that allows trivial insertions at any point in the scale?

Question probably sounds confusing so let me clarify. Let's say I have an object containing keys and values for my project's font sizes: { small: '8px', medium: '11px', large: '14px', } ...
2
votes
3answers
90 views

Convention for labelling coordinate axes in 3d graphics

When I recently started doing some 3d graphics, I carefully (tried to be careful, anyway) decided to use the conventional mathematical standard for labelling axes, which was much more convenient for "...
2
votes
3answers
280 views

Why do we follow Convention?

Preface: I am not arguing against convention but rather want to have a greater understanding why convention is something I should follow and what are the benefits/drawbacks of doing so. I have found ...
1
vote
1answer
120 views

Naming standards or conventions for ecommerce

Naming things There are only two hard things in Computer Science: cache invalidation and naming things. -- Phil Karlton Naming things seems so trivial, before I read this quote, I would have ...
2
votes
1answer
140 views

Is the URL 'users/new' RESTful?

I was in a job interview demo-ing a RESTful API in Flask when an argument broke about the API. The interviewer argued that the URL for adding a new user (/users/new) is not proper REST. My API ...
0
votes
1answer
371 views

Proper modeling and name convention for an intermediate table between intermediates

I have 4 entities: Event, Message, Flow and Document. Event table stores a limited (seeded) number of records. Message has many events and each event can be related to many messages. The name ...
-6
votes
1answer
163 views

Where should I store data related to UI/presentation?

Say, I have a table Categories. On a page I have a header and for each category the colour of a header varies. A colour is of the presentation level and I've heard that what's related to the UI/...
3
votes
2answers
57 views

Ajax response — is there an agreement on the structure?

Say, I make an ajax request to a server from a page, something like "show more articles". Is there a common agreement on the format or rather structure in which a result should be returned? Something ...
1
vote
1answer
240 views

Where to place Docker-related configuration files

Many projects need more than a Dockerfile or a docker-compose.yml in their root to work out of the box (e.g. for local development or a demo): For example a web application might need its runtime, a ...
3
votes
1answer
59 views

Naming a view class

I'm a little hesitant on what to name a view class. I have a view class which I call ChooseImageView because that's what the user does in that view. After the user has chosen an image I display a ...
1
vote
1answer
369 views

ASP.NET MVC test structure and naming conventions

I decided to take the plunge and add the first set of integration and units tests to the projects I work on (yes, we have dozens of internal applications with no automated testing whatsoever...). I ...
1
vote
1answer
310 views

The format of an response in ajax — any convention/recommendations?

Say I have a lot of page with ajax. Is there any convention or recommendation on the format/structure of an ajax response? Namely, if there's an error, a server returns http status 4xx or 5xx and... ...
3
votes
1answer
334 views

Is it true that for both React or Angular, they are also both “convention over configuration”?

In the Ruby on Rails communication, it is often said that RoR is "convention over configuration". Can you say for React / Redux / Flux and AngularJS, Angular2, they are also "convention over ...
6
votes
1answer
17k views

The correct use of application.properties file?

Java programmers are encouraged to store all their configurable parameters in an application.properties file from which they either load properties during runtime or they load during program start and ...
22
votes
4answers
16k views

Should I really use all uppercase for my constants?

I am a Python programmer primarily who uses pylint for linting source code. I am able to eliminate all of the warnings except one: Invalid name for a constant. Changing the name to all caps fixes it, ...
4
votes
2answers
99 views

Using A Configuration Class (For All Constants/Magic's)

I come from a background where using a configuration file for every, if not every, constant is the best solution for maintainability and flexibility of the program. By this I mean, every hard coded ...
102
votes
10answers
19k views

Should I follow a bad coding style just to follow the established conventions at my workplace?

I've been working at my job for about a year. I primarily do work in our GUI interface which uses methods from a C backend, but I generally don't have to deal with them except for return values. Our ...
2
votes
1answer
794 views

Is there anything wrong with my project structure and naming convention in ASP.NET MVC and Web API?

I wonder if project structure and naming convention which I use in ASP.NET MVC and Web API projects are ok. These technologies are quite new to me, so I don't have my own standards yet. I don't ...
-2
votes
2answers
592 views

Java - is it bad to name variables starting with uppercase if they are vectors or matrices? [closed]

Often in math a vector or matrix will be denoted by a single capital letter. Would it be bad to have some variables such as this? Vector3 A = ... int Bx = ... int By = ... int Bz = .. I would ...
0
votes
0answers
123 views

Invent custom filename extension for derived format

Say I use a predefined serialization format X for certain data. Should I indicate the application in a custom filename extension or not? It is quite common pk3 is a zip archive XSL, SVG and many ...
8
votes
3answers
2k views

Naming convention for functions which have side effects? [closed]

I heard somebody say their language has a convention where the names of functions which mutate state must end with an exclamation point. I'm trying to write more functional code and I like the idea of ...
0
votes
4answers
524 views

Is “Pushing a variable to the Stack” a misnomer in C++?

In C++ a variable is allocated in the 'Call Stack' ('Stack') or the 'Heap.' Frequently when referring to allocating a variable to the 'Stack', people use the phrase "Push to the Stack." My issue with ...
2
votes
1answer
487 views

In Objective-C,what is the naming convention around protocols and their implementation classes?

Is there a naming convention for protocols and concrete implementations of them in Objective-C? Specifically regarding a protocol that's used as an abstract 'service' or 'manager' class declaration. ...
2
votes
1answer
105 views

What are good conventions/standards for application messaging through stdin and stdout?

I'm designing and application that spawns another processes to handle some specialized work. The application and the process it spawns will communicate through standard input and standard output (and ...
1
vote
3answers
101 views

In an ESB type system, what field name should be used as a “correlation ID”?

We're using ASP.NET Web API and Azure Service Bus and adding logging to our disparate services and systems. We need to track a correlation ID to the headers of each set of bus messages as well as logs ...
1
vote
4answers
374 views

How to mark/track features in code?

After some time in every project sooner or later you will need to find a feature in it a fix it or extend it so I was wondering if there is already a system or a convention for marking those features ...
0
votes
1answer
203 views

Is it worth it to follow code conventions of Netbeans? [closed]

I am always not able to follow Netbeans default coding conventions like the following Function should be N lines only Method Length is N Lines (M allowed) Warning: Do not Access Superglobal $...
6
votes
3answers
12k views

How to deal with Classes having the same name (different packages)

Me and my R&D team maintain a large codebase. We've divided our business logic into multiple packages. some of which have classes with identical names. As you can guess, the names conflict when ...
1
vote
2answers
1k views

What's the use of lint warnings vs errors? [closed]

I'm hoping someone who's given this some thought can help me understand. Most style-checking tools seem to distinguish between warnings and errors. To me, the point of a lint error is that a style ...
3
votes
1answer
129 views

CharSequence to represent a named object

I always followed the opinion to not abuse interfaces in case of decomposition. Usually I only implement them if I am absolutely sure to have a "is-a"-relation and avoid implementing them if there is ...
14
votes
2answers
12k views

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 ...
0
votes
2answers
1k views

get set method naming conventions [closed]

In OOP coding, there is a long standing naming convention to name accessor/mutator methods getThing and setThing. These directly manipulate the properties, which are often private. Should these ...
-3
votes
2answers
2k views

In HTML and CSS what are the standard tab sizes? [closed]

I searched on Google but couldn't find an answer. I'd like to know what are the standard tab sizes for HTML and CSS. Is it 2 or 4?
2
votes
1answer
74 views

Modern frameworks method conventions

I've been noticing that modern frameworks tend to have this kind of code style: expect(6 - 4).toBe(2) this can be rephrased as: assert(6-4, 2) Yet the former is much more readable. I would like to ...
3
votes
1answer
106 views

Are there any problems with defining a single-source “module” in C using conditional compilation to separate the “header” from “source”

I'm writing a project that I want to keep small in the sense of being very densely-coded and a single source file. But it's growing large enough that navigating the file is becoming tiresome, so I ...
10
votes
5answers
16k views

Is it okay to go against all-caps naming for enums to make their String representation simpler?

Several times I've seen people use title-case or even all lower-case naming for enum constants, for example: enum Color { red, yellow, green; } This makes working with their string form simple ...
5
votes
4answers
1k views

Should I edit a codebase's whitespace to conform to a coding style? [duplicate]

We have a large Java project (1m+ SLOC) with mixed whitespace - some files have tabs and some have spaces. It's tricky to make my editor work with whichever file I happen to be editing. We are ...
7
votes
2answers
4k views

What is the correct project file structure for a versioned rest api?

Should I have resource directories inside version directory, like app/ v1/ book/ author/ v2/ author/ or version directories inside resource folder app/ book/ v1/ author/ v1/...
5
votes
2answers
5k views

Is it conventional to name final/constant local variables in UPPER_SNAKE_CASE?

Pretty simple, I have a method: public final void myMethod(User user, Group group) { final int MAX_USERS_PER_GROUP = group.getMaxUsersPerGroup(); int usersInGroup = 0; // Get users in ...
0
votes
0answers
52 views

Internal class variables convention

When I see some open source projects, specifically classes, I see that its variables starts with a 'm' minuscule. What does it mean? What means the 'm'?
1
vote
3answers
893 views

Are project naming conventions more important than language naming conventions? [closed]

I'm working on a project with a senior developer and he doesn't really abide by the naming conventions of the language that we're using. The project is in Go and he uses underscores for everything. ...
1
vote
0answers
147 views

Code structure with MongoDB in python

I am new to MongoDB and python. I know how to make basic use of pymongo in order to manipulate documents. I am having trouble finding how to create some structure or governance in what gets inside ...
1
vote
2answers
135 views

Github convention for putting projects on hold

I have a few github projects on the go at the same time. I am only actively working on one at any one time which can take months. My other projects remain in a semi-completed state. Is there a ...
6
votes
2answers
1k views

How to organize predefined queries with Entity Framework?

I have some queries that I use all the time (like get rows only of some specific type, or count something etc.). I'd like to organize them somehow (better then I currently do). Currently I have them ...
3
votes
2answers
971 views

Should naming conventions be consistent or not across multiple programming languages in one project? [duplicate]

I saw this question on SO: here; the question is kind of old and not many viewed, so I want to ask it again. I currently work on a project using C++, C# and Actionscript-3, the conventions of C++ and ...
7
votes
1answer
681 views

Should the expected value be hard-coded into the Assert

My own personal preference would be to use a variable, but maybe there are reasons against this? I haven't been able to find any resources that state the pros or cons of using one of these over the ...