Attention: We are retiring the ASP.NET Community Blogs. Learn more >

sfeldman.NET

.NET, code, personal thoughts

  • TODOs are not forgotten

    We are using Hudson as a build server, and one of the lasts steps that were taken is to mark a build as ‘unstable’ when we pass a certain number of TODO comments in our code (an arbitrary number). While I am not a 100% sold on a number, I think it’s a good way of insuring things are not just marked and forgotten. Actually, we are not even tracking TODOs, but BROKEN_WINDOW comments, as those are definitely bad. Failing on HACK is another possibility. Visualization plays a significant role in my case (interpretation of things based on visualization), and here how it looks (green is all good, yellow is all passed, but number of comments has exceeded the limit).

  • Gallio Warning Output

    Today I was trying to figure out how to access output Gallio is using to render a warning message. According to this, the Assert.Warning was replaced by TestLog.Warning.WriteLine. But for some reason that is not doing the job. Has anyone encountered similar problem?

  • NHibernate Profiler

    Recently I had to update our domain model and it required some NHibernate profiling. I have installed trial version of NHibernate Profiler, and it rocked. The fact that it was not only able to show what was going on, but also give suggestions how to improve NHibernate usage just rocked (unlimited records returned).

  • Disjunction and Conjunction in NHibernate

    Criteria involving multiple ORs and ANDs can quickly become ugly. David showed how some of our code became more readable by using a feature to join multiple ICriterion-s instead of using Restrictions class (as well as how to quickly leverage expressions to get away from using property names, and allow better refactoring by replacing strings with compile-able code).

  • Sending Emails with no SMTP

    I ran into a problem once in a QA environment, and it was unpleasant to handle. Amr ElGarhy has showed a way “baked into” .NET how to overcome issues similar to the one I had – write emails straight into file system. Solutions is elegant and done through configuration file.