• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Object Oriented Development vs Practicality

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #21
    Originally posted by AtW
    Surely this won't cause endless recursion?
    No it doesn't. It just sticks 2 things on the call stack and 2 out of scope operations to increment a value. Effectively it runs:

    void set_Property(int value) { this.property = value; }
    int get_Property() { return this.property; }

    set_Property(get_Property() + 1);

    Stick it in a loop - blam! Crap performance. I'd compile it and dump the IL code out using reflector but I'm on a mac at the moment and playing with Objective C instead.

    I don't like properties - they obscure some performance problems.
    Serving religion with the contempt it deserves...

    Comment


      #22
      Why use C# if you're only interested in performance, use C++ or C. Things like properties are there to allow proper object oriented implementation.

      Comment


        #23
        Originally posted by Diestl
        Why use C# if you're only interested in performance, use C++ or C. Things like properties are there to allow proper object oriented implementation.
        Very insightful!
        Serving religion with the contempt it deserves...

        Comment


          #24
          thanks

          Comment


            #25
            Originally posted by Diestl
            thanks
            My pleasure.

            I entirely agree with your point. I'm actually learning Objective C at the moment (OO layer on top of C basically). Less convoluted than C++...
            Serving religion with the contempt it deserves...

            Comment


              #26
              Yeah properties are performance killer - strange that they are not inlined. Performance wise C# is actually very good - I had some stuff ported to Visual C++ and assembly code generated was not much better.

              Comment


                #27
                Horseshi*t - properties are fine if used in the proper context e.g. graphical components - only an half-ar*ed ruskie would be getting and setting in a performance critical loop involving no other opertations - they are only a few mc ops anyway.

                Comment


                  #28
                  Go look at something shiny jabber.

                  Comment


                    #29
                    Are you some sort of magpie AtW ? I suggest you go back to school and get a proper comp sci education.

                    Comment


                      #30
                      Originally posted by Jabberwocky
                      Are you some sort of magpie AtW ? I suggest you go back to school and get a proper comp sci education.
                      Like my electrical engineering one

                      We're not all native comp sci.
                      Serving religion with the contempt it deserves...

                      Comment

                      Working...
                      X