Questions tagged [conventions]
The conventions tag has no summary.
125 questions
0
votes
2
answers
361
views
Should each commit in a branch implementing a new feature be prefixed by "feat:" using conventional commits?
Consider I'm working on a branch feat-1 implementing a new feature.
I'm confused what to prefix each commit with on that branch. Should they all be prefixed with feat: (after all, they are all part of ...
0
votes
2
answers
528
views
Where does the practice of naming variables with the prefix "my" come from?
I recognize that there are situations in which "my" is semantically useful, but I have met multiple professional programmers that have a habit of using this everywhere that it's not - "...
4
votes
5
answers
365
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 ...
0
votes
2
answers
388
views
Usage of overrides in the State design pattern
Imagine a situation where out of 5 state implementation classes the implementation of a method only differs on 2 of them (i.e. 3/5 share the same implementation for a particular method).
This ...
9
votes
4
answers
2k
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 ...
2
votes
4
answers
456
views
Looking for a sanity check, do you alphabetize your code? Is that even a thing? [closed]
I'm currently working with a group of developers (as outside contractors) on an existing codebase (in kotlin) and the lead dev (the client) is blocking merging of pull requests (GitHub) because ...
12
votes
5
answers
7k
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 ...
3
votes
3
answers
213
views
Should I ensure my libfoo library's include file can be included as foo/foo.h?
I'm maintaining a small C library; let's call it libfoo. It has quite a few users (actually it's complicated - it's the main fork of a highly popular library which has been abandoned); and it sports a ...
0
votes
5
answers
224
views
best practice for error handling between PAM_SUCCESS and PAM_AUTH_ERR macros
We have two exit code code PAM_SUCCESS(0), PAM_AUTH_ERR(7).
If we wanna return 0 or 7 when we compared password with our password in following code which code is better that this code ?
if (strcmp (...
2
votes
1
answer
2k
views
How can I write good Conventional Commit-style commit messages for one feature over multiple commits?
If I am working on a single feature, I would usually commit multiple commits. Should every commit start with feat? Or should only 1 commit have the type of feat and use a different type for the other ...
0
votes
3
answers
644
views
What is this numeral system notation?
I used Google search to convert numbers from one numeral system to another.
10 to binary is 0b1010;
10 to hexadecimal is 0xA.
What's the meaning of 'b' and 'x', accordingly? I think these are ...
-2
votes
1
answer
3k
views
Git semantic commit versioning for file deletions
What commit type should I use when I'm deleting files from a repo?
I have seen several types over the internet, but none talk about file deletions.
Possibly the closest options that come to mind are ...
3
votes
0
answers
822
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
2
answers
572
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
5
answers
341
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 ...