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

Passing objects to methods then changing the object's state

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

    Passing objects to methods then changing the object's state

    Why o why are people still doing this and who is teaching these progammers that they are allowed to do this?

    Easily the fastest route to a tulipe codebase.

    Does my fuggin head in.

    </rantOver>

    #2
    Originally posted by minestrone View Post
    Why o why are people still doing this and who is teaching these progammers that they are allowed to do this?

    Easily the fastest route to a tulipe codebase.

    Does my fuggin head in.

    </rantOver>
    Surely you mean just passing a reference to an object, and not the object itself?

    Surely, Shirley?
    Contracting: more of the money, less of the sh1t

    Comment


      #3
      Just make everything global; then you can do away with silly little things like parameters.

      Comment


        #4
        Originally posted by RasputinDude View Post
        Just make everything global; then you can do away with silly little things like parameters.
        Just stick to primitive types and you don't have this problem

        Comment


          #5
          Originally posted by Ketchup View Post
          Just stick to primitive types and you don't have this problem
          And don't forget to make them all static. That'll help out too.

          Comment


            #6
            Originally posted by RasputinDude View Post
            And don't forget to make them all static. That'll help out too.
            Great suggestion....You should be a lecturer.

            From my experience, education in programming teaches how to write code to solve a problem, it doesn't teach how to structure it, standards and best practices. When I was a perm, i hired a number of graduates, they all completed whatever programming tasks i set them, but the code was atrocious.

            I think it should be mandatory for any programming degree to teach design patterns, the standards and naming conventions for the languages they are teaching and testing, programmers i deal with in all my contracts do not have a clue about testing even thought most claim they "in-depth" experience of TDD.

            Rant over

            Comment


              #7
              People still want to create anemic domain models for some reason, domain logic gets littered all over the code base in random places. That goes had in hand with...

              iAmGoingToTakeThisObjectsAndDoFiftyChangesToIt( aboutToBeAbusedUpTheArseObject ) ;

              which is usually written as...

              setState( user ) ;

              Comment


                #8
                This is why proper programming languages have const.
                Will work inside IR35. Or for food.

                Comment


                  #9
                  I find the Goto method a great lifesaver. Use it all over the place.
                  If you think my attitude stinks, you should smell my fingers.

                  Comment


                    #10
                    Originally posted by hyperD View Post
                    I find the Goto method a great lifesaver. Use it all over the place.
                    Good reading about GOTO statements

                    Code Complete, First Edition
                    Coffee's for closers

                    Comment

                    Working...
                    X