[mono-vb] Why are Modules in VB runtime declared as Classes?

Rafael Teixeira monoman at gmail.com
Sat Aug 26 08:25:56 EDT 2006

That was what we needed to do when coding then in C#, because that is
what the vb compiler generates when it sees a Module definition
(generate a StandardModule-attributed class with all methods static
and no constructor), but now that it is compiled in VB proper, I think
we should leave for the compiler to do the job.


On 8/26/06, Kornél Pál <kornelpal at gmail.com> wrote:
> Hi,
> Currently all modules in VB runtime are declared as
>     <StandardModule()> _
>     Public NotInheritable Class <name>
> while they could be declared as
>     Public Module <name>
> Also note that Classes have constructors while Modules not. (Modules are
> much like static classes in C# but members of Modules have global scope.)
> Is there any reason to declare Modules as Classes?
> Kornél
> _______________________________________________
> Mono-vb mailing list
> Mono-vb at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-vb

Rafael "Monoman" Teixeira
"The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man." George Bernard Shaw

More information about the Mono-vb mailing list