What a fright!!
-
Found this in the daily WTF.
private IAlertDocument CompareObjectAsIAlertDocumentOrNullIfNotCastable(object compareObject) {
return compareObject as IAlertDocument;
}What do you think? I can follow this pattern:
string GetAStringThatRepresentsTheObjectPassedAsAnObjectParameterSoItWorksForAnyObject(object obj)
{
return obj.ToString();
} -
Found this in the daily WTF.
private IAlertDocument CompareObjectAsIAlertDocumentOrNullIfNotCastable(object compareObject) {
return compareObject as IAlertDocument;
}What do you think? I can follow this pattern:
string GetAStringThatRepresentsTheObjectPassedAsAnObjectParameterSoItWorksForAnyObject(object obj)
{
return obj.ToString();
}_Erik_ wrote:
string GetAStringThatRepresentsTheObjectPassedAsAnObjectParameterSoItWorksForAnyObject(object obj) { return obj.ToString(); }
You forgot part of the method name... It should be... GetAStringThatRepresentsTheObjectPassedAsAnObjectParameterSoItWorksForAnyObjectAsLongAsTheObjectIsNotNull
I wasn't, now I am, then I won't be anymore.
-
_Erik_ wrote:
string GetAStringThatRepresentsTheObjectPassedAsAnObjectParameterSoItWorksForAnyObject(object obj) { return obj.ToString(); }
You forgot part of the method name... It should be... GetAStringThatRepresentsTheObjectPassedAsAnObjectParameterSoItWorksForAnyObjectAsLongAsTheObjectIsNotNull
I wasn't, now I am, then I won't be anymore.
-
Found this in the daily WTF.
private IAlertDocument CompareObjectAsIAlertDocumentOrNullIfNotCastable(object compareObject) {
return compareObject as IAlertDocument;
}What do you think? I can follow this pattern:
string GetAStringThatRepresentsTheObjectPassedAsAnObjectParameterSoItWorksForAnyObject(object obj)
{
return obj.ToString();
}Throw new UserFellAsleepAtTheKeyboardException(me)
Dwayne J. Baldwin