• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

OOP Is Much Better in Theory Than in Practice

 
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Gerald Davis:
I mean the pen and paper kind of algebra. Would it be an improvement to add object oriented features? Isn't object orientation so good that non programmers should use it to represent their notation, instead of using function michines.



I don't know what that means. OO, to me, is mainly about polymorphism, about the way code is structured. It is *not* about a kind of notation.


Personally, I have not seen Smalltalk arithmetic, but I am sure it is non standerd and there would be a learning curve for maths specialists.



Sure you have seen it - in my post above. "1/3" is a Smalltalk term - it is sending the message "/" with the argument "3" to the object "1".

Mixing object oriented features with domain spacific data only complicates thing, no?



Not sure what you are getting at here. Care to elaborate?
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by M Beck:
several languages have that property. Python may be the most commonly used such, assuming Perl doesn't have it also. (i've frankly forgotten most of the Perl i used to know.)



Yes. Python, of course, is an OO language, too. And I actually wasn't arguing that only OO makes that feature possible, but that OO lets you integrate that feature very elegantly.

Smalltalk wasn't the only (or the first) language to manage exact fractional numbers, either - the Lisp dialects did, too. in fact, having what Lisp aficionados refer to as a "full numeric stack" is one of those languages' nicest features, one that few other languages currently in common use share.



I like Lisp, though I didn't yet use it. It's a very elegant and powerful language. And it comes with a quite nice OO extension, as you might know.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by M Beck:
ideas about OOP



I agree that OO isn't well defined. So isn't the term IDE. Still I find both to usefull.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I liked "All you can do is send a message (AYCDISAM)" line. I think it's a real shame we didn't keep the "send a message" language. "Call a method" is way too much like "call a function". Sending messages seems to steer you toward commanding objects to do things instead of asking them for data.
 
blacksmith
Posts: 1332
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Udayan Patel:

Seriously, what is the point of discussing this? isn't it true that OO technologies are dominating market? Why VB went away? Why PB went away? even though they were considered "OO languages".

It depends on what you mean by "object oriented".

I believe that languages like ANSI C++ and Java have been successful because of some very specific features: namespace organization (with classes generally being the namespaces), and data hiding (being able to hide data structure implementation from code outside those namespaces).

Languages like Smalltalk, that are what the real "object oriented" aficionados think of as object oriented, have yet to have any significant impact on the industry as a whole. It's questionable whether they ever will.
 
Warren Dew
blacksmith
Posts: 1332
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
M Beck:

now to heat up this flamewar a little more - what say i throw in some links to Paul Graham's ideas about OOP and Java?

Looks like the four years since the latter essay was written have proven than Graham's "hacker's radar" was picking up a lot more ground return than signal!

Then again, what can you expect from a radar that was hacked together rather than carefully designed....
[ February 12, 2005: Message edited by: Warren Dew ]
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Warren Dew:
I believe that languages like ANSI C++ and Java have been successful because of some very specific features: namespace organization (with classes generally being the namespaces), and data hiding (being able to hide data structure implementation from code outside those namespaces).



I think they have been successful because they were similar in syntax to already existing languages with a big following. A big part of the code produced in that languages actually is quite ugly and doesn't use the provided features to the advantage it could give.

BTW, Smalltalk has even stronger data hiding than both C++ and Java - all fields are automatically private.
 
Ranch Hand
Posts: 872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OOP success is mostly down to good commercialisation and as we know commercialism a great system for creating wealth. Sometime it does this by hiding the truth from us, and mind washing us. Object Orient is an industry in its own right, and it needs to make money.

It�s not how good something is but how it sells and how profitable it is. Smalltalk is a much better language to Java, but it was java that prevailed.

What applies to application development also applies to many things. People will tend sell you things they can make money with and the free product is forgotten about.

Example: In the drug store there are many medicines available but the most useful all-purpose medicine is not available or not even commonly known as a medicine. That is drinking your own urine. You bet if it was profitable everybody would know about it.

http://www.shirleys-wellness-cafe.com/urine.htm
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I definitely prefer Java to urine.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Stan James:
I definitely prefer Java to urine.



ROFL
 
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Gerald Davis:

What applies to application development also applies to many things. People will tend sell you things they can make money with and the free product is forgotten about.



I can't remember the last time I sent my check in for programming in Java (as I write this using the free firefox(free) web browser). In a few minutes I'm going to fire up OpenOffice(free) to finish my review for work. After that I'll be using eclipse(free) to work on some personal projects, which I host on a cvs(free) server (I haven't made the move to subversion(free) yet, but that will come). A couple of my apps hook up to MySQL(free). One of these days I'll get off my lazy but and get Bugzilla (free) to manage bugs for my projects.

Oh, and I stopped reading the urine link when it said:

and which is capable of curing a host of diseases ranging from common cold to cancer and arthritis to AIDS,

:roll:
 
Warren Dew
blacksmith
Posts: 1332
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ilja Preuss regarding C++ and Java:

I think they have been successful because they were similar in syntax to already existing languages with a big following.

I would agree with that being part of the explanation for Java; its similarity to C++ was no doubt a big factor in its rapid adoption.

However, it doesn't explain why C++, with its C like syntax, won out over Ada, with its Basic like syntax. Basic had a substantially larger following than C.

For that matter, it doesn't explain why people switched from C to C++. C had an even more C-like syntax than C++ did.

A big part of the code produced in that languages actually is quite ugly and doesn't use the provided features to the advantage it could give.

True in any production language. Show me a language for which this isn't true and I'll show you a language that is largely used only in academia, and not for big commercial projects done on excessively tight deadlines.

BTW, Smalltalk has even stronger data hiding than both C++ and Java - all fields are automatically private.

To clarify, I think that people transitioned from C and other purely procedural languages to C++ and Java because there were features that permitted, but did not force, them to use good namespace organization and data hiding. This allowed programmers to stick with their old habits in situations where those old habits were adequate, and use the new features only when it was obvious that there was a big payoff in using them.

Now, I personally keep all data private in any language that permits me to do that. I also think polymorphism is a powerful tool and use it with moderate frequency.

However, I also realize there's a difference between a language that's perfect for me and a language that's likely to gain widespread acceptance. I actually agree with Paul Graham that Java was designed with mediocre programmers in mind - I think what he failed to see was that there are so many mediocre programmers out there that a language that actually allowed them to be at all productive was a practically guaranteed win over yet another language that only crack programmers could handle safely.
 
Gerald Davis
Ranch Hand
Posts: 872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Opens source, I knew you would bring it up. I am working on an open-source application, my motive for doing this is to get better job. What makes software unique is you can give it or sell it and still own it. You cannot do that with a car.

While there is money to be made their will always be company selling complicated technologies and methodologies.

�If you want good code reuse, make methods smaller and independent� that�s all there is to it. I can see that if you�re into system design you would get bored of a book if it had only these words.

You�ve seen the Javaworld link I showed you about how OOD fails in the reuse department.
 
Gerald Davis
Ranch Hand
Posts: 872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok ok, the urine therapy, is a bit of a fallacy simply because if urine was so good for health, the body would reuse it internally and all the popular religions would have taken it up for health reason much like the way they have taken up fasting. Indeed I become so skeptical that I searched for a site that agreed with me.

The terrible thing is many Object Oriented Purists never read or understand the view of the Object Oriented skeptics. Indeed I would be happy if I found an Pro Object Oriented website that tries to dispel Anti Object Orientation benefits as a myth the same way that Anti Object Orientation site dispel Objection Orientation benefits as a myth. Could anyone direct me to such sites?
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to point out I don't use OO because I read anything wonderful about it. I reject the notion that I've been brainwashed by marketing. It offers good ways to organize my code that work for me. I've made my living with a half-dozen procedural and hybrid languages, made myself productive, did work I was proud of, gave the company value, all that good stuff.

There is a lot of BS out there about objects. I turn off anybody who makes wild promises about quality, productivity, reuse. We had some trainers come in and say "everything you knew before today is wrong" and they were idiots and jerks. I'm not the least bit closed to arguments about good procedural programming. At a certain level of private code within objects I still conciously use functional decomposition. But most of the time objects give me more of the good things that good procedural thinking gave me.

It works for me. At least stop telling me it doesn't.
 
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OO has some great advantages, and i find myself using it more and more the more i learn about it; using classes to create small datatypes, singleton classes to organize related information, and so on. (i'm still procedural enough that i often use the equivalent of globals to store, say, configuration data. but these days, i stuff such data in a singleton class and pass that one instance around as an argument, when before i might have used true globals.)

but i do get a bit miffed at Java specifically for forcing me to write everything as classes. sometimes that's just overhead, when the task is small and only some parts of it really benefit from an OO organization. that's the sort of time when i find myself agreeing most strongly with Paul Graham, that a language designed for mediocre programmers can sometimes serve only to hold you back. i'm not claiming that i'm any more than mediocre; i just think that "mediocre" for me might have a different meaning, a different shape, than "mediocre" for James Gosling, so occasionally parts of my mediocrity end up chafing against the limits of Java's mediocrity.

assuming that that makes any sense at all, that is.
 
Gerald Davis
Ranch Hand
Posts: 872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on my first true first application since I have turned an object oriented sceptic. The first thing I did while creating it was to use only procedures and containers (array, list, tables, dictionaries).

Then I would add features then refactor. Refectoring sometime comprises of creating my own classes but I will only do this make code better if the benefits are clear. In my application, to manage events, I first used functions but the application was suffering from too many module level variables so I converted it to class for simplicity. My approach is to only move functionality from functions into instance methods only if necessary.

I have learned to appreciate how simple functions can make a program. A functions has one entry and one exit so abusing it is nearly impossible it just has one simple role. Low level functions combined to make higher level function; function decomposition.

For you who haven�t read the Javaworld link http://www.javaworld.com/javaworld/javatips/jw-javatip107.html
[ February 14, 2005: Message edited by: Gerald Davis ]
 
Warren Dew
blacksmith
Posts: 1332
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
M Beck:

but i do get a bit miffed at Java specifically for forcing me to write everything as classes. sometimes that's just overhead, when the task is small and only some parts of it really benefit from an OO organization.

In an approach similar to stuffing formerly global data into singletons, you can put formerly global functions into a class of static functions. If the task is really small, you can use only one class, and treat that class as your application's "global" namespace.

that's the sort of time when i find myself agreeing most strongly with Paul Graham, that a language designed for mediocre programmers can sometimes serve only to hold you back.

I have to say that the prohibition against global data and functions is perhaps the aspect of Java I like best. For any except the smallest applications - say, less than ten lines - the costs of polluting the global namespace greatly outweigh the costs of keeping things in classes or other namespaces.

This is particularly true on a team. Each programmer may think that he can keep straight all the functions and data he personally is adding to the global namespace, but even if he's right - which in my experience is far less often than he thinks he's right - he's not going to be able to keep straight the thousands of functions and variables added by the other nine programmers. A team of programmers dumping things into the global namespace quickly becomes a quagmire.

In this case, Java's rules not only protect the inexperienced programmers from themselves, but also protect the more experienced programmers on the team from the inexperienced ones. A crack programmer will know better than to pollute the global namespace, but can still be dragged down by other team members who don't know as much (and don't realize what they don't know). Java helps prevent inexperienced programmers from making newbie mistakes like this, allowing the experienced programmers to spend more of their time coding rather than fixing or working around the inexperienced programmers' newbie mistakes.
[ February 14, 2005: Message edited by: Warren Dew ]
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Gerald Davis:
I have learned to appreciate how simple functions can make a program. A functions has one entry and one exit so abusing it is nearly impossible it just has one simple role. Low level functions combined to make higher level function; function decomposition.



In my experience, object decomposition has a similar benefit - a small class with only a very focused responsibility is also nearly impossible to be abused. And low level objects can be combined to higher level objects in a more abstract way (through the use of interfaces), to increase reuse. But I think we already had that discussion...
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Stan James:
I have to point out I don't use OO because I read anything wonderful about it.



I think I *tried* OO because of what I read. I tried for some time, didn't experience the benefits that I had read about and wondered wether I was just too dumb, or wether there was nothing behind the hype.

The I read authors like Martin Fowler, Kent Beck, Robert C. Martin. They seemed to have similar doubts about the typical OO hype, but on the other hand presented benefits of OO that somehow seemed to make sense to me. I tried some of their tips and practices and they actually worked! That was when I became a "convert".
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Gerald Davis:
The terrible thing is many Object Oriented Purists never read or understand the view of the Object Oriented skeptics. Indeed I would be happy if I found an Pro Object Oriented website that tries to dispel Anti Object Orientation benefits as a myth the same way that Anti Object Orientation site dispel Objection Orientation benefits as a myth. Could anyone direct me to such sites?



With all due respect, in my experience many OO "purists" read quite a lot of the anti-OO stuff.

Regarding dispelling Anti OO myths, I actually don't care enough to invest the *massive* amount of time to do so. I just wouldn't gain enough in doing so; and I'm not even convinced that it would help *anyone* (other than answering with even more anti-OO stuff).

I happily discuss specific details you'd like to raise here, though, as you might have noticed.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Warren Dew:
However, it doesn't explain why C++, with its C like syntax, won out over Ada, with its Basic like syntax. Basic had a substantially larger following than C.



Well, I guess this can be explained by the fact that the Department of Defense isn't really geeky in any way...


For that matter, it doesn't explain why people switched from C to C++. C had an even more C-like syntax than C++ did.





A big part of the code produced in that languages actually is quite ugly and doesn't use the provided features to the advantage it could give.

True in any production language.



Yes. Which just "proves" that ability to write clear code probably isn't of very high marketing value...


BTW, Smalltalk has even stronger data hiding than both C++ and Java - all fields are automatically private.

To clarify, I think that people transitioned from C and other purely procedural languages to C++ and Java because there were features that permitted, but did not force, them to use good namespace organization and data hiding. This allowed programmers to stick with their old habits in situations where those old habits were adequate, and use the new features only when it was obvious that there was a big payoff in using them.



I'd rather say that it allowed them to use a new, hip language, without having to learn something new until they gradually became ready to - if at all.

However, I also realize there's a difference between a language that's perfect for me and a language that's likely to gain widespread acceptance.



Yes. I think that is part of the point I tried to make: that Java is more wide spread than Smalltalk doesn't mean that Java is the language with the better benefits, but just that people felt more comfortable learning it.
 
Gerald Davis
Ranch Hand
Posts: 872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ilja Preuss:


With all due respect, in my experience many OO "purists" read quite a lot of the anti-OO stuff.

Regarding dispelling Anti OO myths, I actually don't care enough to invest the *massive* amount of time to do so.



That is good but I wish they would create a website on the subject.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Gerald Davis:


That is good but I wish they would create a website on the subject.



Well, If you like you could start a DispellingAntiOoMyths page on the FAQ, insert some anti-OO stuff you'd like to have comments on and see wether someone likes to reply...
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm fairly sure I'll live to regret this, but I started trying to respond to some of the stuff on Tablizer ... see if this is useful at all ...

http://www.surfscranton.com/architecture/oopbadbad/Response.htm

It's not linked from anywhere but right here right now, probably will only be temporary. Sorry it's not on a Wiki where we could discuss it directly in place.
 
Gerald Davis
Ranch Hand
Posts: 872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have skimmed through a few pages and it looked like good stuff. When I come back from borders I will have a nice good read.

Originally posted by Stan James:
I'm fairly sure I'll live to regret this, but I started trying to respond to some of the stuff on Tablizer ... see if this is useful at all



No need to regret sa!, I am sure that many anti OOP geeks, who was purists at one time, have more respect of those who made the effort to learn OOP and design patterns then those procedual programmers who cannot be bothered or ignorant to those technologies.
[ February 21, 2005: Message edited by: Gerald Davis ]
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Stan James:
http://www.surfscranton.com/architecture/oopbadbad/Response.htm



As far as I know, the real name of "Tablizer" is Bryce. He is known as "Topmind" on comp.object - googling should give you thousands of hits...

More later.
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, the TopMind page on Ward's Wiki is a good place to lose a few hours of your life. I'll probably remove my attempts at this and let the world move on.
 
Get off me! Here, read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!