Re: OO is not that great: many repeated codes




sjdevnull@xxxxxxxxx wrote:
topmind wrote:
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)

Objects and classes are different things.

It depends on the language and which definition of OO one is using.
Dynamic languages tend to make less distinction between classes and
objects. A "dynamic class" usually looks so much like an object that
one might as well make them an object to simplify the language rather
than support two almost-the-same things.


And yes, to many OO programmers Java is "bad" (or at least sub-optimal)
because it encourages everything to be part of a class; to a Smalltalk
or Python programmer, forcing everything to be in a class is very far
from what OO is about. There is a very large segment of "pure OO"
advocates who aren't big fans of the C++/Java-style class-oriented
verbosity.

A global function may not qualify as an object/class though. Sure, one
can shoehorn it into an object, but anything can be shoehorned with
enough pressure and screaming and/or fancy syntax shortcuts, such as
"default methods".

-T-

.



Relevant Pages

  • Re: OO is not that great: many repeated codes
    ... a class is not the same thing as enabling elegant code. ... It depends on the language and which definition of OO one is using. ... enough pressure and screaming and/or fancy syntax shortcuts, ... the screamings and the fancy syntax shortcuts? ...
    (comp.object)
  • Re: OO is not that great: many repeated codes
    ... topmind wrote: ... a class is not the same thing as enabling elegant code. ... It appears that you are agreeing with the original claim that sometimes ... to many OO programmers Java is "bad" ...
    (comp.object)