3,727 reputation
21932
bio website
location
age
visits member for 4 years, 5 months
seen 5 hours ago

Feb
23
comment Should I open up to .net, c# and visual basic?
@Chad: VB.NET != VB.
Jan
26
answered Is it possible to learn maths via programming, or you should learn maths for programming?
Jan
16
comment Word for red flags / warning signs?
Hm... memegenerator.net/instance/13262772
Jan
1
answered Does it hurt to learn bits of many programming languages?
Dec
28
awarded  Yearling
Dec
10
answered If your algorithm is correct, does it matter how long it took you to write it?
Dec
5
awarded  Mortarboard
Dec
5
awarded  Enlightened
Dec
5
awarded  Guru
Dec
5
awarded  Nice Answer
Dec
5
awarded  Good Answer
Dec
5
comment Is `catch(…) { throw; }` a bad practice?
@SteveJessop: I was just saying that fault blocks are also a special kind of exception handler in the .NET framework. I wasn't saying that catch/throw was a Microsoft thing.
Dec
5
comment Is `catch(…) { throw; }` a bad practice?
Fun fact -- that block of code shouldn't even be considered a catch block, but a fault block -- a block that is executed only on an exception, which is part of Microsoft's .NET Framework.
Dec
5
comment Is `catch(…) { throw; }` a bad practice?
@MichaelKrelin-hacker: That too. Also, add to it the fact that they deprecated exception specifications because listing all possible exceptions in the code tended to cause bugs later on... it's the worst idea ever.
Dec
5
answered Is `catch(…) { throw; }` a bad practice?
Dec
3
comment What does C++ do better than D?
@PeterAlexander: In C++ I would just allocate it on the stack: MyClass s;, I don't see why you think we need placement new. And I do it very often (don't you??); it's not "rare" at all. In D I used to be able to say scope auto foo = new MyClass();, but since they removed it (probably because they don't want us to use it!) now I have to use emplace, which is painful. So effectively, D doesn't let you do what C++ does: to allocate an object on the stack. It's quite a fair comparison, and C++ does vastly better than in this regard. There's nothing "out of proportion" here.
Dec
3
comment What does C++ do better than D?
@PeterAlexander: You must be joking, right? How do I access the caller's stack frame and allocate data on it?
Dec
3
comment What does C++ do better than D?
@PeterAlexander: Yes, the exact problem with emplace is that it requires a ridiculous amount of typing to do something so simple -- first I have to declare a ubyte buffer, then I have to do sizeof on the type (which may need something like typeof(foo).sizeof) to get the size of the buffer, then I need to emplace it (God knows the hell I'd go through if the type had alignment > 16 bytes). So while it works in theory, in practice it's been made to prevent people from actually using it, given how painful it is to use. It's nothing like in C++.
Dec
3
comment What does C++ do better than D?
@PeterAlexander: Yes, let's be clear indeed -- I'm talking about DeadMG's last comment: I should waste the overhead of dynamically allocating it and the indirection and cache and collection overheads because I want to alias it? I was saying that forcing the user to use reference types creates a performance penalty due to the heap allocation, whereas pointers to structs don't have that penalty because the struct can be allocated on the stack. This is clearly something that C++ does better than D (even better since it allows value type inheritance), as it provides more control/performance.
Dec
3
answered What does C++ do better than D?