8,892 reputation
22355
bio website LokiAstari.com
location Seattle, WA
age
visits member for 4 years, 4 months
seen May 20 at 23:13

Apr
15
comment Designing exception classes
I tend to agree in principle with your reviewer (mixing error codes and exceptions is not really that useful). But unless you have a huge library having a big hierarchy is also not useful. A base exception that contains a message string, only have separate exceptions if the catcher of the exception can potentially use the uniqueness of the exception to fix the problem.
Feb
27
comment Why are structs and classes separate concepts in C#?
If you move your last paragraph to the top and delete the current first paragraph I think you have the perfect argument. But the current first paragraph is just subjective.
Feb
1
comment Should Latin-1 be used over UTF-8 when it comes to database configuration?
@CortAmmon: Not just emotional. But these things are already in production. So there is non zero financial cost as old systems need to be converted. Not just on the the DB but all the old code that touches the DB.
Jan
11
awarded  Yearling
Oct
22
awarded  Nice Answer
Oct
14
revised How to setup the c++ rule of three in a virtual base class
added 21 characters in body
Sep
30
awarded  Explainer
Aug
4
awarded  Nice Answer
Jul
15
comment Is it a good idea to “#define me (*this)”?
@Mehrdad: But only putting yes or no makes a very boring answer. Thus explanations are usually quite useful in explaining how the answer is reached (is encoraged by How to answer ). The conclusion is not to use because the OP has the wrong attitude to start with about using this and thus a discussion on that point is required to achieve a fully balanced conclusion.
Jul
14
comment Is it a good idea to “#define me (*this)”?
@Mehrdad: Because the OP explicitly says he is using me. instead of this->. Since there is no need for this-> there is no need for me. and thus no need for the macro.
Jun
17
awarded  Announcer
Jun
10
comment Is there a Design Pattern for preventing dangling references?
@iFreilicht: If you want to be able to destroy the object and detect destruction just before usage then use std::weak_ptr. This is just the other side of std::shared_ptr.
Jun
10
comment Use a template to get alternate behaviour?
Why not just two functions: sId() and sIdTrue()
Apr
7
comment Ensure that each class has only one responsibility, why?
Can't all the reasons for single responsibility be correct? It does make maintenance easier. It does make testing easier. It does make the class more robust (in general).
Mar
15
comment A module which is used by most other modules
Singeltons should not be used in isolation. You need to combine the singelton with a creation pattern (pick any Factory is common) so that you are not tied to the same code for production/testing or other situations.
Mar
6
awarded  Nice Answer
Jan
19
reviewed Reject Is the C programming language still used?
Jan
11
awarded  Yearling
Jan
8
comment How should I mark types in C and C++ programs?
Also my favorite technique. Types have an initial uppercase letter. All other identifers are not types and thus easily seen.
Jan
8
comment How should I mark types in C and C++ programs?
See this question for reserved identifiers (including _t) stackoverflow.com/a/228797/14065