yes in this over simplified application, it only entails 3 lines of code, lets take this to a reasonable extension. . . a service class with 6
basic operations on the wrapped class:
Start, stop, pause, resume, install and uninstall. . .
you now have 18 (3n) changes that have to be managed.
bear in mind, you're example only dealt with the creation of the wrapped class, not the process itself, if the managed class were anymore complex, that complexity will be be propagated on the order of n.
And that is for just one class. now lets consider the effect of working in an environment with many developers. Three different developers are charged with implementing a service to be run in our 'universal server,' management of the project now becomes more involved than actual implementation. You can see why, in any situation outside the most trivial, using VB would become unwieldly.
And the point of the exercise was to create a universal class.
Reflection is a critical aspect of OOP not implemented in VB6. Yes it is implemented in vb.net, but this goes back to my orginial point, that seems to have touched a nerve, lack of experience in a paradigm.
As far as Template Classes, Template Classes are a neat feature of C++. The are dual to the universal class I demonstrated. In a template, you specify a type argument and act accordingly to a set of common method declarations. While delphi doesn't have template keyword, the 'class of' specification allows you to implement classes that are, for all intents and purposes, equivalent, not workarounds.
Now, do I need to show you what is extremely limiting in VB in that it lacked delegates?
In delphi, I could do the following:
Code:
type
TProcedure = procedure;
TProcedureArray = Array[1..2] of TProcedure;
procedure DoSomething;
begin
ShowMessage('VB Sucks!');
end;
procedure DoThis;
begin
ShowMessage('Delphi Rocks');
end;
procedure DoThat;
begin
ShowMessage('C# Sucks!');
end;
procedure InitializeProcesses(RunDoThat: Boolean;
Processes: TProcessArray);
begin
Processes[1] := DoSomething;
if RunDoThat then
Processes[2] := DoThis
else
Processes[2] := DoThat
end;
var
MyProgram: TProcessArray;
i: Integer;
begin
InitializeProcesses(true, MyProgram);
for i:= Low(MyProgram) to High(MyProgram) do
MyProgram[i];
InitializeProcesses(false, MyProgram);
for i:= Low(MyProgram) to High(MyProgram) do
MyProgram[i];
end.
You couldn't do that in VB. does this mean you should learn delphi? No. it just means that VB sucks. and it means that VB devotees wont know how to domething that is critical.
So let me ask you something. . . be objective here.
Doesn't delphi code look easy to read?
My examples have and will continue to ellicit responses along the lines of 'why do I have to know how to do that?'
Come on now. . . use your imagination!!!
Don't make me pull out my TCustomThread classes.
But this leads me back to my initial point, I have no need for VB programers as they,
IN GENERAL, don't get it. :-\
Smile! Dont be so thin skinned!!! most of my language is just to ruffle your feathers!
You know, get you to think critically?
I mean if everyone just agreed with everyone else where would we be?
Joe Joe