A blatant and reckless use of .NET Cache
-
Today, I was reviewing the code of a particular module that a vendor who I had outsourced the product had delivered. There was one interesting line. He is reading input from .NET Cache. Good! He is trying to enhance the performance instead of making a costly remoting call. He is also making a not null check after getting the elements from cache. It sounds still good right? Well! Now the fun is; there is nothing to handle when cache is null. When I contacted him for this reckless coding horror, the coolest reply was '
IIS needs to be reset when cache gets emptied
'. Is guillotine available in India?Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson -
Today, I was reviewing the code of a particular module that a vendor who I had outsourced the product had delivered. There was one interesting line. He is reading input from .NET Cache. Good! He is trying to enhance the performance instead of making a costly remoting call. He is also making a not null check after getting the elements from cache. It sounds still good right? Well! Now the fun is; there is nothing to handle when cache is null. When I contacted him for this reckless coding horror, the coolest reply was '
IIS needs to be reset when cache gets emptied
'. Is guillotine available in India?Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis LevinsonVasudevan Deepak K wrote:
Is guillotine available in India?
That's too humane. North Korea is always available as a harsher alternative.
ROFLOLMFAO
-
Today, I was reviewing the code of a particular module that a vendor who I had outsourced the product had delivered. There was one interesting line. He is reading input from .NET Cache. Good! He is trying to enhance the performance instead of making a costly remoting call. He is also making a not null check after getting the elements from cache. It sounds still good right? Well! Now the fun is; there is nothing to handle when cache is null. When I contacted him for this reckless coding horror, the coolest reply was '
IIS needs to be reset when cache gets emptied
'. Is guillotine available in India?Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinsonanother example of promising the earth and cutting quality corners to meet the targets.. its just a case of a "developer" being lazy
-
Today, I was reviewing the code of a particular module that a vendor who I had outsourced the product had delivered. There was one interesting line. He is reading input from .NET Cache. Good! He is trying to enhance the performance instead of making a costly remoting call. He is also making a not null check after getting the elements from cache. It sounds still good right? Well! Now the fun is; there is nothing to handle when cache is null. When I contacted him for this reckless coding horror, the coolest reply was '
IIS needs to be reset when cache gets emptied
'. Is guillotine available in India?Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson -
Today, I was reviewing the code of a particular module that a vendor who I had outsourced the product had delivered. There was one interesting line. He is reading input from .NET Cache. Good! He is trying to enhance the performance instead of making a costly remoting call. He is also making a not null check after getting the elements from cache. It sounds still good right? Well! Now the fun is; there is nothing to handle when cache is null. When I contacted him for this reckless coding horror, the coolest reply was '
IIS needs to be reset when cache gets emptied
'. Is guillotine available in India?Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis LevinsonVasudevan Deepak K wrote:
When I contacted him for this reckless coding horror, the coolest reply was 'IIS needs to be reset when cache gets emptied'.
:eek:
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
-
another example of promising the earth and cutting quality corners to meet the targets.. its just a case of a "developer" being lazy
PeterTheGreat wrote:
another example of promising the earth and cutting quality corners to meet the targets.. its just a case of a "developer" being lazy
Yes, and probably a you-get-what-you-pay-for kind of thing, too.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
-
Today, I was reviewing the code of a particular module that a vendor who I had outsourced the product had delivered. There was one interesting line. He is reading input from .NET Cache. Good! He is trying to enhance the performance instead of making a costly remoting call. He is also making a not null check after getting the elements from cache. It sounds still good right? Well! Now the fun is; there is nothing to handle when cache is null. When I contacted him for this reckless coding horror, the coolest reply was '
IIS needs to be reset when cache gets emptied
'. Is guillotine available in India?Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis LevinsonI cant tell you how many of these ive cleaned up in recent months:
if(HttpContext.Current.Cache["someKey"] != null) { SomeClass someClass = (SomeClass)HttpContext.Current.Cache["someKey"]; // do something with someClass instance }
The problem being that occasionaly the cache item is expired between lines 1 & 2 leading to rather hard to spot null instance exceptions when trying to use someClass.