News for hackers. Stuff that matters.
Re:Please put units in names by michaelt on Monday March 21, 2022 @08:13AM (#30753148)
A class named 'HttpRequestInitializer' and taking 10 lines to set a timeout on a HTTP request isn't merely hypothetical: https://developers.google.com/api-client-library/java/google... - and that's not counting any import statements.

(although getDefaultTimeoutFromEnvironment was artistic license on my part)

Re:Please put units in names by contravariant on Monday March 21, 2022 @08:28AM (#30753266)
True, but like I said that doesn't make it not silly. Just harder to fix.

Edit: Also, overriding a class method dynamically inside a function? I usually program python these days and even I think that's wild.

Re:Please put units in names by jsight on Monday March 21, 2022 @09:21AM (#30753807)
Its an interface with only method. I suspect that most of us would just us a lambda now.
Re:Please put units in names by contravariant on Monday March 21, 2022 @09:26AM (#30753842)
I'll never quite understand why it wasn't simply a function in the first place.
Re:Please put units in names by dtech on Monday March 21, 2022 @10:26AM (#30754502)
Java pre-8 only had anonymous classes, there were no lambdas
Re:Please put units in names by fiddlerwoaroof on Monday March 21, 2022 @11:39AM (#30755308)
And Java lambdas are still syntax sugar for one-method anonymous classes.