2,365 reputation
11428
bio website
location
age
visits member for 3 years, 6 months
seen 13 hours ago

1d
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).
1d
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.
1d
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?
2d
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.
2d
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.
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.
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.
Jul
5
comment Demonstration of garbage collection being faster than manual memory management
I copied Raymond's code here, and to compare, I wrote my own version here. The ZIP file that contains the text file is here. On my computer, mine runs in 14 ms and Raymond's runs in 21 ms. Unless I did something wrong (which is possible), his 215-line code is 50% slower than my 48-line implementation, even without using memory-mapped files or custom memory pools (which he did use). Mine is half as long as the C# version. Did I do it wrong, or do you observe the same thing?
Jul
4
comment Demonstration of garbage collection being faster than manual memory management
Oops sorry my bad. @btilly should read my comment then.
Jul
4
comment Demonstration of garbage collection being faster than manual memory management
@GuySirton: Then again, they don't even seem to be benchmarking GCs in the first place -- they seem to just be comparing C++ to Java, with preallocated storage...
Jul
4
comment Demonstration of garbage collection being faster than manual memory management
@GuySirton: I can't reproduce the keithlea.com/javabench results. I just tried out the heapsort implementation, and even when comparing the output of my old C++ compiler (Visual C++ 13.10.4035) with the one from JRE 7, C++ beats Java quite noticeably. If you can reproduce any of them let me know which one and I'll try that one.
Jul
4
comment Demonstration of garbage collection being faster than manual memory management
@delnan: Oh, I see what you mean now, that's a great point, thanks for bringing it up!
Jul
4
comment Demonstration of garbage collection being faster than manual memory management
@ddyer: Hmm, what exactly is so difficult to compare here? For example, let's say you're doing some computation (e.g. an FFT) on a lot of data (say, 100 million data points). A very easy and objective way to compare them would be to compare the number of data points processed per second, over the entire life of the program, and show that a GC is faster (or slower). That's a 100% objective and hard measure of performance, and the fact that there was a lot of data shows you're not measuring artifacts over small datasets. How is that hand-wavy? It seems perfectly comparable to me.