Re: Classes vs. Modules
On Feb 10, 9:01 pm, "Scott M." <s...@nospam.no spamwrote:
I'm sorry Scott, but you are making absolutely no sense here. The
fact is that it takes almost exactly the same amount of work to put
your sub main in a class as it does in a module. There is hardly any
difference here, except for the addition of the shared keyword on the
sub main - and that is what happens automatically if you use a module.
There is no situation that I can think of where a module is superior
or significantly easier then a class. That could be because I do 99%
of all my work in C#, and there is no concept of a module there...
The closest thing is the static class added in C#2.0 - which is a way
to get the compiler to enforce what most of us do anyway - create a
class with a private constructor and all static methods :)
Now, I'm not saying that you shouldn't use Modules. Your style is
your style. I don't use them when I do VB work, but that is my
choice. The only thing I object to in your statement is the
implication that it is more work to use a class.... Simply not true -
at least in any significant manner.
--
Tom Shelton
On Feb 10, 9:01 pm, "Scott M." <s...@nospam.no spamwrote:
"Tom Leylan" <tley...@nospam .netwrote in message
>
news:u3wp%23PXT HHA.496@TK2MSFT NGP06.phx.gbl.. .
>
>
I'm so sorry that you are having such a hard time Tom. To answer your
question, no I haven't. But, that what not the OP. Modules are *another*
way of handling such things. I find them easier for these situations than
custom classes. I find them quicker to set up and use than custom classes
and I find them to make more sense from a *flow* standpoint in these
situations.
>
>
news:u3wp%23PXT HHA.496@TK2MSFT NGP06.phx.gbl.. .
>
Scott: I just don't know where you are coming from on this. Have you
tried placing Sub Main in a class and your command line switches didn't
work or are you imagining it could be problematic and avoiding it as such?
tried placing Sub Main in a class and your command line switches didn't
work or are you imagining it could be problematic and avoiding it as such?
I'm so sorry that you are having such a hard time Tom. To answer your
question, no I haven't. But, that what not the OP. Modules are *another*
way of handling such things. I find them easier for these situations than
custom classes. I find them quicker to set up and use than custom classes
and I find them to make more sense from a *flow* standpoint in these
situations.
>
fact is that it takes almost exactly the same amount of work to put
your sub main in a class as it does in a module. There is hardly any
difference here, except for the addition of the shared keyword on the
sub main - and that is what happens automatically if you use a module.
There is no situation that I can think of where a module is superior
or significantly easier then a class. That could be because I do 99%
of all my work in C#, and there is no concept of a module there...
The closest thing is the static class added in C#2.0 - which is a way
to get the compiler to enforce what most of us do anyway - create a
class with a private constructor and all static methods :)
Now, I'm not saying that you shouldn't use Modules. Your style is
your style. I don't use them when I do VB work, but that is my
choice. The only thing I object to in your statement is the
implication that it is more work to use a class.... Simply not true -
at least in any significant manner.
--
Tom Shelton
Comment