> That's not typical Java code. You could do that in quick & dirty code, but I haven't seen such code in production code.
It sounds to me like you're an extremely lucky person. I've seen too much of that sort of thing in production code, including a catch-all for Throwable at the top that didn't even dump a stacktrace.
Re:Half a million lines of Go
by catlifeonmars on Monday May 17, 2021 @01:45AM
(#27180401)
Anecdata: but I see this pattern all the time in production code. It’s not limited to Java: I’ve seen it in TS/JS, Python, and C++. I haven’t (yet) seen it our Go codebases.
Typically this is passed to production and not seen by devs. Ie. there's no point to handle NullPointer explicitly (programmer error).
That's not typical Java code. You could do that in quick & dirty code, but I haven't seen such code in production code.