Is it bad style and/or bad for performance to write code that you know might fail and ignore the exception? For example (in C#):
long l = 1;
try {
l = (long)castObject;
} catch(InvalidCastException e) { }
In this scenario, the programmer doesn't particularly care whether or not an InvalidCastException
is thrown.