Is there good place for questions like "why in language XXX feature YYYY was designed in particular way (maybe 10-20 years ago)" or similar questions on historical design decisions.
My feeling is that such questions have low practical value and thus don't belong to SO.
Case that prompted the question: Why does C# have a separate rethrow statement (throw;) instead of overloading throw ex?. I closed it is as duplicate of discussion on the feature in question, but probably it should be handled differently.
What is recommended reason to close or if it even should be closed at all? Would such question be more appropriate for http://programmers.stackexchange.com ?
throw
preserves the stack trace from the original exception.throw ex
creates a new one. That's it. Use whichever one is appropriate for the situation.throw ex
always preserves stack trace in Java, and if you don't want this you can create a new exception, e.g.throw new Exception(ex.Message);
; this approach seems more natural to me, so I do not understand which is the advantage of the C# design.throw ex
" exists. But it's a little bit confusing because he's also suggesting thatthrow
should be changed tothrow ex
, and not explaining that very clearly