3 ms·
Sure, but GP was criticizing Java, not Exceptions. I find that JavaScript, Ruby and C# are all easier to debut in practice than Java, and all three use excepti
by whstl 2y ago
Sure, but GP was criticizing Java, not Exceptions.
I find that JavaScript, Ruby and C# are all easier to debut in practice than Java, and all three use exceptions. IMO this is mainly due to what idiomatic Java looks like and how libraries/frameworks are structured.
- mike_hearn 2y agoHm, we've had different experiences then. My experience with languages like JS/Ruby is that exceptions are often obfuscated (for js) and will frequently be meaningless type errors like "foo is not an object". I didn't use C# but I'd guess it's similar to Java. After all, here's an exception factory library for C# (https://github.com/scionwest/ExceptionFactory https://github.com/scionwest/ExceptionFactory). What most people seem to complain about when they say "Java" is actually dependency injection frameworks, not the language or even regular libraries (which typically don't use them). I also don't like Guice so can sympathise, but DI frameworks vary in quality a lot, and you don't have to abuse them. Modern frameworks are based on code generation and check much more at compile time. My app uses a compile time DI framework to set up the build task graph, but doesn't have a factory bean anywhere and has never yielded strange errors about factories that were hard to debug.
- whstl 2y ago> What most people seem to complain about when they say "Java" is actually dependency injection frameworks This is precisely what I said with “ due to what idiomatic Java looks like and how libraries/frameworks are structured”. Sure, in a platonic ideal Java codebase, it’s all great, but I am talking about my actual practical experience, and I said as much in my message.
- mike_hearn 2y agoYeah but I don't know if DI (ab)usage is really idiomatic Java. I've written lots of Java over the years and only rarely used DI frameworks. Libraries never use them. When I did use them they've been fairly restrained and most of the code you wouldn't notice it. It might be idiomatic if all you do is write web servers.
- whstl 2y agoAlright, that's fair! I only ever wrote web apps in Java, other than very small scripts and libraries. You're right.