.NET
While continuing my review adventures I encountered the following lines of code (I replaced the names of the objects): Hashtable myHash = new Hashtable(); myHash = Foo.GetHash(); Can you spot the issue? One hint: GC. Cross-posted from The .NET Aficionado...
Today I was reviewing some code. Now who can spot the exception that can be thrown in the finally block? I will give you a couple of hints: To prevent exceptions from being thrown the Open-Closed principle needs to be violated The second hint is directly related to the solution: RTTI using(IDbTransaction transaction = connection.BeginTransaction... { IDbDataAdapter dataAdapter = null; try { dataAdapter = CreateDataAdapter(); dataAdapter.UpdateCommand = updateCommand; dataAdapter.UpdateCommand.C...
In case that you need a timer you can choose between 3 types in the Base Class Library:System.Timers.Timer... timer you should use to solve your problem depends on the problem you are trying to solve. I have found an article on the MSDN Magazine of February 2004 written by Alex Calvo which compares the 3 timers and outlines when to use which timer:http://msdn.microsoft... Cross-posted from The .NET Aficionado...