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. QA blooper

QA blooper

Scheduled Pinned Locked Moved The Weird and The Wonderful
beta-testing
9 Posts 7 Posters 0 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.
  • S Offline
    S Offline
    Sascha Lefevre
    wrote on last edited by
    #1
    public int val2
    {
        get
        {
            return val2;
        }
        set
        {
            val2 = 10;
        }
    }
    

    :rolleyes:

    If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

    K P N 3 Replies Last reply
    0
    • S Sascha Lefevre
      public int val2
      {
          get
          {
              return val2;
          }
          set
          {
              val2 = 10;
          }
      }
      

      :rolleyes:

      If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

      K Offline
      K Offline
      Kyle Moyer
      wrote on last edited by
      #2

      Maybe there was a requirement to not use const?

      S 1 Reply Last reply
      0
      • S Sascha Lefevre
        public int val2
        {
            get
            {
                return val2;
            }
            set
            {
                val2 = 10;
            }
        }
        

        :rolleyes:

        If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

        P Offline
        P Offline
        phil o
        wrote on last edited by
        #3

        I'm surprised this code compiles, as there is a circular reference in the getter.

        You always obtain more by being rather polite and armed than polite only.

        S F S 3 Replies Last reply
        0
        • K Kyle Moyer

          Maybe there was a requirement to not use const?

          S Offline
          S Offline
          Sascha Lefevre
          wrote on last edited by
          #4

          No, the requirement was to create a public get/set property named Value2 for a private field named value2 and to use that property to set value2 to a value of 10 - but from outside the containing class..

          If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

          1 Reply Last reply
          0
          • P phil o

            I'm surprised this code compiles, as there is a circular reference in the getter.

            You always obtain more by being rather polite and armed than polite only.

            S Offline
            S Offline
            Sascha Lefevre
            wrote on last edited by
            #5

            Yep, the compiler will let you run into a SO-exception without turning a hair :laugh:

            If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

            1 Reply Last reply
            0
            • P phil o

              I'm surprised this code compiles, as there is a circular reference in the getter.

              You always obtain more by being rather polite and armed than polite only.

              F Offline
              F Offline
              F ES Sitecore
              wrote on last edited by
              #6

              Alas it does, I've lost many an hour to it :D

              1 Reply Last reply
              0
              • P phil o

                I'm surprised this code compiles, as there is a circular reference in the getter.

                You always obtain more by being rather polite and armed than polite only.

                S Offline
                S Offline
                Sentenryu
                wrote on last edited by
                #7

                there's one in the setter too.

                1 Reply Last reply
                0
                • S Sascha Lefevre
                  public int val2
                  {
                      get
                      {
                          return val2;
                      }
                      set
                      {
                          val2 = 10;
                      }
                  }
                  

                  :rolleyes:

                  If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

                  N Offline
                  N Offline
                  Nathan Minier
                  wrote on last edited by
                  #8

                  I strongly suspect that nugget of joy was written by someone who typically writes in JavaScript. Or maybe a cat walking across the keyboard. Any other answer would be insane...

                  B 1 Reply Last reply
                  0
                  • N Nathan Minier

                    I strongly suspect that nugget of joy was written by someone who typically writes in JavaScript. Or maybe a cat walking across the keyboard. Any other answer would be insane...

                    B Offline
                    B Offline
                    Brisingr Aerowing
                    wrote on last edited by
                    #9

                    Or someone who has no idea what he is doing and is playing games in class and not paying attention to the professor.

                    What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???

                    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