preferred-solution

Best Practice - Removing item from generic collection in C#

I'm using C# in Visual Studio 2008 with .NET 3.5. I have a generic dictionary that maps types of events to a generic list of subscribers. A subscriber can be subscribed to more than one event. private static Dictionary<EventType, List<ISubscriber>> _subscriptions; To remove a subscriber from the subscription list, I can use either o...

What are the pros and cons of checked exception?

Do you prefer checked exception handling like in Java or unchecked exception handling like in C# and why? ...

Difference between Activator.CreateInstance() and typeof(T).InvokeMember() with BindingFlags.CreateInstance

Forgive me if this question has already been asked and answered. Given a class of type T, what is the difference between the following? T myObj = Activator.CreateInstance<T>(); T myObj = typeof(T).InvokeMember(null, BindingFlags.CreateInstance, null, null, null); Is one solution preferred over the other? ...

C# Enum Declaration Format

im new to this and would like to develop sound programming practices. i am wondering if members of an Enum declaration should be all uppercase or just the first letter? thank you. ...

What is the best way to identify which form has been submitted?

Currently, when I design my forms, I like to keep the name of the submit button equal to the id of the form. Then, in my php, I just do if(isset($_POST['submitName'])) in order to check if a form has been submitted and which form has been submitted. Firstly, are there any security problems or design flaws with this method? One problem ...