678 reputation
715
bio website
location United States
age 26
visits member for 3 years, 10 months
seen 17 hours ago

Dec
25
comment Why lambda/closures expressions came so late to C++?
@Doval, the whole point of a closure is to lift the bindings of variables into nested functions. Hence I view them as a scope feature. The rest is an orthogonal feature of the memory model.
Dec
24
comment Why lambda/closures expressions came so late to C++?
Perhaps I'm just being daft today, but I don't know how you can write a general purpose library function (using C++ code... as opposed to a compiler primitive) to initialize the memory properly and call the constructor without placement new. And that's even ignoring (single & multiple) inheritance initialization concerns. I'd love to see the code for it if it really is possible to do 100% correctly.
Dec
24
comment Safety-critical software and optimising compilers
An interesting, yet moot answer. Simply don't rely on UB. End of story. Still scared of UB? Simply don't use a language with UB. End of story.
Dec
24
comment Why lambda/closures expressions came so late to C++?
I disagree with is an abstract over the *lifetime* of variables (emphasis mine). I would say that a closure is an abstract over the scope of variables. Not really a fan of this answer.
Dec
24
comment Why lambda/closures expressions came so late to C++?
I fail to see how new and delete are redundant. Are you saying that because of smart pointers (which need some means of dynamic memory allocation)? Are saying that because of things like malloc and free? I suppose you can mimic ordinary new with malloc and placement new (oops... still using new). Otherwise, good answer.
Dec
22
comment What Are Some Advantages/Disadvantages of Using C over Assembly?
It would be very hard to do proper tail call optimization in C (I can't think of how to do it without using a trampoline... which is very heavy compared to a raw ASM TCO implementation).
Dec
20
comment Is it good practice to inherit from generic types?
That's an absolutely ridiculous Microsoft recommendation.
Dec
19
awarded  Popular Question
Dec
16
comment Is there a subset of programs that avoid the halting problem
@Job: forward jumping is not enough esolangs.org/wiki/SMITH
Dec
10
comment Is there ever a reason to use an array when lists are available?
Allowing Add and Remove could also be seen as a bug if the data NEEDS to be a fixed size. Another loss for List<T>.
Dec
10
comment Why not use the word bug instead of exception?
Presenting an IOException and an error code is not always a bug. It's a diagnostic. I often do that for personal scripts, where failure means I just put in incorrect arguments.
Dec
10
comment How to run C++ code in browser using asm.js?
@MSalters: It's also valid C++ code. Imagine that! Wow!
Dec
1
comment Should I use automatic properties?
This should be the accepted answer. The accepted one vaguely touches the OP's actual question.
Dec
1
comment Should I use automatic properties?
I fail to understand how changing A to a getter/setter pair would ever break the interface. Client code will be the same.
Nov
12
comment Why aren't HTML, CSS, and JavaScript used for desktop apps?
I find it impossible to believe JavaScript is as fast as Java (from prime compilers/interpreters and well written code). A dynamically typed language is inherently crippled in that sense.
Nov
8
comment Why isn't there a python compiler to native machine code?
Comparing the speed of interpreted python to compiled python is interesting in itself. Stop saying "use C++". Perhaps you already have the code written in Python. Perhaps the code is easier to write in python. Who cares. What I do care about is a 1.5x speed up (whatever it is). That can make a huge difference.
Nov
4
comment Does any other language use the uniform initialization syntax found in c++?
@delnan: Uniformity has its place for writing very generic code; the "most vexing parse" can cause issues; backward syntax compatibility.
Oct
30
comment Spurious wakeups explanation sounds like a bug that just isn't worth fixing, is that right?
Ugh... Postel's law... the reason why HTML and all sorts of web technologies have so much crap thrown into them (e.g. HTML acceptance of bad tag nesting). That aside, good answer.
Oct
26
comment Why doesn't array declaration guarantee proper memory allocation whereas malloc does?
The whole premise of your question is false (unless there's a serious bug in your code).
Oct
24
comment “It was working yesterday, I swear!” What can you do?
You forgot your Jewish scapegoat!