Reputation
1,154
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
8 12
Newest
 Pundit
Impact
~21k people reached

  • 0 posts edited
  • 5 helpful flags
  • 1,339 votes cast
Jul
22
revised Is cyclomatic complexity density a good software quality metric?
added 42 characters in body
Jul
22
comment Is cyclomatic complexity density a good software quality metric?
Reworded my answer, made the 'no' explicit, and added a reference.
Jul
22
revised Is cyclomatic complexity density a good software quality metric?
added 645 characters in body
Jul
22
revised Is cyclomatic complexity density a good software quality metric?
added 645 characters in body
Jul
22
comment Cyclomatic complexity for 2 IFs - why not just FF or TT?
"Consider a bug that requires that f1() be called before f3()." TF will not expose that bug as f3() is never called. Only FT will expose this bug.
Jul
22
comment Is cyclomatic complexity density a good software quality metric?
@GlenH7 Yes, the suggested metrics are weak - that's exactly the point of my answer! If you know any better ones, let us know in an answer.
Jul
22
comment Is cyclomatic complexity density a good software quality metric?
@gnat The answer is stronger than the question: The question asks whether a particular metric is a good one; The answer states that no metrics are good (which includes the mentioned one).
Jul
21
answered Is cyclomatic complexity density a good software quality metric?
Apr
3
awarded  Pundit
Mar
19
comment Optional Member Data
The advantages of this hasFavoriteColor() is that it allows the getFavoriteColor() to return a reference instead of a pointer - by adding a precondition that the caller is responsible to check hasFavoriteColor() before calling getFavoriteColor() - while backing storage isn't duplicated. (of course, a decent implementation of getFavoriteColor() will include an assert to check this precondition).
Mar
19
comment Optional Member Data
There is a difference between 'empty' and 'not present'. Second, if it's a more complicated class, there might be no 'empty' representation.
Mar
19
comment Optional Member Data
Small point: "You may setFavoriteColor( "Blue" ) then be surprised when your XML output doesn't show Blue because you forgot to setHasFavoriteColor( true )." Solution: add a mHasFavoriteColor = true; in the setFavoriteColor() function. The advantage of setters over direct member access is that functions can maintain class invariants.
Feb
20
comment Typedefs to convey relations between classes
While I agree with your approach and the answers, I would suggest to use just Index. In practice - as demonstrated by your code - you'll have to prefix it with the class name anyway: ModelNode::Index, AABB::Index ...
Jan
30
comment Tips for understanding big project fast?
Visual Studio has a "show definition" functionality. Try right-clicking on the name and look at the pop-up menu. I've witnessed problems with it, but it usually is better than using ctrl-F.
Jan
25
answered What is the point of making a syntactic distinction between standard and user-defined types?
Jan
20
awarded  Nice Answer
Jan
15
awarded  Nice Answer
Jan
11
comment How to structure a loop that repeats until success and handles failures
This is the logical next step after the rewrites in my answer.
Jan
11
comment How to structure a loop that repeats until success and handles failures
@DocBrown The duplication of the cout is mostly an artifact of the example. In practice, the two cout statements will be different as the second will contain an error message. E.g. "Please enter <foo>:" and "Error! Please re-enter <foo>:".
Jan
10
awarded  Yearling