I am reading some settings from a config file that would be setup by different developers. They can choose to add different settings and leave out other ones. In by abstract classes constructor, I want to read those settings, but I don't want to fail if they don't exist. So my question is, which is more efficient: using a try with an empty catch block, or using a try with an empty finally block? Again, I don't want to do anything if there's an exception.
Example:
OrCode:try { writeDebugLog = ConfigSectionHandler.ReadSetting(AppSection, SettingKeyWriteDebugLog, false); } catch { }
Code:try { writeDebugLog = ConfigSectionHandler.ReadSetting(AppSection, SettingKeyWriteDebugLog, false); } finally { }




Reply With Quote