Questions tagged [conventions]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
29 views

Broker queue and topic naming conventions

I'm in the process of adding a message broker (ActiveMQ Artemis) to a system currently and while I have my own notions on how I can divide up the namespace, it seems like a good time to get opinions ...
0
votes
2answers
104 views

Should default settings be considered as business rules from the viewpoint of “Clean Architecture”?

The examples of default settings: Default port for server applications Default resources directory for Java Applications Default Webpack config file ("webpack.config.js") My particular ...
-2
votes
5answers
274 views

Why does today's companies follow old RFC's?

Let me start by saying that of course conventions are important, there should be a rule of thumb for some cases that is representing the best action to follow by, in order to prevent mistakes and make ...
3
votes
1answer
181 views

Why is it not the case that all d-tors of virtual C++ classes be virtual?

I am basically plagiarizing When NOT to use virtual destructors?. The excellent answers remind us that C++ is pay only for what you use. However, the Standard is a couple of thousand pages long. The d-...
2
votes
2answers
418 views

Does it make sense to use meaningless named constants?

For example, does it make sense to refactor the following code: a = a * 2; as: const int INT_TWO = 2; // ... a = a * INT_TWO; My question hinges on the fact that the new constant conveys no ...
0
votes
2answers
99 views

How to divide responsibility between poco, writer and converter

I have several POCO´s (simple classes holding data) that I have need to flush from memory from time to time whenever a collection grows too large. Most often I want to upload the data to a REST ...
1
vote
0answers
32 views

Standard way to bulk crud image with caption in an API?

I am trying to build a API for doing CRUD on images with their caption. So far I can think of option1: sending the images in form-data as list of images and their corresponding captions in another ...
-4
votes
1answer
76 views

Java Class Structure

I have a problem during a project of mine using Java, as usual my java classes have the structure: import ...; import ...; ... private Type0 myVariable0; private Type1 myVariable1; ... ... private ...
9
votes
1answer
811 views

What does “TILT” mean in a comment?

I'm reading Clean Code by Robert C. Martin, and the phrase TILT inexplicably appears in some code samples. Example (it's in Java, by the way): ... public String errorMessage() { switch (...
0
votes
0answers
39 views

HTTP/REST and chained processing protocol/convention

Is there a protocol or a convention that supports REST (ok, maybe we should use HTTP here instead) processing chain and some neat features to help with that? Let me explain what I mean. Let's assume ...
-4
votes
1answer
80 views

Public var vs protected var and get function [closed]

I've noticed this style of code a lot in frameworks like Symfony and Magento 2 (which is based on Symfony): <?php class Foo { protected $foo; # construct function - not ...
3
votes
2answers
631 views

Is there a term for functions starting with the “Is” prefix?

There are a number of functions of a kind; returning a boolean, and the name always starts with the "Is" prefix. e.g. IsAlive(), IsDead(), IsKeyPressed(), IsKeyReleased(), etc. How do we categorize ...
1
vote
1answer
122 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 ...
2
votes
1answer
380 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 ...
36
votes
5answers
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
53 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', } ...
1
vote
3answers
223 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
610 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
294 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
188 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 ...
1
vote
1answer
1k 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 ...
-7
votes
1answer
245 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
78 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
449 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
113 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
582 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
446 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... ...
2
votes
1answer
563 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
29k 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 ...
41
votes
5answers
51k 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
114 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 ...
101
votes
10answers
20k 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
1k 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
1k 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
298 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 ...
12
votes
3answers
3k 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
824 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
740 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
163 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
138 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
410 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
216 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 $...
9
votes
3answers
32k 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
4k 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
164 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 ...
36
votes
2answers
31k 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
3k 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
79 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
111 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 ...