Click here to Skip to main content
15,891,431 members

Comments by SoftwareMonkeys (Top 11 by date)

SoftwareMonkeys 3-Feb-12 1:30am View    
Deleted
Ah that could be a useful little function. Thanks for posting. I would consider modifying it slightly so I'll post the alternative to get feedback.
SoftwareMonkeys 30-Jan-12 16:22pm View    
Deleted
How so?
I just activate debug logging, then run one of the automated tests, then go through the logs to track down the problem.
This approach makes the application more easily unit testable, which IMO makes it far easier to test and debug than any project I worked on without this much automated testing.
SoftwareMonkeys 30-Jan-12 16:18pm View    
Deleted
The performance hit of the code that gets executed (which is just an if statement) should be insignificant compared to the other performance hot spots like accessing databases and files. The approach is geared to allow for unit testing and I'm yet to see a unit testable alternative that doesn't require you to recompile and re-test the application in debug mode (which would make be a pain).
Can someone please post a unit testable alternative that they consider "good design"?
So far I'm happy to sacrifice an unnoticeable amount of performance hit in return for an application that is easy to unit test.
And the logging system that uses this ModeDetector gets unit tested every time I run the automated tests even though I run them in Release mode, so having it unit testable helps to ensure nothing gets broken. I'm not going to sacrifice that unit testability to try and gain a minuscule performance benefit but if someone can show me a better performance alternative I'll be happy to see it.
Having said that. I'm sure there are plenty of cases where you DON'T want to use this method because you really do want to avoid having the code compile into the dll. Use the right tool for the job.
SoftwareMonkeys 30-Jan-12 5:10am View    
Deleted
Can you please explain why? And explain the alternatives for achieving the same results? In particular the ability to unit test without having to recompile in debug mode.
SoftwareMonkeys 30-Jan-12 4:34am View    
Deleted
@Pablo - True but doing it directly like that makes it tricky to unit test.