Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

OOP is common sense

Name: Anonymous 2012-11-14 7:22

For my first 20 years in this business, I created non-OO solutions because... well... the OO stuff wasn't mainstream enough for me to get at it.

For the last 10 years, I've been creating OO solutions because it's easier.

Programming is hard. It's a knowledge capture exercise. You're encoding knowledge in a programming language. The presence of OO languages, non-OO languages, functional languages, procedural languages, declarative languages says that no single language is ideal across all problem domains.

Sometimes you find yourself doing something complex in a not-so-OOP language and it's hard. Perhaps because non-OO languages actually are harder to work with. OO is just common sense encapsulated.

If you read enough non-OO code, you can learn enough non-OO design patterns that will allow you to work around the limitations of non-OO languages. Most good non-OO designers tend to use a lot of OO features but they're forced implement them in a non-OO language. And some of them gripe that they're not doing OO. Actually, they are, they just aren't using an OO language to implement their OO design.

Folks gripe about OO. Here's the standard litany.

1. It didn't/doesn't deliver on the "promise". Often they cite reuse as the promise of OO. The issue is that "reuse" isn't clearly-enough defined. Inheritance is the primary method of reuse in OO programming. Write it once and all subclasses reuse it. Other reuse may or may not happen and OO has little to do with that.

2. They have an example of egregiously bad OO design. Yep. And there are egregiously bad non-OO designs, too. Bummer on the "some people can't code" thing. I'm not sure I'd indict the approach because of someone abusing it.

3. They cite historical precedent: "Lots of good code was once written without OO". Yep. Lots of good code was written prior to compiled languages. Indeed, lots of good code was toggled in on the front panels of computers that didn't boot from disk drives. And, lots of good mathematical procedures were done with slide rules. And lots of good stuff was done with paper and pencil.

4. They find flaws in the single-inheritance model of Java. Yep. The real world seems to be multidimensional. Which means we either need multiple inheritance, or we need slightly smarter design patterns (like Strategy or Composite) to cope with the complexity of the real world.

5. They find examples of OO practice in a non-OO context and say "see, OO didn't help here." For example, the C libraries often encapsulate opaque data structures behind a well-designed set of method functions, very much like C++, but without the formalisms. This isn't an indictment of OO -- indeed, the encapsulation and library structure is OO, it just happens to be done "the hard way" without inheritance or language support. That doesn't detract from OO, it only says that there are multiple ways to implement an OO design, including non-OO programming languages.

6. They deprecate OO languages as syntactic sugar. This is point 2 -- you can find shoddy OO design. You also find shoddy non-OO design. Any tool can be abused. Abuse isn't inherent in OO.

Some folks claim OOP is all fluff without substance. Then, they design a clever library of related functions that encapsulate a data structure and use function pointers to allow someone else to extend the library by adding new features. OO done the hard way, gotta love folks who like to make a hard job harder.

Name: Anonymous 2012-11-14 7:55

For my first 20 years in this business, I created non-OO solutions
Nice way to make me stop reading prematurely, ``faggot''.

Name: Anonymous 2012-11-14 8:01

OOP is shit. The only saving grace it has is its namespacing feature. Other than that, it's 99% unnecessary beyond the scope of GUI programming.

Prove me wrong, Le ``faggots''

Name: Anonymous 2012-11-14 8:42

4. They find flaws in the single-inheritance model of Java. Yep. The real world seems to be multidimensional. Which means we either need multiple inheritance, or we need slightly smarter design patterns (like Strategy or Composite) to cope with the complexity of the real world.

i.e. First class functions and modules, instead of making your code brittle with inheritance, single or otherwise.

And that sums up why OO-design is mostly wankery, and the rest is independent of the brand name.

IHBT

Name: Anonymous 2012-11-14 9:08

I can create any kind of abstraction I want with first class procedures, objects just limit my choices.

Name: Anonymous 2012-11-14 14:23

>>5
You must be a coffeescript user. Congratulations!

Name: Anonymous 2012-11-14 14:25

>>2
Are you implying that businesses are not allowed to use software that solves problems for them?

Name: Anonymous 2012-11-14 14:32

https://plus.google.com/101960720994009339267/posts/hoJdanihKwb

"oop sucks my dick" -- rob pike, early unix pioneer, inventor of go, plan 9, progenitor of X11

Name: Anonymous 2012-11-14 14:34

>>8
"uriel delarge sucked my dick. RIP." --rob pike, plan9 faggot.

Name: Anonymous 2012-11-14 14:36

OOP will be useful when it is ubiquitously compatible on a world wide scale, a single OOP standard for all interfaces. If you do not have that, OOP is just as useful as a bunch of completely incomprehensible alien worlds that makes no sense to us, a C++ objects on one computer to another, Caml to Java, Erlang to CLOS. It's all a heap of useless nonsense ~ in an object oriented problem domain'.

Name: Anonymous 2012-11-14 15:00

>>10

we have that. it's called modules.

from mydick import goy as oop
var get = require('request').get

no need for classes

Name: Anonymous 2012-11-14 15:03

we have that. it's called anii, no need for vaginas.

Name: Anonymous 2012-11-14 15:05

['these', 'are', 'modules'].forEach(function(d) { global[d] = require(d) })

//god language

Name: Anonymous 2012-11-14 15:06

>>10
So, a bit like communism huh

Name: Anonymous 2012-11-14 15:25

>>12
I'm pretty sure you mean ``ani", you degenerate faggot.

Name: Anonymous 2012-11-14 15:32

As much as I feel OOP to be mostly unnecessary, the majority of what I wrote is OO style as described by OP.

It it also firmly tied to my programming mind and don't think I'm able to make non-OO designs.

Why I really hate about OO is how it seems to distract people from the true semantics of problems like just functions would expose.

Name: Anonymous 2012-11-14 16:48

OO is useful in C++ and whatnot, but really redundant in dynamically typed languages with decent built in data structures like Python

Name: Anonymous 2012-11-14 17:24

Why are function pointers worse than inheritance OOP bullshite? You're begging the question. If anything, going the OOP way just complicates things.

Name: Anonymous 2012-11-14 17:45

Smalltalk did it right.
All I want extra is for a method to know the caller as well as the this. Then it's true objects.

Name: Anonymous 2012-11-14 18:14

Inheritance and public/private modifiers are the devil.
I was actually impressed at Go's manifesto for doing OO in a sane way.

Name: Prog 2012-11-14 18:58

>>1,14
Programming is hard.
That is your first problem.

The second is that you do not conform to Standards, and barely audit other classes/objects. You should be ashamed of not reviewing your code, re-auditing it, rewriting, optimizing, and repeating, until you have the code of the universe that solves that one abstract problem.

Did I mention, you OOP-g\\ys make at the leas 10 copies of the same shit. It's like you did not go to DRY-101 or KISS-202 class.

PS
Worse is better, hurr durr

Name: Anonymous 2012-11-19 15:19

dubs are common sense

Name: Anonymous 2012-11-20 9:03

I think in OOP.

When I want to exit the room, I never:
- go to the door,
- open it,
- walk outside.

Instead I do (much superior):
- self.go(door)
- door.open()
- self.go(self.getLocation().getOutside())

OOP is very natural to how people (including me) think!

Don't change these.
Name: Email:
Entire Thread Thread List