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. The Lounge
  3. Good Practise?

Good Practise?

Scheduled Pinned Locked Moved The Lounge
question
25 Posts 13 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.
  • D Dalek Dave

    When you alter/edit/revise code, which is better, to delete the old code or to comment it out so you can see the evolution when you go back some time later?

    ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

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

    Yes. Very well, then... As others have said; delete it. I might add that if you tried to do it a particular way and it screwed things up, you may want to add a notation to that effect to keep the same problem from happening again.

    modified on Wednesday, April 21, 2010 7:09 PM

    D 1 Reply Last reply
    0
    • P PIEBALDconsult

      Yes. Very well, then... As others have said; delete it. I might add that if you tried to do it a particular way and it screwed things up, you may want to add a notation to that effect to keep the same problem from happening again.

      modified on Wednesday, April 21, 2010 7:09 PM

      D Offline
      D Offline
      Dalek Dave
      wrote on last edited by
      #3

      Edited, smartarse :)

      ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

      1 Reply Last reply
      0
      • D Dalek Dave

        When you alter/edit/revise code, which is better, to delete the old code or to comment it out so you can see the evolution when you go back some time later?

        ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

        A Offline
        A Offline
        AspDotNetDev
        wrote on last edited by
        #4

        The code should reflect the most recent functionality, and comments should describe what the code is intended to do. Use version control (e.g., Subversion and TortoiseSVN) to keep track of changes to code. Do not leave old code commented out in your new code. Delete it.

        [Forum Guidelines]

        D L 2 Replies Last reply
        0
        • A AspDotNetDev

          The code should reflect the most recent functionality, and comments should describe what the code is intended to do. Use version control (e.g., Subversion and TortoiseSVN) to keep track of changes to code. Do not leave old code commented out in your new code. Delete it.

          [Forum Guidelines]

          D Offline
          D Offline
          Dalek Dave
          wrote on last edited by
          #5

          Thank you. As many know I am an accountant by trade, not a developer, but learning quickly and it is little things like this that help. Thanks for your time.

          ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

          R 1 Reply Last reply
          0
          • D Dalek Dave

            When you alter/edit/revise code, which is better, to delete the old code or to comment it out so you can see the evolution when you go back some time later?

            ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

            D Offline
            D Offline
            Douglas Troy
            wrote on last edited by
            #6

            We always remove old code, since everything is in a source control system. If need be, we can look back over changes, compare contents, etc.etc.etc.


            :..::. Douglas H. Troy ::..
            Bad Astronomy |VCF|wxWidgets|WTL

            P 1 Reply Last reply
            0
            • D Dalek Dave

              When you alter/edit/revise code, which is better, to delete the old code or to comment it out so you can see the evolution when you go back some time later?

              ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #7

              Delete it. You shouldn't leave old code stinking up the woodpile.

              "WPF has many lovers. It's a veritable porn star!" - Josh Smith

              As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

              My blog | My articles | MoXAML PowerToys | Onyx

              1 Reply Last reply
              0
              • D Douglas Troy

                We always remove old code, since everything is in a source control system. If need be, we can look back over changes, compare contents, etc.etc.etc.


                :..::. Douglas H. Troy ::..
                Bad Astronomy |VCF|wxWidgets|WTL

                P Offline
                P Offline
                Pete OHanlon
                wrote on last edited by
                #8

                Douglas Troy wrote:

                everything is in a source control system

                Versioning is for the weak of memory.

                "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                My blog | My articles | MoXAML PowerToys | Onyx

                D C 2 Replies Last reply
                0
                • P Pete OHanlon

                  Douglas Troy wrote:

                  everything is in a source control system

                  Versioning is for the weak of memory.

                  "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                  As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                  My blog | My articles | MoXAML PowerToys | Onyx

                  D Offline
                  D Offline
                  Dalek Dave
                  wrote on last edited by
                  #9

                  Better solution?

                  ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                  A 1 Reply Last reply
                  0
                  • D Dalek Dave

                    When you alter/edit/revise code, which is better, to delete the old code or to comment it out so you can see the evolution when you go back some time later?

                    ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                    T Offline
                    T Offline
                    TheGreatAndPowerfulOz
                    wrote on last edited by
                    #10

                    Delete! To see the evolution, look in source repository!

                    Fight Big Government:
                    http://obamacareclassaction.com/
                    http://obamacaretruth.org/

                    D 1 Reply Last reply
                    0
                    • T TheGreatAndPowerfulOz

                      Delete! To see the evolution, look in source repository!

                      Fight Big Government:
                      http://obamacareclassaction.com/
                      http://obamacaretruth.org/

                      D Offline
                      D Offline
                      Dalek Dave
                      wrote on last edited by
                      #11

                      seems to be the concensus.

                      ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                      1 Reply Last reply
                      0
                      • D Dalek Dave

                        Better solution?

                        ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                        A Offline
                        A Offline
                        AspDotNetDev
                        wrote on last edited by
                        #12

                        I'm fairly certain he's joking. :)

                        [Forum Guidelines]

                        D 1 Reply Last reply
                        0
                        • A AspDotNetDev

                          I'm fairly certain he's joking. :)

                          [Forum Guidelines]

                          D Offline
                          D Offline
                          Dalek Dave
                          wrote on last edited by
                          #13

                          They don't have sarcasm on my planet.

                          ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                          A 1 Reply Last reply
                          0
                          • D Dalek Dave

                            They don't have sarcasm on my planet.

                            ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                            A Offline
                            A Offline
                            AspDotNetDev
                            wrote on last edited by
                            #14

                            Really? What planet are you from?

                            [Forum Guidelines]

                            D L 2 Replies Last reply
                            0
                            • A AspDotNetDev

                              Really? What planet are you from?

                              [Forum Guidelines]

                              D Offline
                              D Offline
                              Dalek Dave
                              wrote on last edited by
                              #15

                              Fintlewoodlewix

                              ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                              1 Reply Last reply
                              0
                              • A AspDotNetDev

                                The code should reflect the most recent functionality, and comments should describe what the code is intended to do. Use version control (e.g., Subversion and TortoiseSVN) to keep track of changes to code. Do not leave old code commented out in your new code. Delete it.

                                [Forum Guidelines]

                                L Offline
                                L Offline
                                Luc Pattyn
                                wrote on last edited by
                                #16

                                right. keeping old code, even in comment, confuses the reader, results in false search hits, and in general has no use at all. Less is definitely more. and that also applies to old comments! :)

                                Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                                Prolific encyclopedia fixture proof-reader browser patron addict?
                                We all depend on the beast below.


                                1 Reply Last reply
                                0
                                • A AspDotNetDev

                                  Really? What planet are you from?

                                  [Forum Guidelines]

                                  L Offline
                                  L Offline
                                  Luc Pattyn
                                  wrote on last edited by
                                  #17

                                  I guess DD is from Dark Drivelus, an obscure nebula beyond Orion; some call it Skaro. :)

                                  Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                                  Prolific encyclopedia fixture proof-reader browser patron addict?
                                  We all depend on the beast below.


                                  1 Reply Last reply
                                  0
                                  • D Dalek Dave

                                    When you alter/edit/revise code, which is better, to delete the old code or to comment it out so you can see the evolution when you go back some time later?

                                    ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                                    C Offline
                                    C Offline
                                    Chris Austin
                                    wrote on last edited by
                                    #18

                                    Delete it and preserve the history in your revision control system. Lots of commented out code looks extremely unprofessional in a production code base IMO.

                                    And above all things, never think that you're not good enough yourself. A man should never think that. My belief is that in life people will take you at your own reckoning. --Isaac Asimov Avoid the crowd. Do your own thinking independently. Be the chess player, not the chess piece. --Ralph Charell

                                    1 Reply Last reply
                                    0
                                    • P Pete OHanlon

                                      Douglas Troy wrote:

                                      everything is in a source control system

                                      Versioning is for the weak of memory.

                                      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                                      As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                                      My blog | My articles | MoXAML PowerToys | Onyx

                                      C Offline
                                      C Offline
                                      Chris Austin
                                      wrote on last edited by
                                      #19

                                      Pete O'Hanlon wrote:

                                      Versioning is for the weak of memory.

                                      That would be me. :) As my wife likes to teas me the most common phrase I say to her is "What are we taking about?"

                                      And above all things, never think that you're not good enough yourself. A man should never think that. My belief is that in life people will take you at your own reckoning. --Isaac Asimov Avoid the crowd. Do your own thinking independently. Be the chess player, not the chess piece. --Ralph Charell

                                      R 1 Reply Last reply
                                      0
                                      • D Dalek Dave

                                        When you alter/edit/revise code, which is better, to delete the old code or to comment it out so you can see the evolution when you go back some time later?

                                        ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                                        D Offline
                                        D Offline
                                        dybs
                                        wrote on last edited by
                                        #20

                                        As many have already said, delete it and use your source control system to be able to get back to it if needed. I would also add, decent log messages for commits are a big plus - makes it a lot easier to find that old code! Dybs

                                        The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen

                                        1 Reply Last reply
                                        0
                                        • D Dalek Dave

                                          Thank you. As many know I am an accountant by trade, not a developer, but learning quickly and it is little things like this that help. Thanks for your time.

                                          ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                                          R Offline
                                          R Offline
                                          RichardM1
                                          wrote on last edited by
                                          #21

                                          Well, when you went back and cooked the books to be right, did you leave the old, wrong entries, or did you make it look like it had been right the whole time? ;P

                                          Opacity, the new Transparency.

                                          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