Reputation
4,238
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
2 21 38
Impact
~226k people reached

Dec
2
revised What is the conceptual difference between finally and a destructor?
added 636 characters in body
Dec
2
comment What is the conceptual difference between finally and a destructor?
@BartvanIngenSchenau: Is it that subtle? To me it seems like there's a pretty obvious rule of thumb: if you're releasing a resource, use destructors; otherwise use finally. I feel like that's clear in most if not all cases?
Dec
2
comment What is the conceptual difference between finally and a destructor?
@BartvanIngenSchenau: I never argued that any language currently in existence has a philosophy or implementation that matches what I described. People haven't finished inventing everything that could possibly exist yet. I only argued that there would be value in separating the two notions as they are different ideas and have different use cases. To satisfy your curiosity, I do believe D has both. There are probably other languages too. I don't consider it relevant though, and I couldn't care less why e.g. Java was in favor of finally.
Dec
2
comment Why is there no 'finally' construct in C++?
@StevenBurnap: Hopefully that's not a "true Scotsman" issue? i.e. if a C++ programmer did tell you that, hopefully you wouldn't think less of them as a C++ programmer, right? Because I expect many would, hence why you might never hear that.
Dec
2
comment What is the conceptual difference between finally and a destructor?
@MartinBa: Okay =P let me guess, you're going to argue the first case is too artificial, and that e.g. there must be some kind of "acquire" operation paired with the finally block?
Dec
2
comment What is the conceptual difference between finally and a destructor?
@BartvanIngenSchenau: Is that even a fact? In which language? And why should it factor into this?
Dec
2
answered What is the conceptual difference between finally and a destructor?
Nov
25
comment Is there anything that can be done with recursion that can't be done with loops?
"Prettier" is a technical term...?
Nov
24
answered Is there anything that can be done with recursion that can't be done with loops?
Nov
13
awarded  Nice Question
Nov
3
awarded  Popular Question
Oct
29
comment Why is the minus sign, '-', generally not overloaded in the same way as the plus sign?
This is more likely because set subtraction is defined in math, but set addition is not.
Oct
17
awarded  Popular Question
Aug
20
awarded  Autobiographer
Aug
17
comment What is it about functional programming that makes it inherently adapted to parallel execution?
+1 even though I'd noticed the problem with too much parallelism before, I had never looked at it the way you did in your answer. This gives me a great perspective, thanks for writing this.
Aug
8
awarded  Pundit
Jul
23
comment C++ Iterators: Best practice to represent end of range - Last or Beyond-last?
How would you represent the end of an empty range...?
Jun
30
comment How do I design a subclass whose method contradicts its superclass?
If a contract was just a method signature then it would be useless to ever specify them explicitly, since the signature would enforce it already.
Jun
22
comment What problem do algebraic data types solve?
Your last sentence is kind of like telling someone that "ships solve the same problem as airplanes: transportation -- they just take a different approach to it". It's a completely correct statement, and also a pretty useless one.
Jun
17
comment What's the point of implementing a Stack using two queues?
(...cont'd) If you think about the uses of priority queues, it is generally true (i.e., there exists a statistical trend) that those enqueued later are still dequeued later than those enqueued earlier. For example, breadth-first-search is an approximation to Dijkstra's algorithm in many cases, even though in particular instances it might not be a great approximation. A stack is never any kind of approximation to a queue. It has precisely the opposite behavior in every situation, so calling it a queue is completely nonsensical.