I have a set of items, and each item in the set must be unique. Item are composed from multiple properties and each property of each item can be changed. But after each change every item in the set must still be unique.Should I simply try to change the property:int err = setOfItems.SetPropertyOfItem( item, property, newValue )if ( err != 0 ) {    MessageBox( You cannot change property to this value );          return;}// ( ...or similar exception based code )Or should I first check if the property can be changed and only then change it:if ( !setOfItems.CanBePropertyChanged( item, property, newValue ) ) {    MessageBox( You cannot change property to this value );          return;}setOfItems.SetPropertyOfItem( item, property, newValue );Which approach is better and why?
Should I try it straight or should I first check if it can be done?
java;c#;c++