Questions tagged [programming-practices]
Programming Practices are the commonly or not so commonly used practices in development of software. These can include things like Agile Development, Kanban, Coding shortcuts, etc.
1,593 questions
0
votes
4
answers
224
views
Use-cases for Expression<TDelegate> except translating to another language?
So I just learned about Expression<TDelegate>. As a library author this really intrigued me; my libraries make extensive use of source generators to generate both high-performance code and code ...
-2
votes
1
answer
163
views
Best Practices for Managing Multiple Entity Types in ASP.NET Core
I'm working on an ASP.NET Core application that requires handling multiple types of a single entity. Each type has its own properties and validation rules, which has led to confusion and complexity in ...
-1
votes
1
answer
158
views
Testability when API contract is fixed
Recently, I spoke to an Engineering Manager about some work I've done:
I had to implement a micro-service to a third party API contract (that they will call). Part of the requirement is to ...
0
votes
0
answers
62
views
Web application having database with OPC client
I'm designing a browser-based application that will display real-time data collected from OPC server. I have decided to use Angular framework for the browser application development. The browser ...
0
votes
3
answers
230
views
Use of environment variable or appsettings as a counter, good or bad practice [closed]
I'm wondering if it's bad practice to have a variable in a webserver which counts the amount of incoming requests and put it in an environment variable.
In C# for example you have System.Configuration....
0
votes
1
answer
119
views
Best practices for minor changes to packages that are no longer maintained?
I'm writing a python package that depends on a relatively old library that breaks in a very specific case: when running a container in read-only mode, a .wh..wh..opq file is added to a directory where ...
-2
votes
1
answer
462
views
Are there good practices or even conventions to store LLM prompts I use while coding?
I sometimes use some language model assistance (e.g., GPT-4o) while coding. I'd like to save somewhere the prompts and language model versions I used. Are there good practices or even conventions to ...
10
votes
4
answers
5k
views
Is there something between Debug and Release build?
Specifically with CMake builds, if you don't specify a build type explicitly, the build will use neither Debug nor Release compilation flags.
I was writing my own Makefile for a simple program and ...
-3
votes
2
answers
698
views
Is throwing an error in programming is good Idea at all? [duplicate]
I am wondering if throwing an error in programming is good Idea at all ?
While programming we throw error when something unexpected or invalid has occurred. But if we have thrown exception and it is ...
1
vote
2
answers
155
views
how best to take a vertical slice of something already trivial?
Lets say I have a project which is something relatively simple like a copy checker for legal text files stored in git, that multiple people contribute to via pull requests that must be reviewed before ...
0
votes
1
answer
239
views
Is immutable objects over POJO in general?
Lombok is used in the legacy project where I am currently working for since last year. The project is legacy with 10+ years, and POJO/JavaBeans, i.e. @Data annotated classes, have been widely used for ...
0
votes
4
answers
199
views
How to eliminate repetition in three subclasses: each defines an identical method that does almost the same thing, but with a different return type
TLDR:
I have three subclasses, each inherits from the same parent class, each defines an identical method that does almost the same thing, except that each of these methods has a different return type....
2
votes
2
answers
587
views
Is trunk-based development viable for SDK development?
Is trunk-based development (TBD) viable for development of software where versioning, compatibility, long term support and service level agreements (SLA) play a big role for business (e.g. libraries, ...
-1
votes
1
answer
100
views
Is there any benefit/viability to sharing models across API versions that have differing schemas
I have been asked to get involved with a Team that is currently having delivery issues for various reasons. During my review I came across an acceptance criteria on a user story;
If you call v1 of ...
5
votes
5
answers
951
views
Is it bad practice to use nullptr in ternary operation?
I've set up a ternary operator in place of a pile of if-else's, the final expression being nullptr in order to finish the loop, like so:
int menuSelect;
std::string operation="";
(...