OOP or not to OOP...?

Everything else that doesn't fall into one of the other PB categories.
User avatar
Nexus100
User
User
Posts: 55
Joined: Tue Feb 16, 2010 9:40 pm
Location: Essex, UK

OOP or not to OOP...?

Post by Nexus100 »

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...
All watched over by MACHINES..I am little more than #DigitalPlankton
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: OOP or not to OOP...?

Post by netmaestro »

What is OOP? Could you explain it to me please?
BERESHEIT
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: OOP or not to OOP...?

Post by Guimauve »

Oh not this Oriented Object Programming crap again ! :evil: :evil:

http://www.purebasic.fr/english/viewtop ... =3&t=45569
User avatar
KJ67
Enthusiast
Enthusiast
Posts: 218
Joined: Fri Jun 26, 2009 3:51 pm
Location: Westernmost tip of Norway

Re: OOP or not to OOP...?

Post by KJ67 »

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.
The best preparation for tomorrow is doing your best today.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: OOP or not to OOP...?

Post by c4s »

OOP accidentally my whole PureBasic source code! :shock:
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
User avatar
Nexus100
User
User
Posts: 55
Joined: Tue Feb 16, 2010 9:40 pm
Location: Essex, UK

Re: OOP or not to OOP...?

Post by Nexus100 »

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!
All watched over by MACHINES..I am little more than #DigitalPlankton
User avatar
Blood
Enthusiast
Enthusiast
Posts: 161
Joined: Tue Dec 08, 2009 8:34 pm
Location: United Kingdom

Re: OOP or not to OOP...?

Post by Blood »

Nexus100 wrote:OOP or not to OOP...?
I would OOP! :twisted:

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! :mrgreen:
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.
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.
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
User avatar
idle
Always Here
Always Here
Posts: 6238
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: OOP or not to OOP...?

Post by idle »

Seriously though, let face the truth: OOP is needed for large projects built by teams, period!
I only thought it was so you could take 10 times longer to produce the product and fleece the boss of his profits :wink:
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: OOP or not to OOP...?

Post by netmaestro »

Seriously though, let face the truth: OOP is needed for large projects built by teams, period!
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.
BERESHEIT
Zach
Addict
Addict
Posts: 1678
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: OOP or not to OOP...?

Post by Zach »

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.
User avatar
Blood
Enthusiast
Enthusiast
Posts: 161
Joined: Tue Dec 08, 2009 8:34 pm
Location: United Kingdom

Re: OOP or not to OOP...?

Post by Blood »

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.
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.
Zach wrote:OOP has its place, but people have to realize, we did have programmers before C++ et al came along.
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?

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
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: OOP or not to OOP...?

Post by netmaestro »

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!
I don't think anyone's saying that.
BERESHEIT
User avatar
skywalk
Addict
Addict
Posts: 4318
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: OOP or not to OOP...?

Post by skywalk »

Blood wrote:
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.
First, you've no idea if Adobe did indeed use an OOP based language.
Blood wrote:Seriously though, let face the truth: OOP is needed for large projects built by teams, period!
LOL Blood? By your own demonstrative assertion, how else could the Adobe team develop their products?

And how dare that SQLite team continue to develop the most pervasive RDBMS in plain old C! :wink:
Blood wrote:Second, a convoluted format is not dependant on the implementing language.
Can't argue here, only to say, OOP makes it a lot easier.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
freak
PureBasic Team
PureBasic Team
Posts: 5962
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: OOP or not to OOP...?

Post by freak »

If you ask me, the only true way to code is functional programming and PureBasic can't do that either. :lol:

This discussion is older than PureBasic itself. Nothing new is going to be said here.
quidquid Latine dictum sit altum videtur
Locked