+1Mistrel wrote:What a bunch of fools.
OOP vs procedural
Re: OOP vs procedural
Re: OOP vs procedural
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?
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
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
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
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?
If so, is there some sort of common functionality behind it? Or could someone post an example of handling windows and interacting with it?
- Kaeru Gaman
- Addict

- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: OOP vs procedural
what do you mean? handling more than one window the procedural way?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?
or setting OOP on PureBasic?
there are examples howto branch you eventhandling for arbitrary many windows...
there are some OOP approaches for PureBasic...
oh... and have a nice day.
Re: OOP vs procedural
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)
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)
- Kaeru Gaman
- Addict

- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: OOP vs procedural
how fluent is your German?
in the PureBasic Lounge there is a whole subforum with includes and libs for OOP in PB.
in the PureBasic Lounge there is a whole subforum with includes and libs for OOP in PB.
oh... and have a nice day.
Re: OOP vs procedural
could not resist:Kale wrote:IMHO, C# is the only thing microsoft has ever got right.
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!
SPAMINATOR NR.1
Re: OOP vs procedural
Non-existent?Kaeru Gaman wrote:how fluent is your German?
Oh Babel Fish, Oh Babel Fish, how lovely thou art...
Re: OOP vs procedural
Ha hahaa, lol!Rings wrote:could not resist:Kale wrote:IMHO, C# is the only thing microsoft has ever got right.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!
but honestly, Apart from C#, what have they ever got right?
Re: OOP vs procedural
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
@rings
wasnt that from the movie "life of brian"?
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Re: OOP vs procedural
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.
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
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!
>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
A little bit of an over exaggeration i think, lol!Marlin wrote:also I am unwilling to sacrifice 90% of an apps performance for OOP.




