Actually, I waffle on checked exceptions; it seems every 8 months or so I have a different opinion of them. Right now they suck.
It always bothered me that Java forces me to explicitly handle/rethrow exceptions, yet happily overflows my ints without batting an eyelid.
Initially I threw a Runtime (ie: non compile time) exception. After going to production I realized that these were bubbling up to the UI and giving the user very intimidating error messages. So I changed the exception to a Compile time exception and then the compiler caught every place I let the error slip through to the UI. In my opinion it saved me a lot of time and made my code easier to maintain.
1: EG: Who is Java to say that this IOException should be handled in code? Perhaps this IOException should not happen and requires a developer's intervention.
I'm so tired of writing null checks ...
I guess I kinda wonder if I could avoid the null checks in C# somehow ... I figured using a design by contract approach might be used to reduce the null checks somewhat.
It's definitely NOT awesome. This stupid behaviour causes bugs all the time as you think you're doing an action but it's actually a no-op because something else failed and you get a nil. An NPE is awesome - it crashes immediately and you know exactly what is wrong. A silent no-op is the worst thing to debug.
Without seeing your code it is hard to say, but using an object extension might work?
On many occasions I've used object extensions to hide checking code deep inside the extension.
C# really got that feature right.
Let's not forget about type-erasure generics. And the existence of arrays. And the fact that people still use arrays.
Type-erasure generics are a fortuitous platform decision, because its what enables languages on the platform to have a good interop story while still having a more robust type system than Java does -- case in point, Scala, and why the .NET version died.
But type-erasure of generics - that's the decision with which we will need to live till the end of time.
- no multiple implementation of same generic interface
- small performance hits..
- a lot more but I'm just sleepy right now.
I hear you.