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.
I went to university starting 2004 for an electrical engineering degree, and our programming classes were basically structured around OO Java as a panacea.
Later in life, listening to the Berkeley SICP lectures made me realize what a joke the whole thing was.
I don't think Java OO zealots are a straw man. I think they're very common, and many of us are living in a happy Hacker News and startup bubble, where people we meet are surprisingly competent.
When I was at university (early '00) the default opinion was that OO is the way to go, and everything other is obsolete or esoteric.
I thought that way then, too. I remember complaining with my friends to teacher that he teaches us algorithms and data structures in procedural Turbo Pascal, when everybody knows it's obsolete, and we should be doing everything in C++ or Java. Yeah, I was clueless, and that particular prof. was right.
But most teachers were OO fundamentalists, and it was assumed everything should be OO. One stupid exercise - design system to keep data about students and teachers on university, using OO.
And the answer was obviously - Student and Teacher class extending Person class. No matter that sometimes people are studying on 2 facoulties, sometimes Student is also a Teacher, or becomes Teacher after he graduates. And when we could use relational DB, it was always with ORM, because objects are needed in any modern system.
You should get interviewed for enterprise jobs sometime. It's all about objects, patterns and lots of factories... some times makes me wonder if we intentionally make stuff complex to find meaning in what we do.
Go to LinkedIn, search for Java in jobs around you, find the ones that look more boring and apply. Enjoy the perplexity when you offer a non-OO solution to a problem.
There are a lot of people who think like this. It does seem to be more enterprisey people generally who are working with large older codebases. I'm not sure how many people would design a product from ground up only using Java today.
Sometimes it's hard to convince them that even particular OO-flavor is not the end of the road.
C++ - guys thinking that OO in C++ is the best, java-guys thinking that extensions methods ruins OO in C#, all of them looking with horror in python. (Where's my private and protected??)
I was a total Java zealot from about '95 to about '00 when I was pretty much your standard architecture astronaut in a startup environment (back when Java was "cool").
So what you're saying is you are too young to have a real opinion about the article because you don't have enough experience. Instead you invent a strawman to attack some other alleged strawmen
I work with one, it isn't hard to get him to start the this isn't OO it is complete and utter crap routine. To be fair to him though we just inherited a large code base of low quality. He turns out good code, but is mostly a 501 programmer.
Almost all of the observations you read on programmer blogs are summarized in this academic piece - http://www.theonion.com/articles/sociologist-considers-own-b... [Aside - I had a faint memory of that article, having only read it when it first came out, but managed to find it via a domain-filtered search with cognac and trend, the only two words I could remember from the article. Thought that memory cluster was humorous]
Usually it's someone responding to some personal issue with a public post. Perhaps they argued with a peer.
I also found it to be a serious mental bender to see OO and Java called "new", relative to "old". In most programming groups Java is the new Cobol, considered anything but new. Often it is a legacy language.
>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.
Strange, because I have met many of them.
As well as many VB jockeys, who would look at you with a blank stare if you mentioned either OO or functional programing.
"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.
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.
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.
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.
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).
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!
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...
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.
"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.
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.
[+] [-] marcusf|14 years ago|reply
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.
[+] [-] reitzensteinm|14 years ago|reply
Later in life, listening to the Berkeley SICP lectures made me realize what a joke the whole thing was.
I don't think Java OO zealots are a straw man. I think they're very common, and many of us are living in a happy Hacker News and startup bubble, where people we meet are surprisingly competent.
[+] [-] ajuc|14 years ago|reply
I thought that way then, too. I remember complaining with my friends to teacher that he teaches us algorithms and data structures in procedural Turbo Pascal, when everybody knows it's obsolete, and we should be doing everything in C++ or Java. Yeah, I was clueless, and that particular prof. was right.
But most teachers were OO fundamentalists, and it was assumed everything should be OO. One stupid exercise - design system to keep data about students and teachers on university, using OO.
And the answer was obviously - Student and Teacher class extending Person class. No matter that sometimes people are studying on 2 facoulties, sometimes Student is also a Teacher, or becomes Teacher after he graduates. And when we could use relational DB, it was always with ORM, because objects are needed in any modern system.
[+] [-] option_greek|14 years ago|reply
[+] [-] groovy2shoes|14 years ago|reply
[+] [-] rbanffy|14 years ago|reply
[+] [-] richbradshaw|14 years ago|reply
[+] [-] Ingaz|14 years ago|reply
Sometimes it's hard to convince them that even particular OO-flavor is not the end of the road.
C++ - guys thinking that OO in C++ is the best, java-guys thinking that extensions methods ruins OO in C#, all of them looking with horror in python. (Where's my private and protected??)
[+] [-] arethuza|14 years ago|reply
Totally reformed now - I hope.
[+] [-] epo|14 years ago|reply
[+] [-] stonemetal|14 years ago|reply
[+] [-] huggyface|14 years ago|reply
Usually it's someone responding to some personal issue with a public post. Perhaps they argued with a peer.
I also found it to be a serious mental bender to see OO and Java called "new", relative to "old". In most programming groups Java is the new Cobol, considered anything but new. Often it is a legacy language.
[+] [-] batista|14 years ago|reply
Strange, because I have met many of them.
As well as many VB jockeys, who would look at you with a blank stare if you mentioned either OO or functional programing.
Maybe you should work in bad companies more ;-)
[+] [-] fauigerzigerk|14 years ago|reply
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|14 years ago|reply
[+] [-] swalsh|14 years ago|reply
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|14 years ago|reply
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.
[+] [-] seanmcdirmid|14 years ago|reply
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|14 years ago|reply
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).
[+] [-] rbanffy|14 years ago|reply
BTW, I learned to program on a Texas (TI-55) calculator. What symptoms should I be presenting? ;-)
[+] [-] minikomi|14 years ago|reply
[+] [-] officialchicken|14 years ago|reply
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|14 years ago|reply
Hail, Torat Exists, the holy teachings of the existential type!
[+] [-] 16s|14 years ago|reply
[+] [-] udp|14 years ago|reply
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...
[+] [-] v0cab|14 years ago|reply
[+] [-] stitchy|14 years ago|reply
[+] [-] guard-of-terra|14 years ago|reply
[+] [-] fauigerzigerk|14 years ago|reply
[+] [-] ericHosick|14 years ago|reply
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|14 years ago|reply