
OO is not Computing, Newer is not More modern - hencjo
http://ormomg.blogspot.se/2012/04/oo-computing-newer-more-modern.html
======
marcusf
I would like to meet one of these fantastical java-only OO-proponents that are
often brought up in posts like this, claiming that Java and OO are the end-all
of programming. To be honest, I never have.

Some people seem to have a disposition to modeling problems with objects, but
I fear I'm too young to have ever met any Java zealots. To me they seem more
like straw men invented to help set up posts like this one.

~~~
groovy2shoes
There are a lot of Java-only OO-proponents in the corporate world.

~~~
babarock
Agreed with parent. Come take a stroll in my office; I work in a coporate
bank. Most of my coworkers learned "real" programming in the 90s, when Java
was the hot new thing on the block. To most of them, the whole Programming
Language eco-system can be summarized to an endless "C++ vs Java vs C#"
flamewar.

Just yesterday a colleague of mine looked at me with chock and awe when I told
him I enjoy coding in C. "But... it's not OO!" he mumbled, puzzled.

Pushing the caricature a little further, Python and Ruby are toy languages
that only hipsters use, Perl is only to be used by the sysadmin down the hall,
and Lisp is the biggest failed experiment programmers ever came up with.

Pointy-haired bosses encourage this kind of thinking: They would never get in
trouble for chosing a language amongst the big 3 (C++/C#/Java).

I once heard someone say: "I don't understand why there are still new
languages coming out every day. Shouldn't everyone just use Java?"

~~~
jasonlotito
> can be summarized to an endless "C++ vs Java vs C#" flamewar.

As opposed to an endless "Ruby vs Python vs PHP" flamewar?

Pushing the caricature a little futher, C++ and Java are enterprise languages
that only old out-of-touch programmers use.

Hipster Apple-using kids encourage this kind of thinking: They would never be
un-cool for choosing a language among Ruby, Python, or Lisp.

It's far too easy to become that type of programmer. Choice of language has
little to do with it. No doubt you understand this, just making the point
clear.

~~~
babarock
You sir made my day, thank you very much!

------
fauigerzigerk
_"Lots of so called object oriented languages have setters and when you have
an setter on an object you turned it back into a data structure."_

That may be because data structures is what we actually need. Data structures
largely determine the computational complexity of operations and I think it
makes little sense to act as if we could always think in terms of abstract
responsibilities, interfaces, encapsulation, message passing, etc.

These things are useful organizational principles for coping with large
systems, but at the core of most large systems is some algorithmic
transformation of one data structure into another.

~~~
xyzzyz
I think that the point here is that while data structures are objects, not
every object should act like a data structure.

~~~
groovy2shoes
Keep in mind that when Alan Kay says "object" he means something different
from programmers-at-large. To the general population of programmers, an object
is just a data structure that's been bundled with some behavior. To Kay, an
object is a computational entity that can only send/receive messages (what
Carl Hewitt called an actor even before Smalltalk was on the scene). In Kay's
mind, objects do not expose state the way they commonly do in the mainstream.

------
swalsh
Most of object oriented programming to me feels like nothing more than trying
to decide the best place to put something. As time goes on though, typically
the 3rd iteration, there just is no good place to put this new thing. A
redesign would be best, but I only have 1 week to finish this new feature.

So a project (well at least in my experience) progresses like this: "Wonderful
architecture" > "glad I designed this project well, its' paying dividends!" >
"hmmmm I never considered this paradigm before" > "new guy joins team" > "argh
this code is crap"

Object oriented programming can be really elegant... but I can see why people
hate on it.

~~~
hackinthebochs
I think you summed it up well. People hate object oriented code because it has
an extra startup burden. It's hard to just dive in and start fiddling with
code because there are many project-specific abstractions you need to
understand before-hand. The new guy on the project has to spend extra time to
"grok" the idioms of the project. I personally don't see this as a bad thing.

The fact is, abstraction is key to programming. People who have a hard time
managing extra abstractions in their head probably aren't nearly as good of a
programmer as they think.

~~~
tetha
On the other hand, people complaining about this don't realize it is very much
the same in any other language.

Go ahead and just fiddle around in that million loc c codebase. Or that
million loc java codebase. (and ignore for a second that that c codebase is a
large compiler and that java codebase is an elaborate hello world). Or a
hypothetical million line haskell codebase.

In C you have to understand modules, functions working on structures and
functions controlling the architecture. In Java you have to understand class
hierachies and classes or functions managing the control flow. In haskell, you
have to understand abstract data types, type classes and monads and functions
managing control flow.

------
seanmcdirmid
OO gets a bad rap, it is incredibly useful in applying ontology to program
structuring. Yes, OOP in Java isn't ideal, but if you look at more pure OOP
languages like Smalltalk or Self, its virtues really do begin to shine
through.

FP is great when expressing computations, but we often are just gluing nominal
entities together, where OOP excels over FP. I like to have a few FP options
in my languages (C#, LINQ), but my mind is firmly rooted in objects when it
comes to overall macro design of the program.

~~~
ajuc
OO is great for systems, where you have real objects, and only care about
their current state. In effect - for simulations, games, such stuff.

In most systems - changes over time, archival data, and relations between
objects are important. And with OO it's ugly to keep them. You end up
implementing relational db backed by object collections. And your nice objects
instead of representing nouns (Employee, etc.), start representing relations
(Employement, etc.).

So people use relational db with ORMs and load everything from database into
objects only to show window/edit data, call one or 2 methods on these objects,
and save data back into database. All this ceremony to write
employee.giveRaise(raise) instead of giveRaise(employee, raise).

~~~
seanmcdirmid
And yet this problem kind of goes away in a key value or graph database. I
wonder if the ORM mismatch is often not one of objects getting in the way, but
one of using relational in the first place. At anyrate, how you manage your
objects (for things like search) is ideally orthogonal to the objects
themselves; though this is difficult to accomplish in practice.

I use objects in reactive (non-persistent/DB) systems all the time. Objects
aren't the problem, but you do have to manage your dependencies dynamically by
tracing/dirtying/and cleaning. Objects actually excel at encapsulating and
managing state, it is much harder to do this with functions (see all the work
on functional-reactive programming).

~~~
ajuc
Hm, I've never used key-value/graph datastore, and it seems I need to. Is
there something like selects with joins for graph nodes? How do you represent
changes in objects over time?

------
rbanffy
So, when Alan Kay implies Java damages the brain, he is quoted. When I say it,
I get downvoted. Do I see a double standard here?

BTW, I learned to program on a Texas (TI-55) calculator. What symptoms should
I be presenting? ;-)

~~~
minikomi
RSI, perhaps?

~~~
rbanffy
Any age-related condition would be a fair guess ;-)

------
officialchicken
Modernism (bauhaus/destijl) is about 100 years old.

Why is it so hard to understand that there is an implicit set of limitations
based on the tools (and/or materials) we use in our projects?

Think skyscraper... now think wooden skyscraper.

------
eli_gottlieb
Objects are a poor man's closure. Closures are a poor man's object. Objects
are a poor man's first-class module, and so are closures. First-class modules
are a poor man's type-class. Type-classes are a poor man's first-class module.

Hail, _Torat Exists_ , the holy teachings of the existential type!

------
16s
That's why I like C++ so much. It doesn't force OO down your throat. It lets
you program using whatever style is best suited for the job.

~~~
udp
I also take or leave C++ language features as required, and I wish more people
shared your point of view.

Among the C++ crowd (particularly over at Stack Overflow) there's this
infuriating attitude that any code that doesn't use std::string, std::vector
or boost::magic_super_auto_ptr is _language sacrilege and the developer should
be burned with fire because it's not C++ it's C and malloc is deprecated and
arrays are deprecated, and, and..._

~~~
UK-AL
That's because without using these things, people can end up accidently
shooting themselves foot quite easily. Like accidentally removing the end
character from a char* string...

Normal malloc, and dealloc can get stupidly complicated when lots of other
objects reference one memory location, which is why these referencing auto
pointers come in, with built bounds checking etc

Using those things is defensive programming.

------
stitchy
I'm interested in what alternatives that the author has for the Object
Oriented "zealots." I'm assuming that his alternative is a functional
language. Personally, I think that functional languages are great, but I don't
think that's any reason to flame Java/C++/C#. These are great tools. They were
created for specific reasons, and they can certainly be used in efficient
ways. Of course, they can also be horribly abused. I don't think that it's
fair to say that any particular language is the end-all be-all for
development. You have to pick the right tool for the job.

------
guard-of-terra
"ORMs are newer and hipper than those old boring outdated relational
databases?" I stopped reading after this point since author obviously doesn't
understand what he's talking about.

~~~
fauigerzigerk
What does he not understand?

~~~
esteth
an ORM is a library to map objects onto a relational database. They're not a
substitute for databases themselves, but a substitute for a DB interaction
library.

ie: To use an ORM you must use a relational database. Things like mongoose
exist, but they're not ORMs since they don't map objects to a _relational_
database.

~~~
fauigerzigerk
I see what you mean. I thought he was mocking the idea of wrapping the old
uncool relational model in a fashionable new OO API.

What is substituted is not the relational DBMS but the relational model. ORMs
are supposed to let you think in terms of objects instead of sets of tuples.

~~~
UK-AL
No, turns out most sql work involves extracting data from the resulting sql
statement into objects. So you don't end up passing 5 params from the sql
result everywhere.

ORMs do these automatically, and go beyond.

~~~
fauigerzigerk
That's true for some basic CRUD operations and that's what ORMs should be used
for.

But people tend to just blindly copy everything into an object model and
perform operations on those objects that could just as well have been done in
a set oriented way with a lot less code causing a lot less network traffic.

Obviously there are scalability downsides and not everything is easier to
express in terms of sets, so I try to be pragmatic. You can of course do set
operations through an ORM but that's not its purpose and the performance
implications are sometimes tricky.

------
ericHosick
I've been looking into different software engineering methodologies and it
seems that all of them rely on specialization. I think this leads to un-
necessary complexity.

OOP might not be more modern but I think it was trying to move into the
direction of less specialization. Unfortunately, it has gotten side tracked.

------
richieb
Java is a new language? It's been around for 15 years or so. OO is even older
- goes back to Simula 67 and Smalltalk in late 70s....

