| re: writing a Sub versus writing a Function with no return value
Mark,
As Herfried suggests, have you looked at the code with ildasm.exe?
They are not identical, there is overhead in the function for the return
value, although you never explicitly use or set the return value, VB.NET
implicitly sets the return value.
Further I totally agree with Jeremy. Write code that indicates the intent.
If you have a 'function' that does not return a value, then make it a sub.
In 6 months you will be happier, and any one who takes over you code will be
happier. Otherwise someone may be spending the day, cursing your name 'This
routine never returns a value, what value should we be returning' :-)
Just a thought
Jay
"Mark Kamoski" <mkamoski@yahoo.com> wrote in message
news:%23K$19RiRDHA.2768@tk2msftngp13.phx.gbl...[color=blue]
>
> Hi Everyone.
>
> What is the real difference between writing a Sub versus writing a[/color]
Function[color=blue]
> with no return value?
>
> It seems to me that both of these would need to compile to the same IL, so
> it seems they are identical.
>
> Please advise.
>
> Thank you.
>
> --Mark.
>
>[/color] |