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
0votes
4answers
224views
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 ...
-2votes
1answer
163views
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 ...
-1votes
1answer
158views
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 ...
0votes
0answers
62views
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 ...
0votes
3answers
230views
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....
0votes
1answer
119views
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 ...
-2votes
1answer
461views
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 ...
10votes
4answers
5kviews
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 ...
-3votes
2answers
698views
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 ...
1vote
2answers
155views
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 ...
0votes
1answer
239views
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 ...
0votes
4answers
199views
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....
2votes
2answers
587views
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, ...
-1votes
1answer
100views
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 ...
5votes
5answers
951views
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=""; (...