1,673 reputation
31839
bio website
location Singapore
age
visits member for 3 years, 11 months
seen 25 mins ago


17h
revised Why have many programmers moved to using exception handling for input or output?
edited body
17h
comment Why have many programmers moved to using exception handling for input or output?
"Because input and output are unreliable" does not explain why exceptions are used instead of error-codes. As such, I believe I have a better explanation (despite the -15 downvotes) at programmers.stackexchange.com/a/279911/24257 .
17h
comment Why have many programmers moved to using exception handling for input or output?
@utnapistim, This is an unbalanced comparison. If you wish to weigh the use case whereby we have multiple error codes, you must weigh it against the equivalent use case whereby we have multiple exception paths, as can be seen in the long snippet in stackoverflow.com/a/315967/632951 . If you are going to weigh the "catch-all" — } catch(e) { /* handle all */ } , then you must weigh it against the two-state errorcode 0 and 1 which doesn't use switch.
17h
comment Why have many programmers moved to using exception handling for input or output?
.............................. answer only when the reasoning is flawed, not just because it happens to be on the minority side (goodness -15 votes?) of a religious flame-topic.
17h
comment Why have many programmers moved to using exception handling for input or output?
@AK_, While that's irrelevant, I really doubt he'll not stand behind it today. His post on AMA shows I'm on the right track. Also, the links I've posted provides strong reasoning that exception-based code has many pitfalls. If you've skipped through all of them, you can start from Raymond Chen's reasoned blogpost 6 paragraphs before "it is extraordinarily difficult to see the difference between bad exception-based code and not-bad exception-based code". I'll delete the ...........................................
17h
revised Why have many programmers moved to using exception handling for input or output?
added 529 characters in body
17h
comment Why have many programmers moved to using exception handling for input or output?
@DougM, The phrase "easier way" would be appropriate then. Whether that's a good or bad thing is irrelevant and will depend on each use case, as the question here is simply "Why have many programmers moved to using exception handling for input or output?" And the answer is because it's the economical choice. That decision has no direct relation with theoretical correctness nor faulty input/output. — Regarding the part on "more/less code", If you re-read through the links, it's evident Dijkstra's quote above is not saying that more code is a good thing, he's stating the exact opposite.
1d
revised Why have many programmers moved to using exception handling for input or output?
deleted 206 characters in body
1d
comment Why have many programmers moved to using exception handling for input or output?
@utnapistim, The question is comparing exception handling against the other alternatives. And yes they make things easier when there's no need for reliability yet it's the easy way out when you get to high-reliability situations. See the links I've provided, especially blogs.msdn.com/b/oldnewthing/archive/2005/01/14/352949.aspx and joelonsoftware.com/items/2003/10/13.html
1d
comment Why have many programmers moved to using exception handling for input or output?
@Aaronaught, While silent downvotes don't help the site, comments which explain nothing is just as non-useful. Why do you say that this is a troll answer?
1d
revised Why have many programmers moved to using exception handling for input or output?
edited body
2d
revised Why have many programmers moved to using exception handling for input or output?
added 55 characters in body
2d
answered Why have many programmers moved to using exception handling for input or output?
Apr
15
comment What is negative code?
Related: quora.com/How-many-lines-of-code-do-professional-program...
Apr
12
comment Why is jQuery released under MIT and not LGPL?
The question should be "Why is jQuery releasd under MIT and not CC0?"
Apr
8
comment What is the best way to INSERT a large dataset into a MySQL database (or any database in general)
Is this actually faster?
Apr
3
comment Why choose an established CMS as opposed to building one from scratch?
@sparks, Troubleshooting other people's bugs are 100x more annoying that troubleshooting your own bugs.
Apr
3
comment Should the name of my program be a verb (“frobnicate”) or a noun (“frobnicator”)?
@Spoike, See the 5th point of quora.com/What-are-some-jokes-that-only-geeks-can-understand/…
Mar
25
comment What does SVN do better than Git?
@LazyBadger, Never heard of it.
Mar
25
comment What are the advantages of showing line numbers in a text editor?
@Rook, Definitely. If you have everything in one file, the quality usually increases because It's easier to ensure that you don't have some stray code in some stray file somewhere.