compiler construction - Why isn't there "is not" keyword in c#? -
it makes sense check if object not type of x, need instead:
if(this.gettype() != typeof(x)) { //do thing. } which bit cumbersome opinion, not nicer:
if(this not x) { //do thing }
how logical not operator !, fits description of word 'not' fine:
if (!(this x)) { //do thing } as others have pointed out though, is used check if object's class inherits class or implements interface, rather different gettype().
both codeinchaos , striplingwarrior have reasonable explanations why there isn't not keyword in c#.
Comments
Post a Comment