8,138 reputation
11637
bio website
location
age
visits member for 3 years, 6 months
seen 16 mins ago

1d
awarded  Explainer
2d
comment Separating Code into Smaller Files in C
@Remixed123: This doesn't consume any more memory than having it all in one file. The global symbol exists in exactly one place, the .c file. Everyplace else refers to it with extern and the linker will resolve it to that address.
2d
comment Separating Code into Smaller Files in C
@Remixed123: Where do you see space for variables being allocated other than the single instance in the .c file?
2d
comment Separating Code into Smaller Files in C
@Remixed123: One other advantage you get out of this is the ability to unit test each piece outside the big blob you have now.
2d
answered Separating Code into Smaller Files in C
Sep
23
comment Is it okay to use exceptions as tools to “catch” errors early?
I've never actually met an application codebase for which I'd want (most) checks removed at runtime. Then you haven't done code that's performance-critical. I'm working on something right now that does 37M ops per second with assertions compiled in on and 42M without them. The assertions aren't there validate outside input, they're there to make sure the code is correct. My customers are more than happy to take the 13% increase once I'm satisfied that my stuff isn't broken.
Sep
17
answered How is Nginx handling its requests in terms of tasks or threading?
Sep
13
comment Standardization and official guidelines for C++ template parameter naming
Using xxx_t intrudes on POSIX, which reserves all types ending in _t for its own use. So if you live in a POSIX world, don't do that.
Sep
10
comment Is it ever OK for a conditional to have side effects?
That line should be nuked from orbit. Twice for good measure.
Sep
9
awarded  Necromancer
Sep
7
comment What's the list of how to precisely talk about problems in C++ code within the spec?
Ad hominem attacks on people offering suggestions on how to improve your question do nothing to make your case. Best of luck getting your question answered.
Sep
7
comment What's the list of how to precisely talk about problems in C++ code within the spec?
Not in the question and not mentioned until someone called you out on it.
Sep
7
comment What's the list of how to precisely talk about problems in C++ code within the spec?
Levity in questions works better if you leave some hint that you're kidding. You wouldn't be the first person to suggest that he's on his way to solving the halting problem and be serious about it.
Sep
6
revised What does this function do?
Cleaned up code
Sep
5
comment Why aren't we building and using parallel processors *meant* for general computation?
Processors designed for parallel programs have been around for more than 40 years. The IBM 2938 (introduced in 1968) and 3838 (1974) are two examples.
Sep
2
comment What if any languages treat undisposed resources as an error?
How would the runtime know you're not done with the resource unless it knows that all references to it have gone out of scope?
Aug
31
comment Is there a clever way to calculate a mode of an online series without storing the series?
Hash maps also work better if the set of values is sparse.
Aug
28
comment Why don't compilers inline everything?
@OtávioDécio: Oops. Meant to direct that at Prog for the comment below yours.
Aug
28
comment Why don't compilers inline everything?
@OtávioDécio: Recursion can't be inlined (or unrolled as it were) because you don't know how many times you'll recurse. (E.g., a factorial function doesn't know ahead of time whether it's calculating 3! or 6!, so the compiler wouldn't know how many bits of code to inline.)
Aug
21
comment Checking negative of a condition
Sometimes this is done because people prefer to put the more-usual case up top and the less-usual case in the else. There's not really a penalty for this; any compiler with a decent optimizer will sort it out.