close
Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!

Question list filters

Filter by
Sorted by
Tagged with
Filter by Employee ID
Best practices
2 votes
8 replies
141 views

I have a WooCommerce discount system that calculates fees based on product categories (box sizes) for a specific user role. The code is functional, but I am concerned about the execution cost of ...
Best practices
1 vote
5 replies
159 views

I'm building a REST API using FastAPI and Pydantic. This is an example for my problem: class RestaurantCreate(BaseModel): name: str email: EmailStr max_tables: int @field_validator(&...
Score of 2
3 answers
120 views

I have a restaurant ordering app where I'm displaying order items. Currently, I have repetitive code for each menu item (pizza, hamburger, beer). Current code (simplified): function displayOrder(...
Score of 3
1 answer
116 views

Is there any cleaner/DRYer way to get nested ordered list items (e.g. list item number 2.4.1.7.8.2.9) that are indented properly, rather than defining every single level manually up to 10 levels deep? ...
Score of 2
1 answer
224 views

I'm writing unit tests to test C++ classes. The functions below test to see how a function handles an exception. The code below does work, but it is very redundant, I would prefer to have 1 template ...
Score of 0
3 answers
388 views

In C++, if you make a separate .cpp file to keep classes separate like you might in Java, you also have to make a .h file declaring everything you want to make. I understand why you must, since the ...
Score of -1
1 answer
87 views

This is a follow up of this question, which might have been a XY problem. Anyhow, that was closed within a few minutes, before I could get any real help. In our large code base (measurement processing ...
Score of 1
2 answers
261 views

In our large code base (measurement processing application) we've had bugs where values were mixed up because everything is a double. So we decided to try-out strongly named types for things like ...
Score of 1
1 answer
158 views

I'm writing a library which has a queue object (not std::queue and not usable as a C++ container). On this queue, we can enqueue commands, with arguments. Let's say the commands are foo, bar and baz, ...
Score of 0
1 answer
59 views

I am creating a binary tree representation of a mathematical expression for performing differentaiton and integration on it. I am trying to overload the + operator for my Symbol class. It works fine ...
Score of 0
1 answer
74 views

What is a Pythonic way to not have duplicated code for exception handling? In a real code base, it is not 2 / 0, but reading or writing from an async socket, and I have more exceptions to catch, ...
Score of 0
1 answer
63 views

I'm looking for a standard, lightweight (preferably built-in) way to handle the problem of interface repetition—where the same parameters (with annotations, defaults, and docs) are repeated across ...
Score of 0
1 answer
107 views

I have created a Blazor Component to handle editing a database record which is defined by a class. I would like this component to be reused to edit other records - that have the same structure, but ...
Score of 1
0 answers
107 views

Context Coming from OOP I'm finding as I implement various traits and functions on my structs, I want to abstract bits and pieces of them out. But whenever I do, I run into borrow checker issues. I'm ...
Score of 0
1 answer
86 views

Trying to do so involves using the weird syntax of GetAwaiter().GetResult(). Beside that fact, it works; but does it sucks to do so? If yes, then why? Original: internal static ISector Read(ISector ...

15 30 50 per page
1
2 3 4 5
149