Page 1 of 1

OOP or not to OOP...?

Posted: Fri Jul 22, 2011 4:33 pm
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...

Re: OOP or not to OOP...?

Posted: Fri Jul 22, 2011 4:50 pm
by netmaestro
What is OOP? Could you explain it to me please?

Re: OOP or not to OOP...?

Posted: Fri Jul 22, 2011 4:52 pm
by Guimauve
Oh not this Oriented Object Programming crap again ! :evil: :evil:

http://www.purebasic.fr/english/viewtop ... =3&t=45569

Re: OOP or not to OOP...?

Posted: Fri Jul 22, 2011 5:04 pm
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.

Re: OOP or not to OOP...?

Posted: Fri Jul 22, 2011 5:18 pm
by c4s
OOP accidentally my whole PureBasic source code! :shock:

Re: OOP or not to OOP...?

Posted: Fri Jul 22, 2011 5:52 pm
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!

Re: OOP or not to OOP...?

Posted: Fri Jul 22, 2011 7:51 pm
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.

Re: OOP or not to OOP...?

Posted: Fri Jul 22, 2011 8:05 pm
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:

Re: OOP or not to OOP...?

Posted: Fri Jul 22, 2011 8:38 pm
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.

Re: OOP or not to OOP...?

Posted: Fri Jul 22, 2011 9:18 pm
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.

Re: OOP or not to OOP...?

Posted: Fri Jul 22, 2011 9:35 pm
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!

Re: OOP or not to OOP...?

Posted: Fri Jul 22, 2011 10:08 pm
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.

Re: OOP or not to OOP...?

Posted: Fri Jul 22, 2011 11:53 pm
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.

Re: OOP or not to OOP...?

Posted: Sat Jul 23, 2011 12:06 am
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.