Questions tagged [coding-standards]
Coding standards, or coding conventions, are sets of rules or guidelines designed to govern the process of code production in a software project. They're usually based on industry best practices or generally accepted conventions. They include naming conventions, style, prohibited features, and more.
550
questions
0
votes
1
answer
53
views
Wrapper Auxiliary Method VS Default Arguments for Initialization: Pros/Cons
I have a class in which there are several methods that can act as an "entry point" to its private innards (or the "fruit" thereof).
Said functions might be called multiple times ...
0
votes
1
answer
213
views
Creating necessary documentation for maintenance staff when only Code repository contents can be relied on [closed]
Conditions:
stable legacy prod system
no Software Devs of the system are available anymore
app is maintained by Engineers, who do not have the same software dev experience like the original Devs and ...
0
votes
2
answers
295
views
Should entities always be simple and mapped?
I am told everywhere that entities are only to represent the data structure, then entities should be mapped to a model and then the model possibly to a DTO.
The other way is similar, DTO -> model -&...
0
votes
0
answers
55
views
Are type, constant/static/global, and pointer prefixes still necessary in C coding standards, considering the capabilities of modern IDEs? [duplicate]
Our coding standards for C include various prefixes for data types, constants, static/global variables, and pointers. These prefixes were originally introduced for code review purposes, but with the ...
1
vote
5
answers
341
views
Is storing computed values always bad?
Edit: I'm copying the question but changing the example code. Apparently, I used a bad example earlier that contained an imprue getter. I'm keeping the old example code at the bottom so the first ...
0
votes
1
answer
78
views
Practical Advice for rapidly changing code maintainability [closed]
This question may get closed quickly, but I'll appreciate any advice I can get and all the resources I can find online about this topic aren't quite relevant to my case.
I am a Math PhD student doing ...
4
votes
5
answers
336
views
Naming a method that does the same thing faster but only approximates the result?
Presume I have a function that does some precise calculation on a large amount of data, call it calculateResult(data).
This function gets very slow with increasing size of input.
Luckily, I only need ...
-1
votes
1
answer
173
views
What is point of having certain microservices making another API call in the same service
I was going through an old, largely untouched part in my company’s codebase and found one API. It does the following things.
A POST API with path host/entities/trigger which fetches a list of entity ...
4
votes
1
answer
337
views
How to label backwards incompatible changes which change the API but don't add a feature?
I have a project in which I'm the sole contributor, there isn't a stable API yet and I'm constantly refactoring code, but I still try to denote breaking changes whenever they do happen. Recently ...
8
votes
4
answers
1k
views
Are there advantages to using an interface, rather than a class, for a Java application?
Java is often (rightly IMHO criticized) for overusing the class keyword, as it can denote:
a factory to instantiate objects (traditional classes)
a collection of global methods (when all methods are ...
0
votes
2
answers
530
views
Can a UUID be called a constant?
From my understanding, a constant is a value which is assigned only once and cannot change at runtime, whereas variables have mutable values which are unpredictable by nature.
My question is, to what ...
1
vote
0
answers
345
views
Is non-contiguous protobuf field numbering an anti-pattern?
Is it an anti-pattern to have gaps in field numbers to aid readability?
The need being address by this idea is that metadata fields, which are "aspect" fields, can be placed in the proto ...
4
votes
5
answers
810
views
Why are vertical and horizontal spacing heavily used in coding styles?
Why would so many repositories use additional — apparently unnecessary — vertical and horizontal space in coding styles?
I almost unanimously see this:
public function getName() {
...
3
votes
4
answers
796
views
Is the combination of state machine and pure function a programming style?
As a university student who just have been learning programming for a year. After I learned about the concept of state machine and the pure function in functional programming, I suddenly got an idea ...
11
votes
5
answers
5k
views
Should an optional boolean function argument rather default to true or false?
In many cases I can formulate some boolean parameter equally well positively as negatively, e.g. isOn or isOff. Which one should I pick then, in case I want the argument to have a default value? Is ...