Re: Classes vs. Modules
Just stick with your original concerns and forget about modules. Yes of
course one can use a module, one can place their Sub Main in a module and
they can put commonly used functions and procedures in a module however it
isn't necessary and lots of people (including me) don't.
I too have a Sub Main but mine just happens to be a Shared method of my
standard application class. This application class can contain any routines
common to the app as well so one continues to reap all the benefits of a
class implementation with no downside. Additionally should it ever be
needed I can convert (or pay somebody to convert) the entire app to C# or
even Java because there is nothing "VB-only" about the application. The
class, method, property modelling will translate across the board.
I'll suggest you keep your options open.
"Zytan" <zytanlithium@y ahoo.comwrote in message
news:1171059555 .318195.200810@ k78g2000cwa.goo glegroups.com.. .
>
Understood. Thanks. I guess I'm paranoid about having things
floating around, so I want them under something, say Math.Pi instead
of just Pi.
>
Zytan.
>
Just stick with your original concerns and forget about modules. Yes of
course one can use a module, one can place their Sub Main in a module and
they can put commonly used functions and procedures in a module however it
isn't necessary and lots of people (including me) don't.
I too have a Sub Main but mine just happens to be a Shared method of my
standard application class. This application class can contain any routines
common to the app as well so one continues to reap all the benefits of a
class implementation with no downside. Additionally should it ever be
needed I can convert (or pay somebody to convert) the entire app to C# or
even Java because there is nothing "VB-only" about the application. The
class, method, property modelling will translate across the board.
I'll suggest you keep your options open.
"Zytan" <zytanlithium@y ahoo.comwrote in message
news:1171059555 .318195.200810@ k78g2000cwa.goo glegroups.com.. .
>Personally, I do /not/ use modules to store variables and program state.
>I
>use modules only in very few cases: The project's main entry point is
>placed in a module 'Program'. In addition, common functions are placed
>in
>modules if their use makes sense throughout the project, similar to
>"Microsoft.Vis ualBasic.dll" and its modules. In this case modules are
>used
>to structure a huge set of functions, but make them easily accessible in
>IntelliSense everywhere.
>I
>use modules only in very few cases: The project's main entry point is
>placed in a module 'Program'. In addition, common functions are placed
>in
>modules if their use makes sense throughout the project, similar to
>"Microsoft.Vis ualBasic.dll" and its modules. In this case modules are
>used
>to structure a huge set of functions, but make them easily accessible in
>IntelliSense everywhere.
Understood. Thanks. I guess I'm paranoid about having things
floating around, so I want them under something, say Math.Pi instead
of just Pi.
>
Zytan.
>
Comment