
Love this essay, I still can't (don't want to) find an appropriate way to OO. - ivan
http://www.paulgraham.com/noop.html
======
tx
Paul's essay sounds like a case against commercial OOP-"languages for the
masses" like Java/C# more than it's against OOP. Ruby, JavaScript and Python
are perfect examples of powerful languages he seems to have no issues with.

I can't stand Java for the very same reason: it was created with a very
specific commercial purpose in mind: to have enterprise software projects done
cheaply. This implies that language should be simple enough (inexpensive
training, armies of dispensable coders) and restrictive enough (cheap QA) to
cheaply build systems that transfer data from one database to another. Sun, do
not forget, is a hardware company. And what many hardware companies want, is
to turn software into irrelevant commodity.

~~~
Tichy
So you hate Java because it is easy to use and stable? I fail to see the
negatives in ease of use and cheap QA?

~~~
Shorel
Somebody else here. I do hate Java because it's unnecesarily complex. That is,
I hate J2EE and all the f@#$%@#%g stuff I must do to simply pass a variable
from one form to another. It's like having chains hanging from my body and
trying to run. I hate that language and the stuff Java-only-heads do with it.
I do, however, love the JVM.

------
brlewis
Most of the problems I solve don't call for OO, but it's definitely useful.
The one bug I can think of that I would have avoided by using OO was the one
that I introduced just before asking news.yc to evaluate ourdoings.com last
time.

I think pg is right not to rush to implement an object system in arc. There
are many opinions about what the right object system looks like. Anybody
without an opinion should stay out of the way. Someone else can implement an
object system for arc later.

------
aston
Let's not pretend there's nothing good about OOP. Obviously it doesn't solve
any more problems than any other programming model (they're all Turing
Complete), so personal preference will have to come into play.

Besides, most of pg's gripes about OO are mostly gripes about bad programming.
I've seen some seriously elegant stuff done in even the uncoolest of
languages. Google runs entirely on OO languages (C++, Java, Python), and you'd
be hard pressed to find someone willing to criticize their codebase for bloat,
duplication, or inefficiency.

~~~
herdrick
I really think OO has been a net loss for the industry and individual
programmers. Attaching all functions to data structures, inheritance, hiding
fields... these are a net loss. (And about that field hiding aspect of
encapsulation - Who are we hiding them from? I ask you.)

~~~
Tichy
It's not a security thing, simply a housekeeping thing. It is more readable
and understandable if an object only exposes the methods that it's user needs.
It's about reducing complexity.

I think in Java you actually can access the private methods of an object via
Reflection, if you absolutely want to.

~~~
kingkongrevenge
"It is more readable and understandable if an object only exposes the methods
that it's user needs."

This sort of encapsulation is not specific to OO. You can hide data and
methods within modules without using classes. In C++ terms you use anonymous
namespaces. In C, perl, python(?) and other languages a leading underscore or
"static" declaration conveys encapsulation, which is good enough as far as I'm
concerned.

------
lupin_sansei
I've never been that enthusiastic about OO but I've recently become a convert
to a particular case. Perl's CGI::Application module makes your whole website
a single class, and each page in that site is a method in the class. I believe
web.py is similar in idea. So rather than a folder full of scripts for each
page you just have a single script which contains the code for all the pages
of the site.

Having your whole site as a single class is convenient firstly as your
constructor can handle the code that's common to each page, though you don't
necessarily need OO to do this. Where this OO approach really shines thought
is that you can create a more general web site class such as an online shop,
and then subclass it for a particular instance of a shop for a client.

------
maxklein
This is typical. You, as well as Paul Graham, have gotten stuck in a certain
programming model, based on your experience. You have both lost the
flexibility of youth.

So, don't try to use pseudo arguments to say that object orientation is bad.
It's not bad, it's very good. Defend your style, but don't do it by attacking
our style. It's not politics here.

~~~
pg
OO programming may be older than you think. I was in my early twenties when I
first encountered it. At first (for about a year) I even believed in it. So
whether I'm right or wrong to dislike it, it's not simply because I'm old.

~~~
ralph
Axel Schreiner's book _Object Orientated Programming with ANSI C_ was
published in 1994 and OO easily predates that by a good few years in the
mainstream.

Schreiner is the German translation of Kernighan's books and this one is a
nice example of using a preprocessor for C, written in awk, to gradually add
OO to C so you can understand all the nuts and bolts under the hood of a
"native" OO language. English translation PDF available for download.
<http://www.cs.rit.edu/~ats/books/index.html>
<http://www.cs.rit.edu/~ats/books/ooc.pdf>

~~~
pg
More than a few years. This was the book that got everyone interested in OOP:

<http://www.amazon.com/dp/0201113716>

As the name suggests, the language it describes was developed in 1980.

~~~
ralph
I said "in the mainstream", not academia. I'm talking about when personnel
departments heard of it and when marketing departments started labelling
everything OO.

~~~
weel
Symbolics was advertising their FLAVORS object oriented system in the mid-80s.
And Symbolics was, literally, the first dot-com.

[http://smbx.org/index.php/index.php?option=com_content&task;=view&id;=18&Itemid;=76](http://smbx.org/index.php/index.php?option=com_content&task=view&id=18&Itemid=76)

~~~
ralph
You're bringing up a pioneer in the commercial world of OO, I'm talking about
suits using the term OO without knowing what the letters stood for.

------
keiretsu
i hate OO programming because of inheritance. It pissed me off to have to look
through layers and layers of parents to search for a method. Stick with good
ol' functions for easy debugging.

~~~
palish
Except you can't have just functions, because then you end up with a semi-
object system anyway. For example, you might have a function "dot" which puts
a period at the end of a string, and a function "dot" which returns the dot
product of two vectors. The first should be a string method, and the second
should be a vector method. Without an object system, you'd call it dot-string
and dot-vector, which is okay, but semi-object-oriented. Lisp has something
that specializes functions based on its first argument.. That might be useful
for that.

~~~
asb
I disagree. A language without OO can allow code to be organised in an
intelligent way by providing a module system. See Standard ML as (what I
consider to be) a good example of this.

~~~
keiretsu
i agree. i'm using a module system myself and it's way better than OO

~~~
Tichy
How can it be better, it seems to me that a module system would be a subset of
an OO system? So logically it can't be better, if you are not forced to use
all features of the system.

