If this is the case, all that a does is give you acces to less properties
and methods and you can't even be sure which methods will actually be
used
unless you follow the chain yourself? So what does it buy you?
Um. It buys you _everything_! Polymorphism is one of the most powerful
features of OOP.
"All that a [sic] does is give you access to less properties and
ethods" -- you're thinking of inheritance in the wrong way. Sure,
sometimes inheritance is about taking some base class and adding
features. But just as often, it's about taking some base class and
making its existing features work _better_ or in some specific way. In
those situations, you lose nothing by referring only to the base type.
"You can't even be sure which methods will actually be used" -- who
can't? The code using the base type can't, you're right. But that's an
_advantage_. It doesn't need to know. You can have one little place in
your code that knows the exact implementation you want to use, and then
the rest of the code only has to worry about the base type. This is much
better than having to put conditional code everywhere that you need
different behavior depending on some precondition.
Even in terms of the code where the implementation is chosen, it may well
not be important at all where the method that implements the virtual
method is. If it _is_ important, then the implementation is almost
certainly in the class being instantiated in the first place, and so
knowing what the implementation is isn't not very complicated at all. If
you assume no hiding of virtual methods, then the implementation is in the
class you're instantiating; that's why you chose that class to represent
you!.
You may find it useful to look at how interfaces are used. They are in a
way a special-case of inheriting a virtual method, in that the interface
is basically a whole class full of virtual methods, and only virtual
methods. If you can understand why interfaces are useful, then you should
be able to understand why virtual methods in other contexts are useful.
And if you can't understand why interfaces are useful, may I suggest that
you start there. Make sure you understand that, and then move on to
virtual methods.