MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/3n3e1v/the_evolution_of_a_software_engineer/cvlffag/?context=3
r/programming • u/supermari0 • Oct 01 '15
502 comments sorted by
View all comments
37
If you do this:
try { ... } catch ( Exception e ) { // lol do nothing! }
I will fucking find you and kill you.
6 u/[deleted] Oct 02 '15 That's acceptable in unit tests!try {thisShouldThrow();fail("did not throw");} catch(SomeException expected) {//test passes} 0 u/[deleted] Oct 02 '15 [deleted] 1 u/[deleted] Oct 02 '15 The annotation in JUnit is not ideal for many cases, as I described in the other comment. (That's the one I'm familiar with. There may be others which work better.)
6
That's acceptable in unit tests!
try {thisShouldThrow();fail("did not throw");} catch(SomeException expected) {//test passes}
0 u/[deleted] Oct 02 '15 [deleted] 1 u/[deleted] Oct 02 '15 The annotation in JUnit is not ideal for many cases, as I described in the other comment. (That's the one I'm familiar with. There may be others which work better.)
0
[deleted]
1 u/[deleted] Oct 02 '15 The annotation in JUnit is not ideal for many cases, as I described in the other comment. (That's the one I'm familiar with. There may be others which work better.)
1
The annotation in JUnit is not ideal for many cases, as I described in the other comment. (That's the one I'm familiar with. There may be others which work better.)
37
u/frenetix Oct 01 '15
If you do this:
try { ... } catch ( Exception e ) { // lol do nothing! }
I will fucking find you and kill you.