Cor Ligthert said:
Your messages and also from Larry would lead for me for
more wizards, not for implementing things in the language
itself, I assume that Larry has almost the same ideas like
me with this.
I am not a great fan of wizards. I hate most wizards, and I consider most
wizards useless for beginners. Take the VB6 application wizard for example.
This wizard could be used to create an explorer style application without
typing a single line of code. Really? No. The wizard created a skeleton,
the necessary controls (something even a beginner is able to click together
in the forms designer) but it didn't add much valuable code. In order to
use the skeleton created by the wizard, the beginner had to remove the
controls he/she didn't need and he would never have added to the form if he
designed it himself/herself.
In my opinion, the main point is making writing code simpler. Creating
inter-form relations is a code-only job. Currently. Maybe there will be a
graphical designer that allows to specify inter-form relations in a
graphical and declarative way, which will generate the code automatically.
That's all in far future.
Another important point is transparency. I'll provide another sample to
illustrate what I am thinking. In VB6 the form designer generated code (in
fact it was a declarative description of the form layout, something similar
will be back with XAML) was completely invisible to the programmer. Sure,
the programmer could view it using the editor to view the form files. There
were very few issues and problems with this model. Beginners didn't have to
worry about form generation code, mainly because they didn't see it. In
VB.NET, every user, even a beginner, will be able to see 'Sub
InitializeComponent', things he/she should not even edit manually. I know
that some people consider that to be a step forward, but for me it's a step
into the wrong direction. Unnecessary things are not as transparent as in
VB6, code is more low-level than in VB6.
In the case of default instances, it is very similar. Even if a wizard is
able to make forms implement the Singleton design pattern, the user will be
able to browse this code and thus be faced with low-level stuff he/she does
not understand. The implementation code of a Singleton is an implementation
detail that /should not/ be seen by the programmer, it should be completely
transparent.
To make a conclusion: I like the idea of extending the programming language
with very high-level constructs which allow to write forms code and code for
inter-form communication quickly, without worrying about the implementation.
I am aware of the fact that such a feature needs to be designed carefully.
Don't forget that the most important thing is encapsulation, in other words,
an increase in transparency. That's what helps us to understand complex
scenarios. For a beginner, and for a professional too, inter-form
communication code is an implementation detail that isn't so important to
worry about.
This will give the beginner the change to build a complete
program and later check the code and make more advantage
things for that.
Why let the beginner auto-generate tons of crappy code? Instead, a
simplification of the code by introducing powerful code constructs would
allow even beginners to write perfect code in less time.
"Using forms' default instances should be considered "best practice"" --
there is no negative impact caused by the use of default instances if they
are implemented in a clean way.