Author Topic: Inheritance  (Read 4372 times)

0 Members and 1 Guest are viewing this topic.

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Inheritance
« 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. 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.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Inheritance
« Reply #1 on: April 01, 2011 »
That's good news, a nice step in the right direction for freebasic.

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

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Re: Inheritance
« Reply #2 on: April 01, 2011 »
Hey man, I hope you have been well. I am actually moving to C++ for more of my stuff, but still good news.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Inheritance
« Reply #3 on: April 02, 2011 »
Yeah, I'm fine thanks Rick
Done any chladni in C++ yet?
Shockwave ^ Codigos
Challenge Trophies Won:

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Re: Inheritance
« Reply #4 on: April 02, 2011 »
Heh. Not yet, but it is on my list. :)

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: Inheritance
« Reply #5 on: April 03, 2011 »
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:

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Re: Inheritance
« Reply #6 on: April 03, 2011 »
Heh. v1ctor has actually made good progress on this. I am not sure what lit the fire, but I am glad to see it.

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: Inheritance
« Reply #7 on: April 04, 2011 »
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 ;)
« Last Edit: April 04, 2011 by hellfire »
Challenge Trophies Won: