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. Flags constants and new version

Flags constants and new version

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpasp-netcomquestionannouncement
2 Posts 2 Posters 14 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.
  • R Offline
    R Offline
    Rama Krishna Vavilala
    wrote on last edited by
    #1

    I was responsible for this horror: Version 1.0 I had the following:

    const DWORD ACCESS_NONE = 0;
    const DWORD ACCESS_VIEW = 1;
    const DWORD ACCESS_MODIFY = ACCESS_VIEW | 2;
    const DWORD ACCESS_DELETE = ACCESS_VIEW | 4;
    const DWORD ACCESS_ALL = ACCESS_VIEW | ACCESS_MODIFY | ACCESS_DELETE;
    const DWORD ACCESS_ADMIN = ACCESS_ALL;

    I needed ACCESS_EXECUTE in the next version of the software. So I declared:

    const DWORD ACCESS_EXECUTE = 8; //Execute may not need view
    const DWORD ACCESS_ALL = ACCESS_VIEW | ACCESS_MODIFY | ACCESS_DELETE | ACCESS_EXECUTE;

    const DWORD ACCESS_ADMIN = ACCESS_ALL; Where is the horror? We promised the user that old databases and files will run without any changes.

    Co-Author ASP.NET AJAX in Action CP Quote of the Day: It is the same Friday that blooms as a new enriching day with novelty and innovation for us every week. - Vasudevan Deepak Kumar

    CPalliniC 1 Reply Last reply
    0
    • R Rama Krishna Vavilala

      I was responsible for this horror: Version 1.0 I had the following:

      const DWORD ACCESS_NONE = 0;
      const DWORD ACCESS_VIEW = 1;
      const DWORD ACCESS_MODIFY = ACCESS_VIEW | 2;
      const DWORD ACCESS_DELETE = ACCESS_VIEW | 4;
      const DWORD ACCESS_ALL = ACCESS_VIEW | ACCESS_MODIFY | ACCESS_DELETE;
      const DWORD ACCESS_ADMIN = ACCESS_ALL;

      I needed ACCESS_EXECUTE in the next version of the software. So I declared:

      const DWORD ACCESS_EXECUTE = 8; //Execute may not need view
      const DWORD ACCESS_ALL = ACCESS_VIEW | ACCESS_MODIFY | ACCESS_DELETE | ACCESS_EXECUTE;

      const DWORD ACCESS_ADMIN = ACCESS_ALL; Where is the horror? We promised the user that old databases and files will run without any changes.

      Co-Author ASP.NET AJAX in Action CP Quote of the Day: It is the same Friday that blooms as a new enriching day with novelty and innovation for us every week. - Vasudevan Deepak Kumar

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      the check:

      if ((access & ACCESS_ALL) == ACCESS_ALL)

      will fail on (even ACCESS_ALL) old files. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      In testa che avete, signor di Ceprano?

      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