New answers tagged

2 votes

Matrix Class Implementation

I’m not going to do a full review, because the reviews you already have are excellent. I’ll just a few extra notes since you mentioned you are interested in next-gen, C++23-and-beyond best practices. ...
indi's user avatar
  • 10.3k
2 votes

Matrix Class Implementation

Overview If your Matrix sizes are always known at compile time then you could potentially have written them to do compile time checking of dimensions. Of course if you use any dynamic input this ...
Martin York's user avatar
  • 94.3k
7 votes

Matrix Class Implementation

Use std::mdspan Since you tagged the post c++23, consider using std::mdspan in your code. Not only can you use that internally ...
G. Sliepen's user avatar
  • 50.6k
8 votes

Matrix Class Implementation

Missing all includes and the C++ version, so I had to make some guesses to get this to compile. assert(rows >= 0); assert(cols >= 0); OK, but ...
harold's user avatar
  • 9,139
3 votes

Declaring type definition once for all variables

I know that @radarbob says that your "class" in neither good style or acceptable, but I disagree. NOTE: this is NOT a critique of radarbob's answer. Rather, I am offering alternative ...
Rick Davin's user avatar
  • 6,257
1 vote
Accepted

Declaring type definition once for all variables

Ah, after much back and forth I think I understand.... I haven't seen this kind of usage anywhere, is this style any good and acceptable? No. No it's not. Be consistent with Type usage. If these ...
radarbob's user avatar
  • 7,329
1 vote

Declaring type definition once for all variables

I haven't seen this kind of usage anywhere, is this style any good and acceptable? enum Approach If you mean the if else if structure... a ...
radarbob's user avatar
  • 7,329
2 votes

Domain Driven Desing aggregate for ticket booking

The main issue I see is that you have implemented business logic in the entity but the bookTickets and cancelTicket themselves ...
TorbenPutkonen's user avatar
1 vote

Domain Driven Desing aggregate for ticket booking

I will assume a given event hall can hold "many" people. appropriate datastructure ...
J_H's user avatar
  • 17.1k
3 votes
Accepted

Data structure to hold elements for script execution

say what you mean and mean what you say. Alice, when she's through the looking glass, is admonished by the March Hare: you should say what you mean and things go downhill from there. ...
J_H's user avatar
  • 17.1k
1 vote

Builiding a Model from Stored Procedures

You are committing the same "code smell" sin with public abstract class ReportBase. All properties and no functionality. The ...
radarbob's user avatar
  • 7,329
2 votes

Builiding a Model from Stored Procedures

We commonly do it with "Meta-Information" hardcoded in the form of attributes. This allows to derive all "Datamodels" from a baseclass, which then implements the databse interface ...
ElectronicsStudent's user avatar

Top 50 recent answers are included