Page 3 of 4
Re: OOP vs procedural
Posted: Wed Oct 28, 2009 9:04 am
by thefool
Mistrel wrote:What a bunch of fools.

+1

Re: OOP vs procedural
Posted: Wed Oct 28, 2009 9:22 am
by Fred
Re: OOP vs procedural
Posted: Wed Oct 28, 2009 10:25 am
by Foz
As amusing as the avatars are

I thought I'd give my two pence:
OO programming allows organising into teams. With a procedural language, you have to have everything building together - it works perfectly for a one man team, and for a one man team, it is also faster to code as procedural - everything is done all at once.
However, as many people work in teams (businesses, open source software, etc), it is by far easier to split off everything into many small objects that all work independently, this way, many parts can be distributed to many people. This way, each person builds their object, and a small simple application that interfaces that object. Once that object is ticked off, another can be dealt with the same way.
The difference is that a lot more work is done with OOP, each object will have it's own tester application, whereas PP will (generally) build it all together, all at once.
With the ability to compartmentalise procedures in PB (include), it becomes a lot easier to duplicate the way to work (lots of small include files instead of objects), but it loses out on stuff like inheritance which saves you duplicating code - if you change one bit of code in one object that is inherited to many other classes, all the other classes automatically get it, with the many include files all instances of copied code have to be changed - and if you miss one... you're in for a world of pain later...
And that's about it from the top of my head.
Can I have a snazzy avatar too now?

Re: OOP vs procedural
Posted: Wed Oct 28, 2009 10:52 am
by thefool
I still think its a good idea to learn an object oriented language even if you're only a one-man team. Its not always faster to code procedural, some problems are just hard to attack top-down. It depends on the problem that needs to be solved, no matter if you're 1 or 10. Except object oriented methods are often more suitable for teams due to a higher level of abstraction etc. so we agree on that point
My point is just that its not that black and white (where black and white means 1 man= procedural is best, 10 man = OOP is best).
I'm looking forward to a course in functional languages coming soon. Yet another way of solving problems

Re: OOP vs procedural
Posted: Wed Oct 28, 2009 11:56 am
by Foz
Actually, I'm just wondering, but do any people here use the (limited) OO methods in PureBasic to handle windows, so each window is it's own object?
If so, is there some sort of common functionality behind it? Or could someone post an example of handling windows and interacting with it?
Re: OOP vs procedural
Posted: Wed Oct 28, 2009 11:59 am
by Kaeru Gaman
Foz wrote:Actually, I'm just wondering, but do any people here use the (limited) OO methods in PureBasic to handle windows, so each window is it's own object?
If so, is there some sort of common functionality behind it? Or could someone post an example of handling windows and interacting with it?
what do you mean? handling more than one window the procedural way?
or setting OOP on PureBasic?
there are examples howto branch you eventhandling for arbitrary many windows...
there are some OOP approaches for PureBasic...
Re: OOP vs procedural
Posted: Wed Oct 28, 2009 12:54 pm
by Foz
As in, a single window is one self contained object, so from a procedural point all you have to do is create a new instance of that window and then tell it to be shown.
But I'm thinking that it would be a perfect candidate for inheritance - so there is a common "ShowWindow" function, or "WindowDialogResult" property, etc.
So I was thinking, has anyone actually done this in PB? (A base window class, an inherited actual window class, and some base procedural code that interfaces with the class to retrieve the value or something like that)
Re: OOP vs procedural
Posted: Wed Oct 28, 2009 1:11 pm
by Kaeru Gaman
how fluent is your German?
in the
PureBasic Lounge there is a whole subforum with includes and libs for OOP in PB.
Re: OOP vs procedural
Posted: Wed Oct 28, 2009 1:25 pm
by Rings
Kale wrote:IMHO, C# is the only thing microsoft has ever got right.
could not resist:
Reg: All right, but apart from the sanitation, medicine, education, wine, public order, irrigation, roads, the fresh water system and public health, what have the Romans ever done for us?
Attendee: Brought peace?
Reg: Oh, peace - shut up!
Re: OOP vs procedural
Posted: Wed Oct 28, 2009 1:27 pm
by Foz
Kaeru Gaman wrote:how fluent is your German?
Non-existent?
Oh Babel Fish, Oh Babel Fish, how lovely thou art...
Re: OOP vs procedural
Posted: Wed Oct 28, 2009 7:05 pm
by Kale
Rings wrote:Kale wrote:IMHO, C# is the only thing microsoft has ever got right.
could not resist:
Reg: All right, but apart from the sanitation, medicine, education, wine, public order, irrigation, roads, the fresh water system and public health, what have the Romans ever done for us?
Attendee: Brought peace?
Reg: Oh, peace - shut up!
Ha hahaa, lol!
but honestly, Apart from C#, what have they ever got right?

Re: OOP vs procedural
Posted: Wed Oct 28, 2009 7:59 pm
by nco2k
guys guys! you are getting way too off-topic.. can we focus on the avatars again? thanks.
@rings
wasnt that from the movie "life of brian"?
c ya,
nco2k
Re: OOP vs procedural
Posted: Wed Oct 28, 2009 9:03 pm
by Marlin
I like OOP for the order it can bring...
but I do not want to stand on my head to use it,
also I am unwilling to sacrifice 90% of an apps performance for OOP.

Re: OOP vs procedural
Posted: Wed Oct 28, 2009 11:26 pm
by idle
Rings wrote:
could not resist:
Reg: All right, but apart from the sanitation, medicine, education, wine, public order, irrigation, roads, the fresh water system and public health, what have the Romans ever done for us?
Attendee: Brought peace?
Reg: Oh, peace - shut up!

Best quote in the thread.
>dont want to stand on my head to use it
Try and solve that in UML
Both have their uses and places and sometimes oop is the right choice.
Re: OOP vs procedural
Posted: Thu Oct 29, 2009 12:11 am
by Kale
Marlin wrote:also I am unwilling to sacrifice 90% of an apps performance for OOP.

A little bit of an over exaggeration i think, lol!