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.
Search
One solution would be to catch a more generic base class, like std::exception. If all your exceptions derive from that, you should be safe. Another solution I like better is using destructors to d...
There is no universal accessibility standard for how tall your buttons should be. Consider that when you're using a simple link, users have to click on the text itself to follow the link; as long a...
I was told by my professor/book that computer programs use two kinds of memory and that all variables get allocated either on the stack or on the heap. Is this true? How can I tell where a variable...
This is a small bug (cosmetic) that I have noticed while adding some code in a post: I have artificially added some whitespace here and there, otherwise the line would have been way longer.
Note: This is not an official Codidact staff answer; this is my personal opinion. Let's try to build up a bit of an original base before we work on imports. Based on other sites where content was ...
A cancellation token doesn't inherently do anything. It's up to the code which does the work to call ThrowIfCancellationRequested. If the token isn't passed on and isn't explicitly checked then the...
I've come to realize that tags began changing pretty rapidly recently. In the past 3 days alone, these happened: [urlrewrite] was changed to a more generic [url-rewriting] tag and the tag wiki for...
questions about the system, network, or server administration Which system? I think it is clearer without "the": questions about system, network, or server administration
Luckily, we are in a position where we don't have to re-invent the wheel. We can see what went either wrong or horribly wrong at SO, then avoid making the same mistakes. Some common problems: Maki...
On that other site that shall not be named, reference request questions are outlawed as "asking for an off-site resource". What do you guys think about such questions? Should they be welcome here?...
1 - Rearrange the code: Open stdin, read all parameters, close stdin, then process the parameters. 2 - Consider adding some validation to the parameters. 3 - Add an explanation of the magic number ...
Let's say I have a table with 10,000 rows and instead of selecting all of the rows at once I select 1,000 at a time like LIMIT 0,1000 LIMIT 1000,1000 etc. Without an ORDER BY statement the or...
This is a class from my personal code library, and from a package which deals with integer sequences. It implements an interface package org.cheddarmonk.math.sequence; public interface IntegerSequ...
If one is using SASS to build a websites CSS and using version control one can either, Keep both the SASS and the resulting CSS files in version control. Only storing the SASS files in version con...
I have tables A and B and then I have a many to many join table with foreign keys to both called a_b. Neither foreign key can be null and the combinations for the foreign keys to A and B are unique...
Already good answers, but I can provide a slightly different perspective here: always use braces if there is a risk of getting into a pitfall. Examples (from C#, but the language is less relevant)...
I created subscription to new questions that should emailed every 7 days but I receieved every day. here is my setting: here is my mail inbox: and unfortunately, I got emails with same quest...
tl;dr If you don't have a reason otherwise, you should use get. More precisely, if you will be done with the future, you should use get. You should use wait only if there is some separation between...
I'm trying to understand the purpose of the wait() function in Class future<> for C++. At the moment I don't see any purpose for calling wait() instead of get(). What I have tried in code: i...
Reasons to use the construct #define FOO(x) do{...} while(0);: As mentioned above, doing so solves the problem of if (...) FOO(y); You can declare variables inside the block, and they ...
<Window x:Class="Login_App.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns...
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...
What (if anything) does the C standard have to say about linking objects? My guess is that, because C only defines language->behavior rules, it completely ignores any potential intermediate form...
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 thi...
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...