Statics
-
Has anyone ever come across and entire project where every class, every function is a static, for no good reason at all. Just a ton of statics and delegates and that is it. It is a pretty large project.
Sounds ideal to me; why use OOP when you don't need it?
-
Has anyone ever come across and entire project where every class, every function is a static, for no good reason at all. Just a ton of statics and delegates and that is it. It is a pretty large project.
System.Xml.Linq
-
Has anyone ever come across and entire project where every class, every function is a static, for no good reason at all. Just a ton of statics and delegates and that is it. It is a pretty large project.
-
Has anyone ever come across and entire project where every class, every function is a static, for no good reason at all. Just a ton of statics and delegates and that is it. It is a pretty large project.
Why, yes, I have seen a project with everything that could be made static was made static, but they did have a reason. When I asked why all those methods were static, I was told "so that they can be called by an outside program". I didn't say they had a good reason. :sigh:
Just because the code works, it doesn't mean that it is good code.
-
Has anyone ever come across and entire project where every class, every function is a static, for no good reason at all. Just a ton of statics and delegates and that is it. It is a pretty large project.
Not everything, but really a lot: WPF.
-
System.Xml.Linq
I just went to http://msdn.microsoft.com/en-us/library/system.xml.linq.extensions.aspx[^]. Other few classes are OK though.
-
Has anyone ever come across and entire project where every class, every function is a static, for no good reason at all. Just a ton of statics and delegates and that is it. It is a pretty large project.
One place I interviewed at a few years ago showed me their code -- every class was a Singleton! :omg: -- I didn't ask for the job.
-
Has anyone ever come across and entire project where every class, every function is a static, for no good reason at all. Just a ton of statics and delegates and that is it. It is a pretty large project.
Once upon a time Manager: Show me your design diagrams. Developer: Here they are but I am still working on it. Manager: Where is the class for our front page. Developer: (confused) That would be a static page so we dont need the classes. Manager: OK now you work on task 2. i will get this one done by developer 2. Later that day Developer2: Is it complete Manager: yes. Developer2: where are the relationships between classes? Manager: hmm, well all these classes and functions are static so we don't need them. **Developer2:**WHAT? Manager: yes now go and do it before I sack you.
-
Has anyone ever come across and entire project where every class, every function is a static, for no good reason at all. Just a ton of statics and delegates and that is it. It is a pretty large project.
My boss recently got the habit of making a 'helper class' for just about anything. Each helper class has one shared (static) function that is usually called in just one place in the code. Even the helper classes have helper classes and each class is a seperate file sometimes even in seperate folders... :sigh: I am guessing he does this because classes now have a 'single responsibility'. Mixing up 'single method' and 'single responibility' is a common mistake I think. It especially doesn't hold true if all methods are shared (static). I'm also not about to argue about it with him. If he comes up with this kind of stuff you can imagine what kind of programmer he is: one that simply doesn't understand.
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
} -
Has anyone ever come across and entire project where every class, every function is a static, for no good reason at all. Just a ton of statics and delegates and that is it. It is a pretty large project.
Shocking!
public class SysAdmin : Employee
{public override void DoWork(IWorkItem workItem) { if (workItem.User.Type == UserType.NoLearn){ throw new NoIWillNotFixYourComputerException(new Luser(workItem.User)); }else{ base.DoWork(workItem); } }
}