Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. A blatant and reckless use of .NET Cache

A blatant and reckless use of .NET Cache

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpcomwindows-adminperformancequestion
7 Posts 6 Posters 26 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vasudevan Deepak Kumar
    wrote on last edited by
    #1

    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

    R C L P J 5 Replies Last reply
    0
    • V Vasudevan Deepak Kumar

      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

      R Offline
      R Offline
      Ri Qen Sin
      wrote on last edited by
      #2

      Vasudevan Deepak K wrote:

      Is guillotine available in India?

      That's too humane. North Korea is always available as a harsher alternative.

      ROFLOLMFAO

      1 Reply Last reply
      0
      • V Vasudevan Deepak Kumar

        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

        C Offline
        C Offline
        CARPETBURNER
        wrote on last edited by
        #3

        another example of promising the earth and cutting quality corners to meet the targets.. its just a case of a "developer" being lazy

        P 1 Reply Last reply
        0
        • V Vasudevan Deepak Kumar

          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

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          This guy walks into a bar and...

          1 Reply Last reply
          0
          • V Vasudevan Deepak Kumar

            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

            P Offline
            P Offline
            Paul Conrad
            wrote on last edited by
            #5

            Vasudevan 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

            1 Reply Last reply
            0
            • C CARPETBURNER

              another example of promising the earth and cutting quality corners to meet the targets.. its just a case of a "developer" being lazy

              P Offline
              P Offline
              Paul Conrad
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • V Vasudevan Deepak Kumar

                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

                J Offline
                J Offline
                J4amieC
                wrote on last edited by
                #7

                I 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.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups