Linked Questions

7 votes
3 answers
3k views

In OOP such as C# and Java if I were to create a class to do all string manipulation, I know it is better to make all the function static. However when I need to call those functions multiple times, ...
Abraham Putra Prakasa's user avatar
3 votes
2 answers
2k views

Performance-wise is there any difference on doing this?: public static Class StaticTestClass() { public static void Function(object param) => //Do stuff with "param" } and this: public ...
Pau C's user avatar
  • 783
3 votes
1 answer
367 views

Would there be a difference in performance or memory if I used static classes in an object that has many instances? Let's say I have thousands of instances and each is responsible for doing many ...
Daniel's user avatar
  • 1,144
427 votes
14 answers
89k views

ReSharper likes to point out multiple functions per ASP.NET page that could be made static. Does it help me if I do make them static? Should I make them static and move them to a utility class?
dlamblin's user avatar
  • 45.6k
34 votes
7 answers
24k views

I'm working on a project in C#. The previous programmer didn't know object oriented programming, so most of the code is in huge files (we're talking around 4-5000 lines) spread over tens and sometimes ...
deadtime's user avatar
  • 1,200
32 votes
2 answers
21k views

My whole development team thinks, static methods are a terrible thing to use. I really don't see any disadvantages in some cases. When I needed a stateless method before, I always used static methods ...
Jannik's user avatar
  • 2,439
8 votes
6 answers
16k views

I need to have method to get something from a database, but I don't understand the difference between static and normal functions in PHP. Example code class Item { public static function ...
Hacker Dewdie's user avatar
2 votes
2 answers
300 views

I have the main class: class MainClass { public static void Main() { InputForm InputForm1 = new InputForm(); InputForm1.ShowDialog(); // show interface to prompt user } } ...
mickG's user avatar
  • 335
0 votes
1 answer
674 views

I am not too familiar with Java. I have the following question. I have seen similar posts on SO on this. What I am asking may be a bit different. If I have the following situation public class A { ...
user2125853's user avatar
  • 1,345
1 vote
3 answers
140 views

Straight up question: If I run code analysis, it tells me to make methods static even in nonstatic classes. As far as I know, static methods are JITed and run on the Type-Object in the Heap. So wouldn'...
Matthias Müller's user avatar
0 votes
1 answer
152 views

I currently am working on a project(Console Application) that consists of a number of classes. None of these classes contain any properties. They just contain a number of methods. Example: Say I ...
spdcbr's user avatar
  • 375
0 votes
0 answers
88 views

I'm just wondering whether there is any difference in performance for accessing properties of a static instead of non-static class? Let's say I have to classes private class Book1 { public const ...
Grentley's user avatar
  • 437
0 votes
0 answers
50 views

I Have a class called car, this class have multiple methods (about 30) to handle things such: starting car, stopping, opening doors ... The problem is that my program have thousands of instances of ...
Mohammed Sitni's user avatar