Easy object oriented programming (just look at my example)

Got an idea for enhancing PureBasic? New command(s) you'd like to see?

Was this a good idea?

Yes.
50
56%
No.
19
21%
Maybe.
20
22%
 
Total votes: 89

User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Rescator wrote:A lot of talented coders in France. like Splinter Cell: Chaos Theory it's being made in France btw.
Chaos in France :?:

Vive La Revolution :mrgreen:
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

fred is from frence to, gedb ;)
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

freedimension wrote:You all just don't get the point :(

With what we have in mind

- you don't have to use OOP
- you don't have to learn OOP
- the PB-Core-API wouldn't change (meaning the Libraries)
- your code without OOP, wouldn't make you suffer any drawbacks

but

- you would have the possibility to use OOP for larger Projects, if you like to
- beginners could learn something about OOP (but they wouldn't have to)
And what i tried to say? Just that with other words 8)
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

I've been using Bmax for a few months now, and you can program it using classic BASIC style or using OOP, it's just up to you to decide.

I see no inconvenience here, and sure would help in some situations!
Truth_Seeker
Enthusiast
Enthusiast
Posts: 145
Joined: Tue Mar 01, 2005 8:41 pm
Location: Near a Computer

Post by Truth_Seeker »

I would like to see OOP added to PB to let us be able to use dlls and libraries that need classes to call them. If there is a way to do that already, I would like to know. AFAIK we can only use dlls that are coded in C, I am not correct?
Thanks
Truth Seeker
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

Afaik, after using the new pelle's linker we can use c++ dll's too. I think there is a way of calling those dll's..

however i would like to see pb oop too.
Truth_Seeker
Enthusiast
Enthusiast
Posts: 145
Joined: Tue Mar 01, 2005 8:41 pm
Location: Near a Computer

Post by Truth_Seeker »

How would that work? Would it be another Call function like: CallCPPFunction?
Thanks
Truth Seeker
Dano
User
User
Posts: 41
Joined: Fri Jul 16, 2004 4:20 am
Location: Edmonton, Ab, Canada

Post by Dano »

I say an absolute 'NO' to OOP

When I first watched PureBasic development Fred had a new version out pretty much every month. Now it is more like every 3 to 4 months, with added platforms to code for and added complexity of the language etc. There are essential things about the language like double floats, native Com Port support etc. which I personally would like to see before any OOP. You want to increase his workload implementing a feature which probably a minority will use? I say add commands and functionality which everyone can benefit from. There are only so many hours in the day for Fred, lets make this the best BASIC language and forget about OOP. It's not like there is a team of a hundred programmers working on PureBasic.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

I'm with Dano on the priorities bit. Let's get some basic 1980's/1990's stuff in place (like some old-fashioned extra data types) before any major enhancements (or any more bloooody OS versions) :)

That said, I have no problem with OOP as an addition to purebasic.

It can be used or not as needed. After all, we have 3D graphics, DB, and etc etc etc, and those who don't use these don't lose the ability to use the rest.
@}--`--,-- A rose by any other name ..
Truth_Seeker
Enthusiast
Enthusiast
Posts: 145
Joined: Tue Mar 01, 2005 8:41 pm
Location: Near a Computer

Post by Truth_Seeker »

Another thing about classes is, if you look on a site like codeproject.com almost all of the examples, tutorials, etc... are made with classes. So basicly I think it would be easier to convert tutorials to PB if we could use the same tools they do.

I love PB for its power and simplisity but it also needs to be able to interface/interact with things outside of PB (too bad PB is not the most used language, then we would not have these problems, oh well maybe someday the dreams will come true).

I also agree that classes in PB should not make the whole PB language OO, that would be like saying that when C++ was made that C suddenly stopped being what it is. C++ (notice the ++ which for those who do not know... it means to increment 1) is a add on / expansion to C. So the adding of classes should be a add on to PB not replace everything so that people are not forced to use them.

I believe that the more tools and resources we have at our command the better we can be at created powerful programs. And the faster PB will be seen in the world of programming as powerful, complete, and useful language.

Long live Purebasic! :D
Thanks
Truth Seeker
User avatar
Fou-Lu
Enthusiast
Enthusiast
Posts: 201
Joined: Tue Jul 12, 2005 8:30 am
Location: I'm pretty sure this is all a nightmare
Contact:

Post by Fou-Lu »

I really don't care that much about OO. As Rescator said, you can do everything you do with OO without OO. But if there are people interested in it, why not add?

We can't say no if we don't know wether it will make difference or not in the actual codes speed/size. But I'm sure this feature wouldn't be added if there's a drawback. If you don't like the idea, just forget it is there.

People who said "no" talk as if PureBasic would change completely. They're just asking for procedures inside structures after all. If you say "no" for that, I can't imagine what you will say when someone asks for a 3D engine update...

Please don't get me wrong, I didn't mean to be rude. :wink:

~Fou-Lu (aka Lørd Cinneris (actually Elias Sant'Ana))

Image Image
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Post by localmotion34 »

OOP has already been done with b++, there are two versions i think. one is commercial, the other is freeware. they both have the syntax of BASIC, while allowing OOP. try searching for B++. hence, the mergin of the 2 IS possible, its just a question of whether or not fred wants to do the merging here.

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
dmoc
Enthusiast
Enthusiast
Posts: 739
Joined: Sat Apr 26, 2003 12:40 am

Post by dmoc »

I would like to program using "contracts". I don't know what it means but I'm sure that's the way to to go. It's the future... and the solution to unknown problems... and if the marketing droids say so then it must be true :lol:

On a more serious note: there is NOTHING done in OOP that cannot be done in a "lesser" paradigm. "OOP"... what does it mean anyway? "Overly Obfuscated Programming".
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

A big, big no from me.

If you want OO, then you must have memory management. Preferabbly garbage collection, reference counting at the very least.

Object style coding without the memory management is a bad, bad thing.
Truth_Seeker
Enthusiast
Enthusiast
Posts: 145
Joined: Tue Mar 01, 2005 8:41 pm
Location: Near a Computer

Post by Truth_Seeker »

Then can you post some where a good example that you would see is a good OOP for purebasic?
Thanks
Truth Seeker
Post Reply