Page 4 of 8

Posted: Sat Sep 30, 2006 9:20 pm
by utopiomania
Trond wrote:
Can you, instead of simply saying that OOP is better, say what with OOP that is better?
It's better in that it works the way we (humans) think.

Think about your Car. It's a car with properties (color) and methods (move). As simple as that.

Posted: Sat Sep 30, 2006 9:33 pm
by Trond
utopiomania wrote:Trond wrote:
Can you, instead of simply saying that OOP is better, say what with OOP that is better?
It's better in that it works the way we (humans) think.

Think about your Car. It's a car with properties (color) and methods (move). As simple as that.
It may model the way you think, but I definetely don't think like that. I've got a car. The car doesn't have wheels, wheels are part of the car. Without everything it consists of, it's nothing. In an OOP world it will be an empty class (named car). This is a fundamental difference, and here OOP is closer to the way you (and probably most people) think, but here procedural is closer to reality and the way I think. This doesn't mean OOP is better, this means it suits you better (which I don't doubt since you advocate it.)

My car doesn't have the method move, the method move is a generic action not specific to any object (or even not restricted to objects) that can also act on a car (since it can act on everything).

Edit: Another example.
You and OOP say:
It's a brain. So we can assume it has the method think.

I say:
It performs the method think (which is a global method - anything can perform it). So we call it a brain.

I think my way models the real world better.

Posted: Sat Sep 30, 2006 10:00 pm
by u9
Trond wrote:And if "even the primitives are implemented as objects" then what are they made of? Other objects? And what are these made of? Other objects? And what are these made of? Other objects? And what are these made of?
Now first of all why are you so interested in talking about purely object oriented languages? Do you think you have found a hole in the definition of OOP? I assure you the poor abstract-thinking nerds that come up with such definitions can help you on your abstract way.

Now lets get back to the real world. It might be difficult, but what do you imagine might be a member of an integer object? An integer maybe? Though it is a waist of time explaining this too you, let me try. Consider the primitives as the "smallest" (simplest) type of object in a purely object oriented language. These are defined by the language e.g. integers, floats, Booleans (and strings some might argue.) A language is considered pure if (along with the other requirements) these primitives are implemented as objects. This is why Java is not accepted as a pure OO language. So now you know! An integer is still an integer (only maybe with some methods.)
Trond wrote:Can you, instead of simply saying that OOP is better, say what with OOP that is better?
I'm sure I have stated this in a previous post. So I guess you must be running out of arguments or you are just arguing for the sake of arguing. But to add to my previous post, I can say that modeling the real world all the way through the development process using objects has advantages, among others it provides a level of abstraction which is maintained through out the process.

I would like to use this opportunity to correct my previous post a bit. OOP is not a necessity in all fields of computer science and software engineering. But it's advantages really come into play in user applications. Embedded systems might not see as much benefit form OOP often due to the scale of such projects.

I would also say I prefer something with more freedom such as C++ over Java or C# because it gives me exactly that... freedom. But if I wanted to cut development costs I would choose a restricted language such as Java or C# because it (to some extent) enforces nicer code.

Posted: Sat Sep 30, 2006 10:21 pm
by u9
I have to say something about the poor car. This is always what is brought up when explaining OOP.

The idea is that you have different levels of abstraction. You can consider the car as a whole providing some functionality... or as the sum of its parts. Do you need to know that the car has wheels, engine, gearbox etc. in order to use it? No. You can "move" your car with out knowing the underlying mechanisms achieving such the goal (of moving you from one location to another). This is called encapsulation.

At a lower level of abstraction you can consider the car as consisting of wheels, engine etc. Maybe when implementing the car you are constructing it from wheels, engine etc. without knowing how these things are built. I mean you can use an engine even though you don't know that it is made of pistons, bearings, cylinders etc.

Does any of this make sense?

When one says "this is the way humans think" I guess one is considering the mainstream. We all have different presuppositions... this is why we are having this discussion. My intent in posting here is that I just didn't want anyone to leave this thread thinking that OOP is worthless... I wanted to state its importance in the industry.

Posted: Sat Sep 30, 2006 10:24 pm
by Trond

Code: Select all

I'm sure I have stated this in a previous post. So I guess you must be running out of arguments or you are just arguing for the sake of arguing. But to add to my previous post, I can say that modeling the real world all the way through the development process using objects has advantages, among others it provides a level of abstraction which is maintained through out the process. 
I must say that modeling the real world all the way through the development process has advantages, but objects does not model the real world very well. Abstraction is fundamental to all successful programming, it's not limited to OOP.

Let me ask you: Have you ever used another procedural language than Basic or C (which are very similar apart from the obvious high/low-level difference)? If not, you're really doing as you said we shouldn't: Judge a language.

One of the heavy OOP-things is code re-use. Units in Pascal (without objects) gives me exactly that. I turned a compiler into an expression evaluator by deleting one unit, changing one unit and keeping the six remaining units unchanged.

A lot of OOP-things are very good, but are not a property of OOP but rather of the language and implementation of the programming paradigm.

Edit:

Code: Select all

The idea is that you have different levels of abstraction. You can consider the car as a whole providing some functionality... or as the sum of its parts. Do you need to know that the car has wheels, engine, gearbox etc. in order to use it? No. You can "move" your car with out knowing the underlying mechanisms achieving such the goal (of moving you from one location to another). This is called encapsulation. 
... and is not exclusive to OOP. Encapsulation is fundamental in the totally procedural pascal (or any language) if you want your program to be maintainable, extendable and readable. The difference is how encapsulation is performed or enforced.

Code: Select all

When one says "this is the way humans think" I guess one is considering the mainstream. We all have different presuppositions... this is why we are having this discussion. My intent in posting here is that I just didn't want anyone to leave this thread thinking that OOP is worthless... I wanted to state its importance in the industry.
OOP isn't worthless, in many cases it can be used with great success. It's just that I'm sick of listening to OOPers who present "OOP" concepts that are actually fundamental to procedural programming, and that they haven't understood such means that they should learn procedural programming better before they say it's bad. So I trigger a bit quickly.

But OOP isn't at all worthless.

(But FORTRAN sent man to the moon.)

But now its
10 Goto bed ; See? Encapsulation and abstraction of the memory address even in such a simple statement

Bottom line: OOP has some good uses, but it's not "better" or "ingenious" for absolutely all scenarios. At least I agree with that, put your own bottom line below mine if you want to!

Posted: Sun Oct 01, 2006 9:17 am
by u9
Trond wrote:(But FORTRAN sent man to the moon.)
Hehe good one (y)

Posted: Sun Oct 01, 2006 3:45 pm
by rsts
Well, if a procedural oriented bloak wanted to test the waters of the OO world, what language would you recommend he or she try? They would prefer something with capabilities at least equal to PB - e.g.

- Very fast compiler which creates highly optimized executables
- No external DLLs, runtime interpreter or anything else required when creating executables
- Access to full OS API
- Dedicated editor and development environment
- Integrated debugger to easily trace programming bugs.

Something I could use as a reasonable comparison.

Oh yes, somewhat affordable too :)

cheers

Posted: Sun Oct 01, 2006 5:12 pm
by Kale
rsts wrote:Well, if a procedural oriented bloak wanted to test the waters of the OO world, what language would you recommend he or she try? They would prefer something with capabilities at least equal to PB - e.g.

- Very fast compiler which creates highly optimized executables
- No external DLLs, runtime interpreter or anything else required when creating executables
- Access to full OS API
- Dedicated editor and development environment
- Integrated debugger to easily trace programming bugs.

Something I could use as a reasonable comparison.

Oh yes, somewhat affordable too :)

cheers
Aurora

http://en.wikipedia.org/wiki/Aurora_%28 ... anguage%29

Posted: Sun Oct 01, 2006 5:22 pm
by rsts
Many thanks for the response. I should have thought of that one :oops:

Now, given Paul's track record, if I add the caveat - "likely to be around and supported for a while" - what would your recommendation be?

cheers

Posted: Sun Oct 01, 2006 6:35 pm
by Kale
rsts wrote:Now, given Paul's track record, if I add the caveat - "likely to be around and supported for a while" - what would your recommendation be?
Paul is not the only developer in the Aurora team. I'm a partner developer along with nine others, Paul is the lead. So you can see it's future is quite safe. ;) Plus, Pyxia's downfall was not Paul's fault or even anything to do with Paul.

Posted: Sun Oct 01, 2006 6:41 pm
by Trond
Aren't there any free?

Posted: Sun Oct 01, 2006 6:55 pm
by White Eagle
Aren't there any free?
KBasic is OOP and has a free version.

Posted: Sun Oct 01, 2006 7:01 pm
by Trond
White Eagle wrote:
Aren't there any free?
KBasic is OOP and has a free version.
The free version can't even create exe files.

Posted: Sun Oct 01, 2006 7:07 pm
by Kale
White Eagle wrote:
Aren't there any free?
KBasic is OOP and has a free version.
Very nice! I might get out my credit card. :) x-platform Win/Linux/Mac.

I've also found this:
http://www.objective-basic.com/

Posted: Sun Oct 01, 2006 7:11 pm
by White Eagle
The free version can't even create exe files.
That is a common limitation for free/trial versions of programming languages.