Reputation
110,933
Next tag badge:
99/100 score
21/20 answers
Badges
30 250 423
Impact
~2.8m people reached

Feb
2
answered Is a 1 < 10 comparison less expensive than 1 < 1000000?
Feb
2
revised How is atomicity of reference operations enforced?
deleted 11 characters in body
Feb
2
revised Is Learning C++ Through The Qt Framework Really Learning C++
added 8 characters in body
Feb
1
revised Iterating a function with a static argument: Global functions + lambdas vs internal function?
deleted 78 characters in body
Feb
1
revised Iterating a function with a static argument: Global functions + lambdas vs internal function?
added 78 characters in body
Feb
1
comment Iterating a function with a static argument: Global functions + lambdas vs internal function?
When would a lambda expression be appropriate, then? When you want to use the function in more than one place?
Feb
1
answered Iterating a function with a static argument: Global functions + lambdas vs internal function?
Feb
1
revised Check a boolean before setting it in a loop, or just set it
edited tags
Feb
1
comment Is there any material difference between queries joined by WHERE clauses, and queries using an actual JOIN?
@MatthewBriggs: That point has already been discussed and debated ad nauseum.
Feb
1
comment Check a boolean before setting it in a loop, or just set it
That sort of check should perform consistently the same no matter where you put it. Profile it, and see what it does. Personally, I wouldn't bother with the check; there are almost certainly other parts of your code that are orders of magnitude slower than this, so it isn't going to matter anyway. If you really want a "best practice," nobody ever checks a boolean variable to see if it's true before setting it to false.
Feb
1
answered Check a boolean before setting it in a loop, or just set it
Feb
1
comment Check a boolean before setting it in a loop, or just set it
You should profile it. If I were to guess, checking the boolean first before setting it probably slows the code down in the general case, though I doubt there's enough of a performance difference to matter. But measure, don't guess. There's no best practice here; not everything has to be a "best practice," whatever that is. Do what makes sense for your particular application.
Jan
31
comment Is Operator Overloading supported in C
You're allowed to have extensions as long as they don't conflict with the standard -- True, but once you use the extensions, you're no longer C standard, unless the extensions are library-based (not compiler-based) and you can freely include the extension library in your own programs.
Jan
31
comment What is a better design a light weight user or a heavy weight heavy user model?
@matthew: I only included those factors in my answer that I believe are relevant to the decision. The context is "very expensive and entirely optional." There really aren't any other significant considerations, unless you know something about object-oriented design that I'm not privvy to.
Jan
31
answered What is a better design a light weight user or a heavy weight heavy user model?
Jan
30
comment MVC: How dumb should the view be?
@gnat: But timing issues like that are not business logic, any more than routine form validation is.
Jan
30
answered Is it ok for a for a View to dismiss itself?
Jan
30
revised Is it ok for a for a View to dismiss itself?
deleted 82 characters in body
Jan
30
comment MVC: How dumb should the view be?
@Jimbo: You're almost certainly overthinking this. The question you should be asking yourself is "why would the controller ever be responsible for a button in the browser?" To put it another way, you need Javascript to enable and disable buttons.
Jan
30
answered MVC: How dumb should the view be?