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. Someone knows how fast this code can kill your application? [modified]

Someone knows how fast this code can kill your application? [modified]

Scheduled Pinned Locked Moved The Weird and The Wonderful
helpdebuggingquestion
10 Posts 8 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.
  • M Offline
    M Offline
    Marcello Faga
    wrote on last edited by
    #1

    private Pair<RefPoint3d> m_BoundingBox; public Pair<RefPoint3d> BoundingBox { get { **return BoundingBox**; } set { m_BoundingBox = value; } } Did you never define a property in this way? The run-time consequence is amazing: no exceptions at all, and sudden termination of the debug session when you are hovering the call at the property in your client module. PS: the error is inside the get property, because of the not voluntary recursive cycle it generates. PPS: I have no idea how this issue can be coded, the automatic refactoring of VS2005 should make impossible to code malware property.

    **************************** Strong congruence for strong people; with a compatible behaviour. For a semantical way of life.

    modified on Tuesday, June 10, 2008 10:22 AM

    J C P G P 5 Replies Last reply
    0
    • M Marcello Faga

      private Pair<RefPoint3d> m_BoundingBox; public Pair<RefPoint3d> BoundingBox { get { **return BoundingBox**; } set { m_BoundingBox = value; } } Did you never define a property in this way? The run-time consequence is amazing: no exceptions at all, and sudden termination of the debug session when you are hovering the call at the property in your client module. PS: the error is inside the get property, because of the not voluntary recursive cycle it generates. PPS: I have no idea how this issue can be coded, the automatic refactoring of VS2005 should make impossible to code malware property.

      **************************** Strong congruence for strong people; with a compatible behaviour. For a semantical way of life.

      modified on Tuesday, June 10, 2008 10:22 AM

      J Offline
      J Offline
      jamie550
      wrote on last edited by
      #2

      When I was first learning, I did stuff like this: public int Value { get{return Value;} set{Value=value;} } I don't think that I understood that properties were actually methods back then.

      1 Reply Last reply
      0
      • M Marcello Faga

        private Pair<RefPoint3d> m_BoundingBox; public Pair<RefPoint3d> BoundingBox { get { **return BoundingBox**; } set { m_BoundingBox = value; } } Did you never define a property in this way? The run-time consequence is amazing: no exceptions at all, and sudden termination of the debug session when you are hovering the call at the property in your client module. PS: the error is inside the get property, because of the not voluntary recursive cycle it generates. PPS: I have no idea how this issue can be coded, the automatic refactoring of VS2005 should make impossible to code malware property.

        **************************** Strong congruence for strong people; with a compatible behaviour. For a semantical way of life.

        modified on Tuesday, June 10, 2008 10:22 AM

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

        Marcello Faga wrote:

        Someone knows how fast this code can kill your application?

        It depends on the stack size of your application... :-D

        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.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

        1 Reply Last reply
        0
        • M Marcello Faga

          private Pair<RefPoint3d> m_BoundingBox; public Pair<RefPoint3d> BoundingBox { get { **return BoundingBox**; } set { m_BoundingBox = value; } } Did you never define a property in this way? The run-time consequence is amazing: no exceptions at all, and sudden termination of the debug session when you are hovering the call at the property in your client module. PS: the error is inside the get property, because of the not voluntary recursive cycle it generates. PPS: I have no idea how this issue can be coded, the automatic refactoring of VS2005 should make impossible to code malware property.

          **************************** Strong congruence for strong people; with a compatible behaviour. For a semantical way of life.

          modified on Tuesday, June 10, 2008 10:22 AM

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          I think everyone here knows that.

          M 1 Reply Last reply
          0
          • P PIEBALDconsult

            I think everyone here knows that.

            M Offline
            M Offline
            Marcello Faga
            wrote on last edited by
            #5

            Of course PIEBALD, it was a rethorical question ;) . The real question is how someone can have coded that one?

            **************************** Strong congruence for strong people; with a compatible behaviour. For a semantical way of life.

            modified on Wednesday, June 11, 2008 4:54 AM

            O P 2 Replies Last reply
            0
            • M Marcello Faga

              Of course PIEBALD, it was a rethorical question ;) . The real question is how someone can have coded that one?

              **************************** Strong congruence for strong people; with a compatible behaviour. For a semantical way of life.

              modified on Wednesday, June 11, 2008 4:54 AM

              O Offline
              O Offline
              OregonGhost
              wrote on last edited by
              #6

              It's actually very easy, because recursive properties are perfectly legal. And Refactoring doesn't do anything about it, because you have to invoke it manually for a specific Refactoring case. While this is definitely a subtile bug, it is a pretty common one if you are following the basic .NET Framework Naming convention to use PascalCasing for the public property and camelCasing for the private field. Intellisense can even help you to make it wrong, depending on your exact settings and what you typed before. If you put an underscore in front of the field name, it can't happen (or is at least easy to spot).

              N 1 Reply Last reply
              0
              • M Marcello Faga

                Of course PIEBALD, it was a rethorical question ;) . The real question is how someone can have coded that one?

                **************************** Strong congruence for strong people; with a compatible behaviour. For a semantical way of life.

                modified on Wednesday, June 11, 2008 4:54 AM

                P Offline
                P Offline
                PIEBALDconsult
                wrote on last edited by
                #7

                That problem has been presented here or in Subtle Bugs multiple times.

                1 Reply Last reply
                0
                • M Marcello Faga

                  private Pair<RefPoint3d> m_BoundingBox; public Pair<RefPoint3d> BoundingBox { get { **return BoundingBox**; } set { m_BoundingBox = value; } } Did you never define a property in this way? The run-time consequence is amazing: no exceptions at all, and sudden termination of the debug session when you are hovering the call at the property in your client module. PS: the error is inside the get property, because of the not voluntary recursive cycle it generates. PPS: I have no idea how this issue can be coded, the automatic refactoring of VS2005 should make impossible to code malware property.

                  **************************** Strong congruence for strong people; with a compatible behaviour. For a semantical way of life.

                  modified on Tuesday, June 10, 2008 10:22 AM

                  G Offline
                  G Offline
                  Giorgi Dalakishvili
                  wrote on last edited by
                  #8

                  Using automatic properties you won't run in such problem.

                  Giorgi Dalakishvili #region signature my articles #endregion

                  1 Reply Last reply
                  0
                  • O OregonGhost

                    It's actually very easy, because recursive properties are perfectly legal. And Refactoring doesn't do anything about it, because you have to invoke it manually for a specific Refactoring case. While this is definitely a subtile bug, it is a pretty common one if you are following the basic .NET Framework Naming convention to use PascalCasing for the public property and camelCasing for the private field. Intellisense can even help you to make it wrong, depending on your exact settings and what you typed before. If you put an underscore in front of the field name, it can't happen (or is at least easy to spot).

                    N Offline
                    N Offline
                    Nathan Tuggy
                    wrote on last edited by
                    #9

                    That's one reason I hate camel casing. Pascal casing or Hungarian notation is my thing.

                    1 Reply Last reply
                    0
                    • M Marcello Faga

                      private Pair<RefPoint3d> m_BoundingBox; public Pair<RefPoint3d> BoundingBox { get { **return BoundingBox**; } set { m_BoundingBox = value; } } Did you never define a property in this way? The run-time consequence is amazing: no exceptions at all, and sudden termination of the debug session when you are hovering the call at the property in your client module. PS: the error is inside the get property, because of the not voluntary recursive cycle it generates. PPS: I have no idea how this issue can be coded, the automatic refactoring of VS2005 should make impossible to code malware property.

                      **************************** Strong congruence for strong people; with a compatible behaviour. For a semantical way of life.

                      modified on Tuesday, June 10, 2008 10:22 AM

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

                      Oops...

                      "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                      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