Re: OO is not that great: many repeated codes



Java is hardly a good role model here. Forcing everything to be a member of
a class is not the same thing as enabling elegant code.

It appears that you are agreeing with the original claim that sometimes
procedural is less code than OO. Java is "bad" because it forces every
function to be a member of a class (or object) such that one has to
have a double-nested thing:

class foo {
method bar(...) {
}
}

When it may be easier to just have:

func bar(...) {
}

If you remove this restriction, you are going outside of OO to get
simplicity.

It is the "every verb must have a primary noun" rule of OOP. And it is
often an arbitrary, silly rule. The relationship between nouns and
verbs in the real world (and as strait-forward software) is often
many-to-many. OO hates reality, chasing a useless Plato-like idealism
of self-contained nouns at all costs.

(Perhaps this is why Java has such a verbose "print" statement.)

-T-

.