Hacker News new | ask | show | jobs
by Xorlev 2556 days ago
Not trying to knock the work, but why is no static methods a selling point? How does one do utility classes instead? And do you eschew static factory methods entirely?
6 comments

Yegor has quite orthodox view on Java development. You might want to read his blog to get better understanding on his position. While I don't agree with many of his points, it's a very interesting and refreshing perspective that is useful to learn IMO.
Unorthodox?
I think orthodox works here as its a more strict reading of the "everything is an object" dogma.
"Native"? "At home"? "Happy Commoner in the Kingdom of Nouns[0]"? Or stockholm syndrome... I kind of get on "no static methods! 'util' and 'helper' are smells!" bends myself from time to time in order to make designs clearer and unit testing somewhat saner (because the even more sane approach of writing or refactoring to smaller pure functions and keeping them that way is too much to ask for sometimes) but it's all just because I spend too much time working in an insane language with a broken idea of what OOP is. Still, I appreciate write-ups like the author's, and at least he's right about immutability being good in general.

[0] http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom...

I didn't know the context, so thanks! I'll take a look. :)
Because static methods/variables/things are hard to test code with because they're hard to replace. IME getting rid of static is the wrong solution though, the difficulty is only because of a limitation of current languages, unit test frameworks and build systems. If you can inject your substitutes at compile time (which I think you should be able to do at the test link step with java) then static isn't a problem.

There's also the issue of people seeing OO as the goal not the tool, which I think might be the case here too.

and don't like 3/4 of the library within have static methods?

that's just adding sequential coupling for no good reason

i'm going to guess this was an exercise to try to do this, not to be effective as a tool :)
You can see how many products already use this framework. So, yes, it was an exercise at the beginning. Now it's a fully functioning web framework.
Interfaces with defaults.
Testing.