roidy said:
Thanks for the code, can I just ask why should 'My' be avoided?
It's a PITA and like cancer pullulating my own project.
In other words? Naturally I use libraries, but 'My' means something
different: It is _inserted_ into my own project. I don't want this because
the 'My' design does not meet the claims that I have in many ways. So, it's
sink or swim. The My infrastructure contravenes the conventions that must be
complyed with throughout the rest of the project.
It's starts with the name: 'My'. What's that? No, it's no mine! Sorry,
you're out! I have other naming conventions. How can I change the name?
Impossible. Where does the name come from? Maybe from "Myspace"?
"My.Application" - yeah, it's my application; that's a nice word game but
has nothing to do with professional programming. Namespace names are not
meant to create a kind of sentence. My.Dog.Ran.Away or what?
'My' is intransparent. I always want to know what I do. I can't with 'My'.
Whenever I "go to definition", it doesn't work in most cases. Everything is
hidden behind the curtain. I hate this. That's VB6 behavior. Please, not
again! Try it with "My.Application" using "go to definition" on the word
'Application'. Where are you taken to? No, not to 'Application' as expected.
You're taken to "WindowsApplication1.My". Ok, I've found the namesspace.
Great. But where is the member 'Application'? I don't find it. Further more,
if 'My' is a namespace, 'Application' is what? Mustn't it be a namespace
name or a class name? Well, Ctrl+I (member info) on the word 'Application'
says it's a property. How can that be? Namespaces don't have properties. And
so on... It's a catastrophe. With the means of the IDE I failed to find out
what this 'My' thing really is.
My is redundant. Many things are already there in the (rest of the)
Framework. That's where it belongs to. If the feature makes sense and is not
there outside 'My', why hasn't it been included there? Either it's useless
or, if it's not, then there is a good chance that it will be added later so
that other langauges will benefit from it also. But then it's redundant
again. Many methods inside 'My' just call what has already been there
before. Why do we need My.Computer.Clock.TickCount? It just calls
Environment.Tickcount.
Navigate to Microsoft.VisualBasic.Devices.ServerComputer.FileSystem in
object browser. It's type is displayed as
Microsoft.VisualBasic.MyServices.FileSystemProxy. In the lower pane you can
click on that type. Where are you taken to? Nowhere! But I want to see the
members. I can't! Where are they? I can use them in code but don't see them
in the object browser??
My uses Modules. Modules are prohibited by convention in my project (yes, in
*my* project. 'My' is not my project).
My uses instances where it doesn't make sense. Why are those members like
Microsoft.VisualBasic.Devices.Computer.Audio not shared members? Will there
be other Computer instances?
An example: My.Settigs my be nice. However, I want my settings to be a
shared member of my Class Main. So, how can I move the feature there?
Impossible.
So, 'My' is just for dummies that don't have a clear idea of good
application design and don't care about such a brick placed into each
project. 'My' is one reason why MSFT calls VB a language for beginners again
even if it is not. That's a big step back into the past. Instead of making
people aware of how great VB has become since .Net.
I've created a new project template using _mtype="empty".
Armin