Re: Overhead of Shared Subs
- From: Göran Andersson <guffa@xxxxxxxxx>
- Date: Wed, 15 Aug 2007 15:43:16 +0200
Mick Walker wrote:
I am just wondering, is there some sort of overhead involved in shared or static functions and subs?
No.
I think there must be, otherwise, there would never be any need to create an instance of a class to call one of its member methods., but I would like to know for definate.
You are not thinking object oriented, that's why you don't see the difference.
Instance methods of a class are non-static because they use the data that is stored in the instance. You create the instance to keep data in it, not only to call it's methods.
A method that does not use any data from the instance should be static, so that you don't need to create an unused instance just to call the method.
--
Göran Andersson
_____
http://www.guffa.com
.
- References:
- Overhead of Shared Subs
- From: Mick Walker
- Overhead of Shared Subs
- Prev by Date: Re: web.config
- Next by Date: Re: Is VB.NET dead?
- Previous by thread: Re: Overhead of Shared Subs
- Next by thread: Retrieving values from typed dataset
- Index(es):