Groups | Blog | Home
all groups > c# > february 2006 >

c# : Static method use


Biren Prajapati
2/8/2006 11:11:11 PM
Hi All,

Is it advisable to make the method static if it is widely used in the
system? Will it increase the performance or decrease the performance?

Thanks,
Biren
Jon Skeet [C# MVP]
2/9/2006 12:00:00 AM
[quoted text, click to view]

It's unlikely to have any significant effect on performance. You should
make the method static or an instance method depending on whether it
logically acts on an instance or not. Think of maintainability,
readability and good design first - you can fix performance of things
like this if and when it becomes an issue. (Architecture is hard to
optimise later on - code is relatively easy.)

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
AddThis Social Bookmark Button