OOP or not to OOP...?
OOP or not to OOP...?
Firstly I would like to state the following:
Purebasic is a very very good product!
However, I must admit that after previously coding in other languages from c++ to Blitzmax, I do feel Purebasic would truly benefit from OOP.
The control and power that OOP gives Blitzmax is fantastic, if this same could be utilised in PB It would be a great advantage to all!
I fully appreciate that this is an OLD topic and that there are many whom maybe uncomfortable with OOP but it does assist in clean. manageable code!
Thanks...
Purebasic is a very very good product!
However, I must admit that after previously coding in other languages from c++ to Blitzmax, I do feel Purebasic would truly benefit from OOP.
The control and power that OOP gives Blitzmax is fantastic, if this same could be utilised in PB It would be a great advantage to all!
I fully appreciate that this is an OLD topic and that there are many whom maybe uncomfortable with OOP but it does assist in clean. manageable code!
Thanks...
All watched over by MACHINES..I am little more than #DigitalPlankton
- netmaestro
- PureBasic Bullfrog

- Posts: 8453
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: OOP or not to OOP...?
Oh not this Oriented Object Programming crap again !
http://www.purebasic.fr/english/viewtop ... =3&t=45569
http://www.purebasic.fr/english/viewtop ... =3&t=45569
Re: OOP or not to OOP...?
If you really want to use OOP there are nice add-ins such as SimpleOOP or if you like to have control - you already seen ts-sotf's RichEdit version with a self created virtual table.
But you shouldn't expect that the Team to place this high on the road map.
But you shouldn't expect that the Team to place this high on the road map.
The best preparation for tomorrow is doing your best today.
Re: OOP or not to OOP...?
OOP accidentally my whole PureBasic source code! 
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Re: OOP or not to OOP...?
Okay..okay okay...
Yes it is an OLD regurgitated topic, but a relevant one nonetheless!!
OOP is (O)bject (O)riented (P)rogramming and is an ALTERNATIVE (rightly or wrongly) to PROCEDURAL programming.
Its Marmite (that may be a UK reference) which means you either love it or hate it. However it is a most useful METHOD of creating REUSABLE, CONTAINABLE OBJECTS. 'OBJECTS' in code represent real objects and are self contained which provides the coder with a very TIGHT model of something. Inside of the 'OBJECT' is not only the description of it but also all the data it requires and uses and these items are CONTAINED within the OBJECT. Also contained in the OBJECT are the METHODS which are like functions \ procedures which perform various actions on the OBJECT DATA and only on the OBJECT DATA.
I may be boring you to tears but once you have designed your OBJECT you create instances of it and everything is contained and kept tidy by it instance of itself.
This minimises (or strictly removes) GLOBAL variables and GLOBAL Errors on these variables. It sounds really complicated but it is one of those things that once you get it and get it to work you never look back.
Sorry if I have bored you all. Bottom line is if you are writing an application which is getting large OOP keeps it tight, tidy and reduces errors if used correctly.
I am the operator of my pocket calculator!
Yes it is an OLD regurgitated topic, but a relevant one nonetheless!!
OOP is (O)bject (O)riented (P)rogramming and is an ALTERNATIVE (rightly or wrongly) to PROCEDURAL programming.
Its Marmite (that may be a UK reference) which means you either love it or hate it. However it is a most useful METHOD of creating REUSABLE, CONTAINABLE OBJECTS. 'OBJECTS' in code represent real objects and are self contained which provides the coder with a very TIGHT model of something. Inside of the 'OBJECT' is not only the description of it but also all the data it requires and uses and these items are CONTAINED within the OBJECT. Also contained in the OBJECT are the METHODS which are like functions \ procedures which perform various actions on the OBJECT DATA and only on the OBJECT DATA.
I may be boring you to tears but once you have designed your OBJECT you create instances of it and everything is contained and kept tidy by it instance of itself.
This minimises (or strictly removes) GLOBAL variables and GLOBAL Errors on these variables. It sounds really complicated but it is one of those things that once you get it and get it to work you never look back.
Sorry if I have bored you all. Bottom line is if you are writing an application which is getting large OOP keeps it tight, tidy and reduces errors if used correctly.
I am the operator of my pocket calculator!
All watched over by MACHINES..I am little more than #DigitalPlankton
Re: OOP or not to OOP...?
I would OOP!Nexus100 wrote:OOP or not to OOP...?
Seriously though, let face the truth: OOP is needed for large projects built by teams, period!
The PB staff have ignored this for years so nothing is going to change here soon. It's as though these languages don't exist! Procedural is so yesterday!
The trouble is that pre-processors like these only give a fraction of the value of true OOP. For example there is no way of using this processor to use design patterns or to override a type's behaviour. So effectively it's useless for true OOP.KJ67 wrote:If you really want to use OOP there are nice add-ins such as SimpleOOP or if you like to have control - you already seen ts-sotf's RichEdit version with a self created virtual table.
But you shouldn't expect that the Team to place this high on the road map.
C provides the infinitely-abusable goto statement, and labels to branch to. Formally, the goto is never necessary, and in practice it is almost always easy to write code without it. We have not used goto in this book. -- K&R (2nd Ed.) : Page 65
Re: OOP or not to OOP...?
I only thought it was so you could take 10 times longer to produce the product and fleece the boss of his profitsSeriously though, let face the truth: OOP is needed for large projects built by teams, period!
Windows 11, Manjaro, Raspberry Pi OS


- netmaestro
- PureBasic Bullfrog

- Posts: 8453
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: OOP or not to OOP...?
As a veteran participant in many large projects which didn't involve object oriented development tools I must gently disagree with this point. All that's really needed is a clean modular design and everyone builds their assigned modules in conformance with a clearly defined set of coding standards. I'm sure they use OOP at Adobe, yet you'd look far and wide to find a more convoluted and screwed-up format than PSD. In the end your success or failure comes down to comprehensive planning, skills, experience, cooperation and communication. I would not hesitate to plan and invest in a large team project with Purebasic in its current form as the main development tool.Seriously though, let face the truth: OOP is needed for large projects built by teams, period!
BERESHEIT
-
Zach
- Addict

- Posts: 1678
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: OOP or not to OOP...?
I have to agree.
I don't think OOP is a necessity. I had a rather interesting discussion with another programmer a while ago, in which I came to the conclusion that OOP is indoctrinated instead of taught to people.
It's like eating french fries with mayo vs ketchup vs cheese or what have you. Some people learn, or like one way, and become convinced it is the only way to be successful. I don't really think that is true.
OOP has its place, but people have to realize, we did have programmers before C++ et al came along.
I think a lot of people misunderstand the problem with earlier programming languages and "spaghetti code" etc.. It is not the fault of the procedural style that many early programs could be absolute torture to read. It was the fault firstly, of the design and syntax limitations of the languages in question, and secondly to a lesser degree the fault of the programmers themselves.
I think it is very rare to see two programmers who code nearly alike, without putting a gun to their head. That is part of the personal freedom that comes with being an independent developer, or free-lance hire, but the bottom line is no matter which method you use, if the programmer writes like shit, its going to look like it.
Consequentially, if you put a team of programmers together and don't enforce strict rules upon them as to how they code, how they comment code and all that jazz; you end up with a toilet of variously polished turds. Sure it may all look like it goes together and is of the same stuff, but a polished turd is still a turd.
I don't think OOP is a necessity. I had a rather interesting discussion with another programmer a while ago, in which I came to the conclusion that OOP is indoctrinated instead of taught to people.
It's like eating french fries with mayo vs ketchup vs cheese or what have you. Some people learn, or like one way, and become convinced it is the only way to be successful. I don't really think that is true.
OOP has its place, but people have to realize, we did have programmers before C++ et al came along.
I think a lot of people misunderstand the problem with earlier programming languages and "spaghetti code" etc.. It is not the fault of the procedural style that many early programs could be absolute torture to read. It was the fault firstly, of the design and syntax limitations of the languages in question, and secondly to a lesser degree the fault of the programmers themselves.
I think it is very rare to see two programmers who code nearly alike, without putting a gun to their head. That is part of the personal freedom that comes with being an independent developer, or free-lance hire, but the bottom line is no matter which method you use, if the programmer writes like shit, its going to look like it.
Consequentially, if you put a team of programmers together and don't enforce strict rules upon them as to how they code, how they comment code and all that jazz; you end up with a toilet of variously polished turds. Sure it may all look like it goes together and is of the same stuff, but a polished turd is still a turd.
Re: OOP or not to OOP...?
First, you've no idea if Adobe did indeed use an OOP based language. Second, a convoluted format is not dependant on the implementing language.netmaestro wrote:I'm sure they use OOP at Adobe, yet you'd look far and wide to find a more convoluted and screwed-up format than PSD.
Why do you think C++ et al came along at all? And why do you think that it is used for the majority of projects?Zach wrote:OOP has its place, but people have to realize, we did have programmers before C++ et al came along.
C'mon lets get real. OOP is used far more in industry than any other paradigm purely because it works and handles complexity better than the procedural model!
I will stick my neck out here and say if you dismiss OOP entirely, refuse to learn anything about it or you don't understand it you are a poor developer!
C provides the infinitely-abusable goto statement, and labels to branch to. Formally, the goto is never necessary, and in practice it is almost always easy to write code without it. We have not used goto in this book. -- K&R (2nd Ed.) : Page 65
- netmaestro
- PureBasic Bullfrog

- Posts: 8453
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: OOP or not to OOP...?
I don't think anyone's saying that.I will stick my neck out here and say if you dismiss OOP entirely, refuse to learn anything about it or you don't understand it you are a poor developer!
BERESHEIT
Re: OOP or not to OOP...?
Blood wrote:First, you've no idea if Adobe did indeed use an OOP based language.netmaestro wrote:I'm sure they use OOP at Adobe, yet you'd look far and wide to find a more convoluted and screwed-up format than PSD.
LOL Blood? By your own demonstrative assertion, how else could the Adobe team develop their products?Blood wrote:Seriously though, let face the truth: OOP is needed for large projects built by teams, period!
And how dare that SQLite team continue to develop the most pervasive RDBMS in plain old C!
Can't argue here, only to say, OOP makes it a lot easier.Blood wrote:Second, a convoluted format is not dependant on the implementing language.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: OOP or not to OOP...?
If you ask me, the only true way to code is functional programming and PureBasic can't do that either.
This discussion is older than PureBasic itself. Nothing new is going to be said here.
This discussion is older than PureBasic itself. Nothing new is going to be said here.
quidquid Latine dictum sit altum videtur


