Re: Modules




"WebBiz" <justask@xxxxxxxxxxxxxxxxx> wrote in message
news:IUQGg.460$B14.178@xxxxxxxxxxxxx


I can't help feeling I'm missing something very powerful with these 'classes'.
Having started out as a top-down type of programmer from the 70's may have
skewed my perspective beyond repair. I've read the C++ manuals back when they
first came out and went "Oooh, that's cool". But can't seem to arrive at a
point where I'd create some base object with some core features, then start
adding to it via inheritance and all that.

Various thoughts:

I use classes so routinely, I would reverse the question: why make a module when
you can make a class? If I make a class and create only one instance of it,
available from start to finish in a program, it has everything a module does.
(Okay, it can't contain a callback function for those timer API calls).

In VB6, the following are classes: all forms; all controls; all collections; all
user controls; the App, Screen, Clipboard, Printer, and Err objects; all DAO and
ADO connections, recordsets, and fields. All events are raised by classes.

You can make a class with no properties and just a single function. You can make
a class with 327 properties, and no functions. Make whatever sort of widget you
need. The Form class has 65 properties, 22 methods, and 31 events (or so). The
Timer control has 6 properties, 0 methods, and 1 event. The Collection class has
0 properties, 5 methods, and 0 events.

VB6 doesn't do inheritance, but it does do interface implementation, which gets
you a fair bit of related-classes functionality.

Anything worth having is worth having two of. Or at least being able to have two
of should the need arise.



.



Relevant Pages

  • Re: Stroustrups FAQ causes infinite loop when executed
    ... There may be ways in which inheritance could ... programmer could not have foreseen. ... >> complex calculations such as multiplying numerous transformation ... >> reason to cap the class. ...
    (comp.lang.cpp)
  • Re: Object Oriented simpleton design pattern
    ... makes me believe that Inheritance and Polymorphism are the joint ... For reuse without any changes, ... functions but rather functionality. ... Implemenation inheritance is simply a means where a programmer can instruct ...
    (microsoft.public.vb.general.discussion)
  • Re: Job title: $300 flat for job in perl, cgi, Visual Basic/Asp.Net, whatever online project
    ... Lookie lookie for programmer ?? ... worth of work 35.000 euro`s ... $300 flat for job in perl, cgi, Visual Basic/Asp.Net, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Modularity problems with multiple dispatch
    ... rules for inheritance etc. Do the same for B', ... a so-called 'effective method' is run, ... but they cannot capture all aspects of a function's behaviour under run-time dispatch. ... means for the programmer that he/she should be prepared to ...
    (comp.lang.functional)
  • Re: Modularity problems with multiple dispatch
    ... rules for inheritance etc. Do the same for B', ... The programmer who tries to call f? ... Then the situation degenerates into single dispatch, and for that, we can use DbC and don't have that combination problem. ... my definition of an FPL is one that allows you to construct functions at runtime. ...
    (comp.lang.functional)