Fuel for you OOP non-believers...

For everything that's not in any way related to PureBasic. General chat etc...
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

The world is definently object oriented. Everything is inherited.
(Do you actually understand Danish when you come from the faroe islands?)
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

Wow. God codes in VB.NET!

:)

Awesome VR, but!
Dare2 cut down to size
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

:P
u9
User
User
Posts: 55
Joined: Tue May 09, 2006 8:43 pm
Location: Faroe Islands
Contact:

Post by u9 »

Dare wrote:Wow. God codes in VB.NET!...
Haha :P
thefool wrote:The world is definently object oriented. Everything is inherited.
(Do you actually understand Danish when you come from the faroe islands?)
Ja jeg bor i Herlev lige nu 8) Men alle færinge lærer dansk lige fra tredje klasse. Det jo også vores dronning :P
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
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

u9 wrote: Ja jeg bor i Herlev lige nu 8) Men alle færinge lærer dansk lige fra tredje klasse. Det jo også vores dronning :P
Ok :P
Vidste jeg ikke.. For jeg kan ihvertfald ikke forstå ret meget færøsk :)
mp303

Post by mp303 »

fsw wrote:This list is pretty old even if he updates it from time to time.

This guy generalizes too much for my taste.

His whole goal seems to be to promote HIS idea of the holy grail.

:roll:
yeah, really.

some of his examples are just completely ridiculous - like for example:

Code: Select all

NORMAL

  print(a + b)

BLOATED

  am = new math.ArithmeticManager()
  opA = new math.Operand((float) a)
  opB = new math.Operand((float) b)
  am.addOperand(opA)
  am.addOperand(opB)
  am.operator = new math.operators.Addition()
  am.executeMathOperation()
  system.io.output.print(am.mathOperationResult())
A wrapper class for math? That's completely asenine, no one would ever do that in real life. To even pull out an example like that, is just completely ridiculous - clearly this guy is a complete and total idiot, and just pulling arguments out of his ass.

A real-world example could have been a database wrapper class, for example. But then the comparison could have made OOP look pretty good.

I find most of his arguments and examples are proposterously hypothetical. I don't know how you can take anything seriously from someone who'd pull out an example like this.

Reminds me of that guy you see in movies, standing on a streetcorner, screaming "the end is nigh!" ;)

It's not only crazy - it's a complete waste of time. Like telling people to stop drinking beer, stop having sex, or submit to the "one true God". It's just not going to happen. ;)
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

mp303 wrote:
fsw wrote:This list is pretty old even if he updates it from time to time.

This guy generalizes too much for my taste.

His whole goal seems to be to promote HIS idea of the holy grail.

:roll:
yeah, really.

some of his examples are just completely ridiculous - like for example:

Code: Select all

NORMAL

  print(a + b)

BLOATED

  am = new math.ArithmeticManager()
  opA = new math.Operand((float) a)
  opB = new math.Operand((float) b)
  am.addOperand(opA)
  am.addOperand(opB)
  am.operator = new math.operators.Addition()
  am.executeMathOperation()
  system.io.output.print(am.mathOperationResult())
A wrapper class for math? That's completely asenine, no one would ever do that in real life.
At least not for a simple "print(a + b)".
Suppose he translated every thing to oop, just to show how ridiculus it is (and it backfired...).

But even a language like Ruby, where every thing is an object, has a cool math syntax.

---

But, on the object oriented math side, there are some situations where using intelligent classes could be beneficial, even in math.

Look here (NOT PureBasic):

Code: Select all

Declare Function GetTickCount LIB "kernel32" () As Long

defint r = 100000000
defint i, time1, time2, time3, time 4
DEFSNG f
DEFDBL d

time1 = GetTickCount()
For i = 1 To r
  f = f + 0.1
Next

time2 = GetTickCount()
time2 = time2 - time1
time3 = GetTickCount()
For i = 1 To r
  d = d + 0.1
Next

time4 = GetTickCount()
time4 = time4 - time3
showMessage(Str$(time2)+" / "+Str$(time4))
This calculation spits out "938 / 937" ms, that is the same as PureBasic does (on my machine).


Now if you want to get more speed you can do (NOT PureBasic):

Code: Select all

Declare Function GetTickCount LIB "kernel32" () As Long

defint r = 100000000
defint i, time1, time2, time3, time 4
DEFSNG var, f
DEFDBL d
var = 0.1

time1 = GetTickCount()

FPU.load var
FPU.load f

For i = 1 To r
  FPU.add
Next

time2 = GetTickCount()
time2 = time2 - time1
f = FPU.pop

time3 = GetTickCount()

FPU.load var
FPU.load d

For i = 1 To r
  FPU.add
Next

time4 = GetTickCount()
time4 = time4 - time3

d = FPU.pop

showMessage(Str$(time2)+" / "+Str$(time4))

which brings the values down to: "204 / 187".
(the same in .NET comes down to "100ms" supposedly through better compiler optimations - there is a topic on this in the german PB forum...)

This said with the right approach for the task you can even use math classes.
Depending on the programming language of course.
:wink:
Dreamflower
User
User
Posts: 10
Joined: Thu May 29, 2003 4:33 am

Post by Dreamflower »

I know this thread is old.

But I thought I might add: Why do all always do make the relation OOP -> C++

Its know that C++ is crap and that it better never should have evolved into standard OO language. Its ideas were at best (if you see the thing from interview above, you might know why "at best") usable when it was created but it definitely does not meet the needs of today.

Thats the reason Apple came up with Objective C and MS came up with C# which took many ideas from Eiffel which, to me, is the one of the best languages to show of what OOP actually is and can do. (some stuff comes from Java).
Major problem with many OO language is: they have their roots 20 years ago and still try to enforce "backward compatibility" which in the end makes them hard to use or feature cut at points where it makes the OO nearly useless. (if you compare Java - Eiffel inheritance and especially selection etc you see where java actually sacrificed usefull OO for stupid backward compatibility)

Just because C++ is trash and mixes lot of stuff and makes it insecure and dangerous, it after all does not mean that OO generally is like that.


And beside that: Why do so many procedural programers go against OO? From what I've seen in code, they normally fake OO with their codes to a very high level, so there is definitely no reason they should be against it or they should stop faking "OO naming" (structure someThing and procedures like someThing_move() etc which definitely is OO fake for someThing.move() )
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

So what OOP language should I judge?
u9
User
User
Posts: 55
Joined: Tue May 09, 2006 8:43 pm
Location: Faroe Islands
Contact:

Post by u9 »

It's not the language. It's the concept you should judge.
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
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

@Dreamflower
I (and reality) am absolutely in accordance to you.
And i'd like fsw (who is making a PB OOP preprocessor which has even the same syntax as C++ :!: ) and some others to answer to this magic question:
Why do all always do make the relation OOP -> C++
8)
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

u9 wrote:It's not the language. It's the concept you should judge.
1. Judging the concept alone isn't worth anything if I want to choose a language and am not sure whether I should pick an OOP language or not. (Which is what this is all about - what language should one program in?)

2. Let me judge the concept (although it's idiotic):
If everything is an object, then what are the objects made out of? Here we have a problem with infinite recursion. Therefore it's not possible for an object oriented language to be purely object oriented.
Conclusion: Everyone who promotes "purely object oriented" languages are liars when they say the language is purely object oriented, so why should I trust anything else of what they say?
u9
User
User
Posts: 55
Joined: Tue May 09, 2006 8:43 pm
Location: Faroe Islands
Contact:

Post by u9 »

Trond wrote:[...] 1. Judging the concept alone isn't worth anything if I want to choose a language and am not sure whether I should pick an OOP language or not.
There are 3 requirements for a language to support OOP principles. Now what language you choose has nothing to do with these principles other then whether they are supported or not (if you want to follow an OOP paradigm.) The differences in languages are freedom vs. restriction, automatic vs. manual (e.g. garbage collection), readability vs. writability (syntax), compilation vs. interpretation vs. JIT, strong type vs. week type, OOP vs. procedural vs. functional, etc. Factors like these (there are others) is what you should choose your language from. In many languages (such as c++) you have the freedom not to use any OOP features. Here it is up to you on what principles you follow. E.g. Java doesn't give much freedom.
Trond wrote:2. Let me judge the concept (although it's idiotic):
If everything is an object, then what are the objects made out of? Here we have a problem with infinite recursion. Therefore it's not possible for an object oriented language to be purely object oriented.
Conclusion: Everyone who promotes "purely object oriented" languages are liars when they say the language is purely object oriented, so why should I trust anything else of what they say?
Objects are made of members and methods. Members are of a primitive type or of another object. Need I define a primitive for you? Purely object oriented languages are languages that enforce the OOP paradigm(!) to full extend (even the primitives are implemented as objects), hence disallow e.g. functional programming such as Java (Java's primitives are not implemented as objects though.)

It is not the judgment that is idiotic here.
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
User avatar
utopiomania
Addict
Addict
Posts: 1655
Joined: Tue May 10, 2005 10:00 pm
Location: Norway

Post by utopiomania »

Object oriented is what the world outside this (and some other forums) is all all about, I'm afraid.

Just back from Sweden, from an xxxxxxxx one-week course in how to use theire sw to run 'my'
chemical plant in the future, and OO is king, period. :wink:
Last edited by utopiomania on Sun Oct 01, 2006 7:19 pm, edited 1 time in total.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

u9 wrote:
Trond wrote:2. Let me judge the concept (although it's idiotic):
If everything is an object, then what are the objects made out of? Here we have a problem with infinite recursion. Therefore it's not possible for an object oriented language to be purely object oriented.
Conclusion: Everyone who promotes "purely object oriented" languages are liars when they say the language is purely object oriented, so why should I trust anything else of what they say?
Objects are made of members and methods. Members are of a primitive type or of another object. Need I define a primitive for you? Purely object oriented languages are languages that enforce the OOP paradigm(!) to full extend (even the primitives are implemented as objects), hence disallow e.g. functional programming such as Java (Java's primitives are not implemented as objects though.)

It is not the judgment that is idiotic here.
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?

Can you, instead of simply saying that OOP is better, say what with OOP that is better?
Post Reply