Fuel for you OOP non-believers...
HahaDare wrote:Wow. God codes in VB.NET!...

Ja jeg bor i Herlev lige nuthefool wrote:The world is definently object oriented. Everything is inherited.
(Do you actually understand Danish when you come from the faroe islands?)


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
http://www.wirednerd.com
yeah, really.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:
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 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.

At least not for a simple "print(a + b)".mp303 wrote:yeah, really.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:
some of his examples are just completely ridiculous - like for example:
A wrapper class for math? That's completely asenine, no one would ever do that in real life.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())
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))
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))
(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.

-
- User
- Posts: 10
- Joined: Thu May 29, 2003 4:33 am
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() )
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() )
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
http://www.wirednerd.com
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
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?)u9 wrote:It's not the language. It's the concept you should judge.
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?
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:[...] 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.
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.)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?
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
http://www.wirednerd.com
- utopiomania
- Addict
- Posts: 1655
- Joined: Tue May 10, 2005 10:00 pm
- Location: Norway
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.
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.

Last edited by utopiomania on Sun Oct 01, 2006 7:19 pm, edited 1 time in total.
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?u9 wrote: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.)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?
It is not the judgment that is idiotic here.
Can you, instead of simply saying that OOP is better, say what with OOP that is better?