3 ms·
I am using object-oriented programming (OOP) and like it! I'm using OOP via Microsoft's Visual Basic .NET, the .NET Framework, ASP.NET, ADO.NET, etc. For inhe
by graycat 12y ago
I am using object-oriented programming (OOP) and
like it! I'm using OOP via Microsoft's
Visual Basic .NET, the .NET Framework,
ASP.NET, ADO.NET, etc.
For inheritance, I've never tried to understand
it or use it. Yes, the .NET Framework apparently
uses inheritance, but there as far as I can see
mostly the inheritance is mostly just imaginary,
mostly just a means of documentation. E.g.,
I can have a variable X of type byte, integer,
float, GUID, etc. and write X.ToString, that is,
pass (it really is essentially call-return
semantics) the method ToString inherited
from somewhere, some abstract class or some
such, but I don't believe that there is actually
any real inheriting going on. Maybe there is
some overloading, but then the spelling
'ToString' is just a convenience for documentation
and usage. Or, just as easily it could be that
in case the type of X was integer, then I could
write X.ToStringInt where the method ToStringInt
was for converting integers to strings. Fine
with me. I know; I know: If I can write X.ToString
when the type of X is an integer, then
where X is declared I can change its type to,
say, GUID and keep the code X.ToString and, thus,
get code rewuse, but I'd nearly never do that!
Instead I'd want to check over my code to be
sure the code still did what I wanted it to do.
Mostly I look at instances of classes much
like in PL/I where there were data structures
like
Declare
n_points Integer,
1 A Based,
2 Coordinates( n_points ),
2 X Float,
2 Y Float,
2 Lengths (n_points) Float;
So, in Visual Basic .NET could write