• 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!

Code reviews

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

    Originally posted by MyUserName View Post
    Why do you think that?
    All costs? no. Most of the time? sure.

    Comment


      Originally posted by woohoo View Post
      I agree with you but it could be argued in this example that IsCardVerified could be a public method on a class called CardVerification. CardVerification could be passed into your class in the constructor. This would enable this common code to be used through out your app and other apps. BUT I would only do this for code that would be reused out side of calling class.
      It was just an example to show private methods properly named makes reading code easier.

      Comment


        Originally posted by SpontaneousOrder View Post
        Yes it would. I just mean that "encapsulating" data by making it private but then just adding a public mutator/accessor in front of it is not really encapsulation at all - it's a token gesture to make yourself feel better.
        Agreed. Just making data private and then always providing a mutator is not really encapsulating it. It is normally the hallmark that someone has missed the point slightly.

        Originally posted by SpontaneousOrder
        All costs? no. Most of the time? sure.
        Agreed again. It does get overused, particularly by newer programmers. It has it's place though like most things.
        "He's actually ripped" - Jared Padalecki

        https://youtu.be/l-PUnsCL590?list=PL...dNeCyi9a&t=615

        Comment


          Originally posted by suityou01 View Post
          Indeed. In C#4 et seq you don't even declare accessors as it just does it all for you.
          Presumably you can tell it not to, and still write custom accessors if you need to?
          Originally posted by MaryPoppins
          I'd still not breastfeed a nazi
          Originally posted by vetran
          Urine is quite nourishing

          Comment


            Originally posted by d000hg View Post
            Presumably you can tell it not to, and still write custom accessors if you need to?
            Is it like groovy? it adds them behind the scenes automatically unless you specify your own?

            Comment


              Originally posted by MyUserName View Post
              It does get overused, particularly by newer programmers. .
              Particularly by lecturers at schools/college! which is frustrating.
              Presumably most of the lecturers turned to teaching because they weren't very good developers


              I love this poster for the Liskov substitution principle:




              I think the teachers always do a bad job teaching inheritance with their "is a?" approach. In the poster they'd say that the toy duck "is a" duck - but clearly it's not. It's a toy with duck-like attributes.

              Comment


                Originally posted by d000hg View Post
                Presumably you can tell it not to, and still write custom accessors if you need to?
                Yeah but who can be arsed.
                Knock first as I might be balancing my chakras.

                Comment


                  Originally posted by SpontaneousOrder View Post
                  Particularly by lecturers at schools/college! which is frustrating.
                  Presumably most of the lecturers turned to teaching because they weren't very good developers


                  I love this poster for the Liskov substitution principle:




                  I think the teachers always do a bad job teaching inheritance with their "is a?" approach. In the poster they'd say that the toy duck "is a" duck - but clearly it's not. It's a toy with duck-like attributes.
                  You need your to inherit from your base class of single celled organism down through the layers to aquatic birds.
                  Knock first as I might be balancing my chakras.

                  Comment


                    When I was a lad

                    Originally posted by SpontaneousOrder View Post
                    So nothing particularly relevant to the discussion then.
                    I guess I was right!
                    we wrote working code with no defects, how come any time I ask for even the smallest change now, test teams always find bugs from guys like you that know it all.??

                    Comment


                      Originally posted by zeitghost
                      I'm pleased to say that, as a signed up hacker of the 70s generation, I can't understand any of this.

                      And, more to the point, I find I don't care either.
                      But even with this low level of competency you could still piss all over Minestrone.
                      Knock first as I might be balancing my chakras.

                      Comment

                      Working...
                      X