3,419 reputation
926
bio website
location
age
visits member for 3 years, 5 months
seen Nov 16 at 12:29

Oct
30
asked “Do it right, against customer's wishes” - how is it called?
Sep
14
awarded  Nice Answer
Aug
10
comment In what order are rows fetched absent ORDER BY clause?
You can realistically expect the first query by unindexed column to follow "insert time" order; by indexed "update time". Consecutive requests may likely be "tainted" by cached results and so quite randomized; nevertheless never depend on it - it may change from version to version, by parameters, by update operations and by bad weather on the full moon. "Undefined" is the correct answer, and anything else is at best informed guesses.
Jul
29
comment Does modular programming affect computation time?
Premature optimization is the root of all evil. Linear code is slightly faster than modular code. Modular code is vastly faster than spaghetti code. If you aim at linear code without a very (VERY) thorough project of the whole thing, you'll end up with spaghetti code, I guarantee that.
Jul
15
awarded  Informed
Jul
5
awarded  Yearling
May
16
awarded  Popular Question
May
6
awarded  Popular Question
Apr
17
awarded  Nice Answer
Apr
16
awarded  Good Question
Apr
12
comment Why do bitwise operators have lower priority than comparisons?
@Dunk: I don't know about you but I remember multiplication/division/AND has priority over addition/substraction/OR, and remembering "arithmetic above logic" is exactly one bit of information. Besides, there's a chart of operator precedence hanging on the wall by me, just in case - and the only simplification the "mess" example needs to be clear is removal of the redundant parentheses. And as for "concerned with solving problem at hand" - neglecting code clarity at that phase tends to bite you in the back while maintaining the code.
Apr
12
comment Why do bitwise operators have lower priority than comparisons?
Oh. So the meaning of & changes depending on where you place it. For a=1; b=2; if(a & b){...}` will execute the block, while c = a & b; if(c){...} will consider the condition not satisfied. Big thanks to mr. Richie for fixing that.
Apr
12
comment Why do bitwise operators have lower priority than comparisons?
@Dunk: The common "by hunch" approach is [arithmetics] [logic operator] [arithmetics]. Most programmers don't create a mess of parentheses like if(((x+getLowX()) < getMinX) || ((x-getHighX())>getMaxX()))) - most will assume precedence of arithmetics over logics and write if( ( x + getLowX() < getMinX ) || ( x - getHighX() > getMaxX() )) assuming precedence of + above <. Now intuitively if( x ^ getMask() != PATTERN ) should behave the same, XOR being arithmetic operator. The fact it's interpreted as if( x ^ ( getMask() != PATTERN ) ) is completely counter-intuitive.
Apr
11
comment How meaningful is the Big-O time complexity of an algorithm?
It is important to realize that constants can be quite important. O(n) where single iteration takes a second may be worse than O(n log n) where you get a million iterations per second.
Apr
11
answered Is it allowed to make multiple instances of a singleton class?
Apr
11
awarded  Nice Question
Apr
11
accepted Why do bitwise operators have lower priority than comparisons?
Apr
11
revised Why do bitwise operators have lower priority than comparisons?
the counterexample wasn't boolean.
Apr
11
comment Why do bitwise operators have lower priority than comparisons?
Wouldn't that fail if c=2 Or did a==b result in ~0 and not 1?
Apr
11
comment Why do bitwise operators have lower priority than comparisons?
@Gnat: I guess, following dan1111's comment, my answer is no longer required?