I'm learning C (after having taught myself Perl, Tcl, Bash etc). For me,
OOP (i.e. C++, Objective-C, etc) is mind-bogling information overload.
Seriously, does programming *need* to be as convoluted as OOP appears to
me? Cannot C - all by its lonesome - do as good of a job as an OOP
appraoch?
I'm just trying to set a course for myself. I realize that "languages" are
simply tools in my toolset.
However, some toos are simply way over the top, IMHO, for most jobs. Is
that not so? TIA...
C can do what C does.
what C++ adds is largely syntax, and little stops similar from being done in
C (although, it is rather unlikely that anyone would write C in quite the
same way as C++, and most C++ / Java / ... devs' likely can't imagine doing
anything any differently...).
IMO, OOP, as we know it, is a little bit of a fluke.
it is not really necessary to perform tasks, or even to perform tasks well.
it was a language feature, and so many others turned it into a panacea.
nor is it even really the "best" way to do OO, IMO (personally, I regard
Prototype-OO is a model that is simpler, cleaner, and more powerful, but C/I
OO does have a few merits).
"OOP" / C/I OO basically tends to tie up a lot of the problem in meta-issues
(where the abstract model is not clearly separated from implementation
issues and performance concerns, and sadly it seems many who use it fail to
note the difference).
history is in line here:
first, there was Simula.
then, C++ borrowed from Simula, not strictly faithfully, but it was merged
with a C core and made really fast. this resulted in early C++ and OOP,
which was more the version I had "originally" learned, although eventually I
ended up mostly with plain C (I suspect this was due, in part, to most of
the code I had encountered and worked with having been in C).
in these early days, from what I remember, C++ had classes, ... but, for the
most part, stylistically it was something most C programmers would
recognize...
then Java came along, and was another big promoter of OOP, but their OOP was
"different" in many ways from the early C++ style. the object model was a
little different, and the language imposed many stylistic concerns directly
into the language design.
subsequently, this style merged back into C++ land, and now we have lots of
C++ code that looks and is organized (almost) just like Java code (and I
can't say I am exactly pleased with this style).
this is now what is generally called "OOP"...
elsewhere, there was SmallTalk, and then later Self, which developed a very
different "OO".
the style from Self (Prototype OO) was then later adapted, although once
again hardly faithfully, into JavaScript and later ActionScript.
and, many people encounter these languages, and have no idea what the hell
is going on... (and many will refuse to acknowledge that they are even
"OO").
I guess in many peoples' minds, OO revolves around the "class", and the
elaborate taxonomies and inheritence trees, and without these they are
lost...
granted, P-OO (as it exists in Self or JS) is not perfectly adapted to
C-family statically typed languages, and so a few adjustments are needed.
one such adjustment in my early considerations had been adding interfaces,
which had then become, among other things, the almost central structure
(objects were essentially amorphous and defined primarily in terms of their
interfaces).
although, at the time, this was actually a design more resulting from
consideration as to how to make P-OO objects accessible from Java (in a
custom VM framework where the underlying OO facilities can handle both
models).
(actually, I made a C/I implementation and hacked P-OO onto it, although
maybe it would have been better to have implemented efficient P-OO and
implemented C/I on top, as this would likely have allowed a cleaner
implementation without much performance impact, but oh well...).