• Welcome to Dark Bit Factory & Gravity.
 

Inheritance

Started by rdc, April 01, 2011

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

rdc

v1ctor has just about finished coding inheritance in FB. With the current object model you had to use containment in order to create object hierarchies, which quickly becomes unmanageable when implementing several containment layers.

When using containment, you have to manually expose the methods of ancestor objects in order to have access to them in child objects. This creates bloated objects which become quite difficult to manage as you can see in the aborted screen object code I posted.

With inheritance we won't have that problem. The relevant thread on the FB forums is here. Not sure when it will be made part of the distro yet.

Polymorphism isn't implemented yet, but we can simulate that using function pointers so I don't really consider that a show-stopper. Inheritance was the biggy, and it looks like we might finally get it.

We still do not have a fully OOP language yet, but at least there is movement and that is a good sign.

Shockwave

That's good news, a nice step in the right direction for freebasic.

Thanks for the information Rick. K+
Shockwave ^ Codigos
Challenge Trophies Won:

rdc

Hey man, I hope you have been well. I am actually moving to C++ for more of my stuff, but still good news.

Shockwave

Yeah, I'm fine thanks Rick
Done any chladni in C++ yet?
Shockwave ^ Codigos
Challenge Trophies Won:

rdc

Heh. Not yet, but it is on my list. :)

rain_storm

Object Oriented Basic! This whole OOP thing is really after taking off aint it. And I said it would never catch on.

Challenge Trophies Won:

rdc

Heh. v1ctor has actually made good progress on this. I am not sure what lit the fire, but I am glad to see it.

hellfire

#7
When I looked into Free-Basic some years ago, inheritance had already been announced but never actually appeared. And that's a main reason why I discarded it for coding anything "more complex".
I'm positively surprised they're finally getting on it.
Inheritance doesn't make much sense with polymorphism, though, but they're probably just taking one step after the other.
Now all that's missing is an optimizer ;)
Challenge Trophies Won: