Skip to main content

All Questions

-1 votes
3 answers
873 views

Would Injecting dependencies in C# as default parameters be a bad practice?

Given the (old) debate over whether Singletons are overused/abused/are worth it - would it be a bad idea to inject the dependencies as default parameters? In this way, we could get rid of defining ...
Veverke's user avatar
  • 491
0 votes
1 answer
583 views

Methods linking bad/good practices

I have multiple methods calling each other to simplify changing anything in the code and to avoid fixing errors and copy pasting. It looks like this: Is this a bad practice? Does it cause too much ...
Candid Moon _Max_'s user avatar
40 votes
6 answers
38k views

Try/Catch/Log/Rethrow - Is Anti Pattern?

I can see several post where importance of handling exception at central location or at process boundary been emphasized as a good practice rather than littering every code block around try/catch. I ...
rahulaga-msft's user avatar
4 votes
4 answers
7k views

Exceptions vs ErrorCodes when working with devices

Out team is at the cusp of a new project. One of the components at the boundary of the system is the component which interacts with a printer through an external COM component (referenced as a usual ...
EngineerSpock's user avatar
36 votes
5 answers
68k views

Is it a good practice to create a ClassCollection of another Class?

Lets says I have a Carclass: public class Car { public string Engine { get; set; } public string Seat { get; set; } public string Tires { get; set; } } Lets say we're making a system ...
Luis's user avatar
  • 535