Dark Bit Factory & Gravity
PROGRAMMING => Freebasic => Topic started by: rdc on April 01, 2011
-
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 (http://www.freebasic.net/forum/viewtopic.php?t=17571). 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.
-
That's good news, a nice step in the right direction for freebasic.
Thanks for the information Rick. K+
-
Hey man, I hope you have been well. I am actually moving to C++ for more of my stuff, but still good news.
-
Yeah, I'm fine thanks Rick
Done any chladni in C++ yet?
-
Heh. Not yet, but it is on my list. :)
-
Object Oriented Basic! This whole OOP thing is really after taking off aint it. And I said it would never catch on.
-
Heh. v1ctor has actually made good progress on this. I am not sure what lit the fire, but I am glad to see it.
-
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 ;)