Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

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.

Activity for Alexei‭

Type On... Excerpt Status Date
Question How to get rid of HTML tags and convert entities in SQL Server?
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 new application. How to get rid of the tags and transform the HTML entities?
(more)
about 2 years ago
Answer A: How to create an object, call one of it's methods and pass it as an argument as a oneliner?
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 a .NET and deviates from the canonical example shown in the reference. Define the builder ```ja...
(more)
about 2 years ago
Answer A: Software recommendations category
> 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 development, I would not like general software recommendations on Software Development: - Power User Codid...
(more)
about 2 years ago
Question Allow question and answers textareas to be resizable
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: none` and allow the user to resize the textarea to their needs (if the browser allows it and they want t...
(more)
about 2 years ago
Answer A: Preloading some data at application startup as fast as possible
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 implementation is based on this article. ```c# /// /// Credit: https://anduin.aiursoft.com/post/202...
(more)
about 2 years ago
Question Preloading some data at application startup as fast as possible
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 taking less than 500ms when the application is deployed and about one second in the development environme...
(more)
about 2 years ago
Question What are the drawbacks of using data snapshot testing?
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 JSON serialization of the actual result with a JSON file named after the test name. The first run w...
(more)
about 2 years ago
Question Detecting if a user has stopped interacting with a web view for a certain time
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 - this seems to do most of the work for idle detection. However, it requires user permission - Detect ...
(more)
about 2 years ago
Answer A: How to write database friendly code when using an ORM?
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 The provided references explain why ORM and relational databases are quite incompatible but do not prov...
(more)
about 2 years ago
Question How to write database friendly code when using an ORM?
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 production. After quickly reading the aforementioned article I understand that there are many incomp...
(more)
about 2 years ago
Question Measuring arithmetic overflow checking overhead in C#
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 develop business applications where the main focus is correctness, I am wondering if globally switch...
(more)
about 2 years ago
Answer A: Why static code analyzers such as SonarQube indicate a high code complexity for switch statements?
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, the higher the number of `case`s, the higher the complexity. While a simple switch such as the ...
(more)
about 2 years ago
Question Why static code analyzers such as SonarQube indicate a high code complexity for switch statements?
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 threshold in a function containing a fairly large switch statement. Why are switch statements considered t...
(more)
about 2 years ago
Question Should we allow questions about software quality assurance?
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 it is certainly tied to writing code. I am wondering if we should allow such questions in our comm...
(more)
about 2 years ago
Question Migrating HTML strings to a more secure alternative
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 in the database for those fields. The HTML editor is quite limited (text formatting, links, but no s...
(more)
about 2 years ago
Question Rationale of using database-level transactions inside a store procedure when application layer already manages a transaction
One of the legacy applications my team has to maintain has almost always this pattern for dealing with data modification: ```c# try { // get the connection // begin transaction // optional execution of some changes // optional call stored procedure // optional execution of o...
(more)
about 2 years ago
Answer A: What are the disadvantages of using auto mapper libraries?
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 implicit assignments happening only at runtime due to automapping - property rename - if any of the proper...
(more)
about 2 years ago
Question What are the disadvantages of using auto mapper libraries?
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 removing the need for lots of assignments when dealing with models with lots of properties. However, ...
(more)
about 2 years ago
Question In the current development context (2020+), is there any reason to use database triggers?
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 wondering if they are useful anymore for modern software applications. By modern software application...
(more)
about 2 years ago
Question When stored procedures are preferred over application layer code?
[]()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 mostly rely on stored procedures and less on the ORM (e.g. Entity Framework). I have also heard this a...
(more)
about 2 years ago
Answer A: Should we allow UI/UX questions in our community?
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 - questions about choosing fonts for banners or graffiti, color to be used in some ads etc.
(more)
about 2 years ago
Question Should we allow UI/UX questions in our community?
[]()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 for this question, I have updated []()What type of questions can I ask here?.
(more)
about 2 years ago
Answer A: Appropriate HTTP status code for "user confirmation required"
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: 1. `GET /api/v1/action-can-charge-the-client/{id}`. This should respond with 200 and the required information so that the client knows that...
(more)
over 2 years ago
Answer A: How to mock LazyCache when performing unit testing?
LazyCache provides CachingService as a concrete implementation of the IAppCache. When unit testing simply instantiate the tested service using CachingService: ``` var testInstance = new FooService(new CachingService()); ```
(more)
over 2 years ago
Question How to mock LazyCache when performing unit testing?
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 specified in the comments). What is the way to perform unit testing in this scenario?
(more)
over 2 years ago
Answer A: How to create fire and forget tasks Q&A in ASP.NET Core with dependency injection support?
The way I made this work is not very quick but might provide extra benefit in the future. I have added Hangfire support to the application and use its BackgroundJob enqueuing mechanism as follows: Plugging Hangfire ``` using Hangfire; using Hangfire.MemoryStorage; public void ConfigureServ...
(more)
over 2 years ago
Question How to create fire and forget tasks Q&A in ASP.NET Core with dependency injection support?
One of the legacy applications our team manages contained the following pattern (in the controller): ``` // initialization private readonly IServiceScopeFactory serviceScopeFactory; public FooController(IServiceScopeFactory serviceScopeFactory) { serviceScopeFactory = serviceScopeFactor...
(more)
over 2 years ago
Answer A: How to deeply clone an array in Angular / TypeScript?
These can be achieved in several ways, but there might be some drawbacks: - through JSON serialization/deserialization: `const cloned = JSON.parse(JSON.stringify(array));` The advantage is that it works for any type of object, but there are some drawbacks such as converting some values like...
(more)
over 2 years ago
Question How to deeply clone an array in Angular / TypeScript?
I have an array that I need to clone in Angular / Typescript. That is, any change done on an element from the cloned array should not affect the content of the initial array. How can I achieve this?
(more)
over 2 years ago
Question Using nested paths vs. flat ones for API resources
This is based on a code review discussion that I had with a colleague about the way I have designed the resources paths for an ASP.NET Core controller that is currently consumed only internally (by a SPA). The paths were flattened (e.g. GET /api/productreview/{reviewId}) and my colleague argued th...
(more)
over 2 years ago
Question Can I set a memory limit for the .NET Core garbage collector to collect objects more aggressively?
I have an ASP.NET Core 5 web application that provides functionality that involves file upload + rather large processing (memory consumption mainly). After each processing (with success or not) the memory could be reclaimed. I have a stress test the endpoint with large files and checked the w3wp.e...
(more)
over 2 years ago
Answer A: Tracking what users are searching in a content management system
Server-side solution If you can customize the server-side search functionality, you could add some logging information there. The advantages in this case are: - store the data in a useful format and avoid parsing general-purpose logs - you can also store some metadata related to the found resu...
(more)
over 2 years ago
Question Promoting the advantages Codidact Software has over Stack Overflow or similar communities
Note: some of these points are relevant for all communities, but I would like to focus on Software Development for now I am thinking of promoting Software Codidact, but I could not find a single page to include a list of advantages it has over other similar platforms, mostly against the SO. Wha...
(more)
over 2 years ago
Question How to promote Software Development Codidact on LinkedIn?
I have recently blown off the dust off my LinkedIn profile and I have realized that I have hundreds of connections. An important fraction of all these connections are into software development and might be interested into using a platform like Codidact. The Codidact Foundation is also on LinkedIn ...
(more)
over 2 years ago
Question Question templates for guidance
I am wondering if it makes sense to define a template for questions. This would act as a guideline rather than a strict template to be followed. I have seen this being used for GitHub issues and I think it would help virtually all users to tick some points when asking most of the software developm...
(more)
over 2 years ago
Question Transferring files from a legacy project to an existing one as varbinary
Our team is currently transferring all functionality (+ some changes) from small and very old project A (almost code freeze) to project B (actively developed). As part of the data migration, there are about 10GB of files to be transferred. Currently, project B stores files as varbinary in the data...
(more)
over 2 years ago
Question Dealing with GETs with long query strings in ASP.NET Core
One of the recent business requirements is to be able to search through a list of entities using a bunch of filters. Most of these filters allow multiple values and the user might theoretically provide more than 100 selected filter values (some of the filters are even implemented as tree views due to...
(more)
over 2 years ago
Question Handling high frequency requests with cancellations in an ASP.NET Core application
Issue I have recently discussed with a friend a performance issue he and his colleagues have encountered in an ASP.NET Core 5 application (a checkout app, microservices architecture). The problematic flow is related to computing the prices of basket items. The computation may take more than it ...
(more)
over 2 years ago
Answer A: Questions easily answered by studying a beginner-level book
I would have a separation between what is on-topic / offtopic and what is worth upvoting or downvoting. Thus for the specific case of questions showing no research, but are on-topic, I would consider downvoting, not closing (more details in this suggestion which received mixed reactions). If I ...
(more)
over 2 years ago
Answer A: Why using images for code, errors, logs or similar should be avoided?
There are multiple reasons why using images of code, errors, logs and other text resources used in programming instead of the actual text is strongly discouraged. Shortly put, the question should be written in a form that helps both the fellow community members to answer it (e.g. easy to copy-pas...
(more)
over 2 years ago
Question Why using images for code, errors, logs or similar should be avoided?
I have noticed that virtually any question containing an image of some code or error got a comment asking to replace it with the actual code, error text. Why is it so bad to include an image instead of the actual text?
(more)
over 2 years ago
Answer A: What solutions available for a CMS-agnostic contact form?
Besides the aforementioned solutions, Web components might be useful (can be reused in multiple contexts). Examples: - in Drupal - in ButterCMS - in Backdrop CMS - in WordPress However, if your form is not convoluted, I would also consider using the default form module provided by your CMS,...
(more)
over 2 years ago
Question Specify framework / library version in the answer
As Stack Exchange (Stack Overflow mostly) is struggling to deal with outdated answers, they came with a proposal that we can learn from: Version labels for answers As already most of the feedback indicates, the proposed solution seems convoluted and thus hard to implement. Software Codidact...
(more)
over 2 years ago
Question What are the disadvantages of using SQL Server Replication - Transactional Replication type?
The context A reports related process is directly reading the production operational database once about two hours. This involves reading all the data from some 70 tables which takes a couple minutes to complete. My manager suggested that this is not OK and I concur also from a technical persp...
(more)
over 2 years ago
Question Is there any justification for having a single tempdb database to be used by all databases on a SQL Server intstances?
Despite the fact that I have programmed against SQL Server for quite a while I did not pay much attention to the `tempdb` database. This is especially true if application logic is mostly written using the ORM instead of stored procedure. However, I have just realized that the SQL Server architectu...
(more)
over 2 years ago
Question Are there any downsides related to using Maybe or Optional monads instead of nulls?
I have recently stumbled across the Maybe (or Optional) modal usage in .NET Code: - example code or this one - example article Based on everything I read, there are multiple advantages on relying Maybe instead of nulls: - no `NullReferenceException`s - leverage (some of) the functional p...
(more)
over 2 years ago
Answer A: Why did my question get a downvote?
For me the following reasons might lead to downvoting: - Posts that are not related to a specific programming issue, but are rather meant to start a discussion. Example - Asking for software products differences, unless it is directly connected to software development and asks about one or very...
(more)
over 2 years ago
Question Why did my question get a downvote?
Currently, there is no consensus about whether to provide tooltips for the voting buttons (especially the downvote one). However, the community now includes quite a lot of questions that attracted downvotes and sometimes this created long debates in comments and flagging. I would like for us to de...
(more)
over 2 years ago
Question Should we allow questions about installation and configuration of software development tools?
A recent flag for this question suggested that it would be a better fit for the Linux community. There is no motivation provided, but I guess it is related to the fact that most of the question and the answer deal with installing various packages using Ubuntu's package manager. However, the quest...
(more)
over 2 years ago
Answer A: Get the length of a slice from a multi-dimensional array
I think what you are looking for is Array.GetLength which: > gets a 32-bit integer that represents the number of elements in the specified dimension of the Array.
(more)
over 2 years ago