Am 13.02.2014 21:27, schrieb Uri Guttman:
actually that isn't totally true. the concepts are fairly language
independent but some languages have better support for OO than others.
in particular it isn't hard to do OO even assembler (which i did) in
that i grouped common data together and called subs via attached
pointers. the biggest feature (which i generally don't like anyway) is
inheritance and that pretty much has to be in the language to be effective.
Nah, unless the language is very strict, we can fake it.
A good example would be nowadays Javascript that really doesn't support
OO, but pretty much every framework is object oriented by working with
conventions that look & feel like OO.

Perl itself also doesn't support "naturally" OO (unless you use Moose),
it is more a kind of hack (as from a point of view of the language, it
is just a way of how to find wich procedure has to be called mostly
following a DAG - nothing more happens when we bless something), but
that is flexible enough to provide everything C++ also has.

Learning object oriented programming (and design) is pretty much
language independent.

BTW, inheritance is IMHO much overrated. Most frameworks uses OO more to
simulate generic patterns, that's why languages which enables interface
still feel OO and strictly OO languages like Java had to built in
generics to be useable longterm. In most cases, excessive inheritance
creates more problems than it solves (unless we speak about GUI
programming, but nowadays even this is solved better by HTML5). It is of
course important that an object has a @ISA history, but most often it is
also important that it is not abused too much. As said, most often it is
just an interface with some data included (what btw also isnt the
internal view of Perl/PHP/... to it, there it is just a hash with
knowledge of its father and an instruction to the language to find its
inherited methods).

OO works best when we have to develop some kind of global problems like
designed by Gammas Patterns and if we think of stuff like the Factory
Pattern, well, then the language and its support for OO isn't really
that important.


Search Discussions

Discussion Posts


Follow ups

Related Discussions



site design / logo © 2021 Grokbase