Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Posts by Alexei
I have to migrate a bunch of text from an old application into a new one. Some of these texts contain HTML tags and entities (HTML editor was used) and now they do not want to support this in the n...
If you do not mind having so much code on a single line, the builder pattern might be useful here. Something along the lines: Note: the example is adapted based on an implementation I have done in...
Shouldn't it be a category of Software Development too? Probably not Unless it is a very specific question as in the examples provided by Lundin which are clearly related to software developm...
Many questions and answers on Software might involve a lot of code that typically require more width and/or height to be displayed in a way that is easy to read. Why simply not enforce resize: non...
One way to do this is to launch a Task at application startup as soon as possible (the DI is configured). The only hard part is to make DI available in the prewarm functionality. The following imp...
I am caching some very static information (changes once per day) in my ASP.NET Core application. This is normally done when needed ("lazy"). One such cache item is a 50K list of items that are tak...
Our team is finally focusing on writing more automatic testing and one of my ex-colleagues recommended to try out the Verify library. The tool does the following: runs the test and compares the...
I am interested in finding out all the aspects I need to cover in order to correctly assess if a user has stopped interacting with a web page. So far, I found the following: Idle Detection API -...
Note: this is mostly based on personal experience rather than benchmarks. The examples would focus on using EF with SQL Server, but some points might apply to other ORMs and relational databases T...
There are a lot of articles and presentations that show little love for ORMs. This is mainly because some queries are so complex and heavy on the database that they lead to significant issues in p...
Overflow checking for integral-type arithmetic operations is disabled by default and it can be explicitly enabled by using using checked function or the -checked compiler switch. Since I mainly de...
I would skip the theoretical part of actually computing the cyclomatic complexity of a switch statement and mention that it can see as a bunch of if statements. Since each if adds to the complexity...
During a presentation of a pipeline configuration, a colleague showed a SonarQube integration and one of its reports. A warning was caused by overrunning the max value for the code complexity thres...
I would like to ask a question about the pros/cons of using a library or more generally a way of assertion of complex data models. This is more related to testing than it is to actual coding, but ...
Our team will have to migrate an old application to use a new tech stack. One of the features involves the usage of HTML editors which serialized the content as HTML and I am able to see valid HTML...
One of the legacy applications my team has to maintain has almost always this pattern for dealing with data modification: try { // get the connection // begin transaction // optional...
Based on my experience auto-mapping has some drawbacks: "find all references" not working as expected - anyone relying on the "find all references" functionality or similar will miss the impli...
I have noticed that lots of projects (both in real-world and within online courses) use Automapper to map domain models to view models, API models. The main advantage seems to be convenience by re...
I have not used a database trigger in years in the projects of the teams I have worked in, but I have seen them being used by other teams. Back in 2009, it seemed like a heated debate, but I am wo...
A person I used to work with several years ago was hired to rewrite a product using a .NET-based modern tech stack. One of the aspects that stroke me was that he believes that the product should mo...
Yes I would allow UI/UX questions with some limitations. Examples: on topic - UI/UX questions related to an interface that also involves some programming (e.g. web interfaces) offtopic -...
A significant fraction of software developers also needs to make some UI/UX-related decisions. I am wondering if we should such questions in the Software Development community. Based on feedback...
Unless there are reasons for keeping the "check for unintended consequences" and "perform the action" in the same endpoint, I would split them into two parts: GET /api/v1/action-can-charge-the...
LazyCache provides CachingService as a concrete implementation of the IAppCache. When unit testing simply instantiate the tested service using CachingService: var testInstance = new FooService(ne...
A few of my services rely on LazyCache and they use it by injecting IAppCache. For unit testing, I would like to mock this. I have found MockCachingService, but it does not do any caching (as spec...