Fuel for you OOP non-believers...

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Post 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.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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.
u9
User
User
Posts: 55
Joined: Tue May 09, 2006 8:43 pm
Location: Faroe Islands
Contact:

Post 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.
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein)
http://www.wirednerd.com
u9
User
User
Posts: 55
Joined: Tue May 09, 2006 8:43 pm
Location: Faroe Islands
Contact:

Post 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.
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein)
http://www.wirednerd.com
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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!
u9
User
User
Posts: 55
Joined: Tue May 09, 2006 8:43 pm
Location: Faroe Islands
Contact:

Post by u9 »

Trond wrote:(But FORTRAN sent man to the moon.)
Hehe good one (y)
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein)
http://www.wirednerd.com
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post 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
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post 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
--Kale

Image
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post 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
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post 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.
--Kale

Image
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Aren't there any free?
White Eagle
Enthusiast
Enthusiast
Posts: 215
Joined: Sun Jan 04, 2004 3:38 am
Location: Maryland

Post by White Eagle »

Aren't there any free?
KBasic is OOP and has a free version.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post 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/
--Kale

Image
White Eagle
Enthusiast
Enthusiast
Posts: 215
Joined: Sun Jan 04, 2004 3:38 am
Location: Maryland

Post by White Eagle »

The free version can't even create exe files.
That is a common limitation for free/trial versions of programming languages.
Post Reply