2,593 reputation
21529
bio website
location
age
visits member for 4 years
seen 2 days ago

Jul
15
comment Is it a good idea to “#define me (*this)”?
@LokiAstari: Nothing in the question even remotely hints at the OP wondering whether this-> "is necessary". In fact, the OP says he is using this-> in spite of the fact that it's not necessary. The question is about whether me. should be used instead of this->, which this answer doesn't actually answer.
Jul
14
comment Is it a good idea to “#define me (*this)”?
@JanHudec: Lowercase is for system-specific extensions? Could you post a reference to the part of the C++ standard that indicates this?
Jul
14
comment Is it a good idea to “#define me (*this)”?
"In C++, you almost never have to write this" that's a totally unrelated convention to the question. Some people (like me) prefer to write this to explicitly make it clear that the variable is not local to the method. The question here is about whether the macro me should exist, not whether this is something that should be used.
Jul
10
comment Why is software OS specific?
@MSalters: Not quite -- if you (and Marcin) read my very first comment, you will see I was already aware of that and mentioned it before either of you did. However, that's not what Marcin is saying, even though maybe that's what he thinks he's saying. He's making a stronger claim: that there exists a "POSIX binary format" that Windows can execute, for which I'm asking him to provide a reference, because (correct me if I'm wrong) I'm fairly sure that even the "POSIX" executables in Windows in fact use the PE file format, not some "POSIX binary format" (if such a thing even exists).
Jul
9
comment Why is software OS specific?
@Marcin: What kind of a reference is that supposed to be?! The word POSIX doesn't even appear on there, let alone a mention of executable file formats. As for yours, here you go; your turn.
Jul
9
comment Why is software OS specific?
@Marcin: (1) Like I said, the X in POSIX stands for UNIX. It is not a standard that was meant to be followed by other OSes, it was just an attempt to reach a common denominator between the various Unixes, which is great but not that amazing. The fact that there are multiple flavors of Unix OSes out there is completely irrelevant to the point I've been trying to make regarding compatibility across other operating systems than Unix. (2) Can you provide a reference for #2?
Jul
9
comment Why is software OS specific?
@Marcin: Seems like you don't consider Windows to be an OS. (Or are you saying Windows can run POSIX binaries?!) For the purposes of my answer POSIX isn't the kind of standard I'm referring to. The X in POSIX stands for Unix. It was never intended to be used by e.g. Windows, even though Windows does happen to have a POSIX subsystem.
Jul
9
comment Why do operating systems do low level stuff in C and C++? Why not just C++?
@TMN: What the heck is "the RT kernel"? The kernel is the same old thing it always was, the NT kernel.
Jul
9
answered Why is software OS specific?
Jun
20
comment Why was C# made with “new” and “virtual+override” keywords unlike Java?
You should learn C++!
Jun
11
comment Is my work on a developer test being taken advantage of?
Just make sure you don't get yourself into a situation where they could sue you for unauthorized access or modifications to their code.
May
24
comment Should I follow the normal path or fail early?
@mirabilos: Er, I never said it's good advice, nor that it's always correct. Like many other things, it's a reasonable first-order approximation, and I said I'm wondering if that's what the attempt was.
May
24
comment Should I follow the normal path or fail early?
@mirabilos: not sure what you're trying to say. I am aware how branch prediction works, and there is nothing that restricts it to assembly. When you have an if statement there is necessarily going to be a jump there, and not-taken implies executing the body of the 'if', so hopefully it's the common code.
May
22
comment Where did the notion of “one return only” come from?
@sbi: Or you could just learn to do it right from the beginning so that you can structure your code readably without sacrificing the optimization or hindering debugging. I don't think I've ever seen the single-return convention harm code in some way, but I've definitely seen multiple returns rear their ugly heads when I'm trying to set a breakpoint to find what values a function is returning and inevitably end up missing one of the 4 returns in the function.
May
22
comment Where did the notion of “one return only” come from?
You still want to do this with C++, because returning a single object lets the compiler avoid copies and moves entirely.
May
22
comment Should I follow the normal path or fail early?
Is it just me who thinks this has nothing to do with readability, but instead was probably just a misguided attempt at optimizing for static branch prediction?
May
3
comment If null is bad, why do modern languages implement it?
@MartinJames: The fewer invalid states your program has, the fewer ways it can be incorrect. Simple as that.
Apr
10
awarded  Notable Question
Mar
11
awarded  Notable Question
Feb
16
comment Does C# give you “less rope to hang yourself” than C++?
@supercat: Yeah, but the whole point here is that you can't rely on it behaving in any particular way for a generic implementation. This is in contrast to unspecified/implementation-defined behavior, where you can assume the behavior will be one of (potentially many) well-defined possibilities. That's a pretty subtle but also pretty critical difference.