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
Brand Logo

agnos.is Forums

  1. Home
  2. Programmer Humor
  3. Been there, done that, would not recommend

Been there, done that, would not recommend

Scheduled Pinned Locked Moved Programmer Humor
programmerhumor
23 Posts 15 Posters 22 Views
  • 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.
  • cows_are_underrated@feddit.orgC This user is from outside of this forum
    cows_are_underrated@feddit.orgC This user is from outside of this forum
    [email protected]
    wrote last edited by
    #1

    Its definitely a bad idea writing new code that builds up on your old code, that has not been tested properly, because you quickly have to start debugging multiple layer is code at once.

    9 A bleistift2@sopuli.xyzB socsa@piefed.socialS vitabytesdev@feddit.nlV 6 Replies Last reply
    252
    • cows_are_underrated@feddit.orgC [email protected]

      Its definitely a bad idea writing new code that builds up on your old code, that has not been tested properly, because you quickly have to start debugging multiple layer is code at once.

      9 This user is from outside of this forum
      9 This user is from outside of this forum
      [email protected]
      wrote last edited by
      #2

      Honestly this is the reason TDD is most important for personal projects.

      If it's your job, the code isn't getting merged without decent tests. Yes you should probably write them first so you think about your implementation properly, but let's face it, many tests are written after in practice.

      If it's something written in your free time, you're just not writing those tests most of the time if you didn't write them up front.

      D cows_are_underrated@feddit.orgC 2 Replies Last reply
      6
      • 9 [email protected]

        Honestly this is the reason TDD is most important for personal projects.

        If it's your job, the code isn't getting merged without decent tests. Yes you should probably write them first so you think about your implementation properly, but let's face it, many tests are written after in practice.

        If it's something written in your free time, you're just not writing those tests most of the time if you didn't write them up front.

        D This user is from outside of this forum
        D This user is from outside of this forum
        [email protected]
        wrote last edited by
        #3

        Writing the tests first, or at least in tandem with your code, is the only way to fly. It's like publishing a proof along with your code.

        it sounds trite: make the tests fit the code. Yes, it's a little more work to accomplish. The key here is that refactors of any scale become trivial to implement when you have unit-test coverage greater than 80%. This lets you extend your code with ease since that usually requires some refactor on some level.

        C S 2 Replies Last reply
        4
        • 9 [email protected]

          Honestly this is the reason TDD is most important for personal projects.

          If it's your job, the code isn't getting merged without decent tests. Yes you should probably write them first so you think about your implementation properly, but let's face it, many tests are written after in practice.

          If it's something written in your free time, you're just not writing those tests most of the time if you didn't write them up front.

          cows_are_underrated@feddit.orgC This user is from outside of this forum
          cows_are_underrated@feddit.orgC This user is from outside of this forum
          [email protected]
          wrote last edited by
          #4

          What is TDD?

          H 1 Reply Last reply
          1
          • cows_are_underrated@feddit.orgC [email protected]

            What is TDD?

            H This user is from outside of this forum
            H This user is from outside of this forum
            [email protected]
            wrote last edited by
            #5

            Test driven development. Having a well designed automated test, and then developing until the test succeeds.

            cows_are_underrated@feddit.orgC 1 Reply Last reply
            1
            • H [email protected]

              Test driven development. Having a well designed automated test, and then developing until the test succeeds.

              cows_are_underrated@feddit.orgC This user is from outside of this forum
              cows_are_underrated@feddit.orgC This user is from outside of this forum
              [email protected]
              wrote last edited by
              #6

              Ah thanks. That sounds like not that bad of an idea, but for the scale that my projects are at thus is quite an overkill. I usually try if it works in The best case sz scenario and then try to deliberately break it by calling certain functions with garbage as parameters.

              9 1 Reply Last reply
              1
              • D [email protected]

                Writing the tests first, or at least in tandem with your code, is the only way to fly. It's like publishing a proof along with your code.

                it sounds trite: make the tests fit the code. Yes, it's a little more work to accomplish. The key here is that refactors of any scale become trivial to implement when you have unit-test coverage greater than 80%. This lets you extend your code with ease since that usually requires some refactor on some level.

                C This user is from outside of this forum
                C This user is from outside of this forum
                [email protected]
                wrote last edited by
                #7

                This! Also, it's a solid base to stand on when you want to optimize your code. Performing optimizations becomes much easier, quicker and fraught with errors once you have a unit test suite that will instantly tell you whether your change is working or not.

                1 Reply Last reply
                2
                • cows_are_underrated@feddit.orgC [email protected]

                  Its definitely a bad idea writing new code that builds up on your old code, that has not been tested properly, because you quickly have to start debugging multiple layer is code at once.

                  A This user is from outside of this forum
                  A This user is from outside of this forum
                  [email protected]
                  wrote last edited by
                  #8

                  Lol I just started refactoring my codebase into a new directory to clean up my poorly stored logs and other scripts

                  cows_are_underrated@feddit.orgC 1 Reply Last reply
                  1
                  • cows_are_underrated@feddit.orgC [email protected]

                    Ah thanks. That sounds like not that bad of an idea, but for the scale that my projects are at thus is quite an overkill. I usually try if it works in The best case sz scenario and then try to deliberately break it by calling certain functions with garbage as parameters.

                    9 This user is from outside of this forum
                    9 This user is from outside of this forum
                    [email protected]
                    wrote last edited by
                    #9

                    No project is too small for tests

                    Tests double as your documentation for your intent

                    Take it from me who has 20+ years of personal projects behind me, the ones that I've kept around are typically the ones that have some form of test suite.

                    It's easy to build on something if you know you're not breaking something in the process

                    cows_are_underrated@feddit.orgC 1 Reply Last reply
                    4
                    • 9 [email protected]

                      No project is too small for tests

                      Tests double as your documentation for your intent

                      Take it from me who has 20+ years of personal projects behind me, the ones that I've kept around are typically the ones that have some form of test suite.

                      It's easy to build on something if you know you're not breaking something in the process

                      cows_are_underrated@feddit.orgC This user is from outside of this forum
                      cows_are_underrated@feddit.orgC This user is from outside of this forum
                      [email protected]
                      wrote last edited by
                      #10

                      Yeah of course I Am testing. I Am usually just not writing very extensive tests. I try to break it as much as possible with as little effort and try then to prevent it from breaking.

                      A 1 Reply Last reply
                      0
                      • A [email protected]

                        Lol I just started refactoring my codebase into a new directory to clean up my poorly stored logs and other scripts

                        cows_are_underrated@feddit.orgC This user is from outside of this forum
                        cows_are_underrated@feddit.orgC This user is from outside of this forum
                        [email protected]
                        wrote last edited by
                        #11

                        That one is always nice when you actually do the cleanup and then have much less files to care about.

                        1 Reply Last reply
                        0
                        • cows_are_underrated@feddit.orgC [email protected]

                          Its definitely a bad idea writing new code that builds up on your old code, that has not been tested properly, because you quickly have to start debugging multiple layer is code at once.

                          bleistift2@sopuli.xyzB This user is from outside of this forum
                          bleistift2@sopuli.xyzB This user is from outside of this forum
                          [email protected]
                          wrote last edited by
                          #12

                          Opposing opinion: If it’s legacy code, and no-one has found a bug yet, it works as intended.

                          No, I don’t mean that ironically.

                          W 1 Reply Last reply
                          9
                          • bleistift2@sopuli.xyzB [email protected]

                            Opposing opinion: If it’s legacy code, and no-one has found a bug yet, it works as intended.

                            No, I don’t mean that ironically.

                            W This user is from outside of this forum
                            W This user is from outside of this forum
                            [email protected]
                            wrote last edited by [email protected]
                            #13

                            It's refreshing to see someone on social media who doesn't dismiss code as "outdated" just because of its age.

                            L 1 Reply Last reply
                            6
                            • cows_are_underrated@feddit.orgC [email protected]

                              Its definitely a bad idea writing new code that builds up on your old code, that has not been tested properly, because you quickly have to start debugging multiple layer is code at once.

                              socsa@piefed.socialS This user is from outside of this forum
                              socsa@piefed.socialS This user is from outside of this forum
                              [email protected]
                              wrote last edited by [email protected]
                              #14

                              Test driven development means you write the test case first and then never write any additional tests.

                              cows_are_underrated@feddit.orgC 1 Reply Last reply
                              2
                              • cows_are_underrated@feddit.orgC [email protected]

                                Its definitely a bad idea writing new code that builds up on your old code, that has not been tested properly, because you quickly have to start debugging multiple layer is code at once.

                                vitabytesdev@feddit.nlV This user is from outside of this forum
                                vitabytesdev@feddit.nlV This user is from outside of this forum
                                [email protected]
                                wrote last edited by
                                #15

                                1 Reply Last reply
                                7
                                • socsa@piefed.socialS [email protected]

                                  Test driven development means you write the test case first and then never write any additional tests.

                                  cows_are_underrated@feddit.orgC This user is from outside of this forum
                                  cows_are_underrated@feddit.orgC This user is from outside of this forum
                                  [email protected]
                                  wrote last edited by
                                  #16

                                  I usually do it thenother way around

                                  1 Reply Last reply
                                  0
                                  • D [email protected]

                                    Writing the tests first, or at least in tandem with your code, is the only way to fly. It's like publishing a proof along with your code.

                                    it sounds trite: make the tests fit the code. Yes, it's a little more work to accomplish. The key here is that refactors of any scale become trivial to implement when you have unit-test coverage greater than 80%. This lets you extend your code with ease since that usually requires some refactor on some level.

                                    S This user is from outside of this forum
                                    S This user is from outside of this forum
                                    [email protected]
                                    wrote last edited by
                                    #17

                                    Writing the tests first also ensures that the test actually fails when you expect it to. I've seen test suites that were silently failing for years because they were (presumably) written after the fact and people just assumed that they tested what they said they did. Went in for some other clean up, stared at the test for 10 minutes wondering "how did this ever pass", and then came to realize that test assertions in Jest inside a forEach apparently don't run in the context of the test and failures won't make the test fail. Changing the forEach to a for...of made it all fail immediately.

                                    1 Reply Last reply
                                    1
                                    • W [email protected]

                                      It's refreshing to see someone on social media who doesn't dismiss code as "outdated" just because of its age.

                                      L This user is from outside of this forum
                                      L This user is from outside of this forum
                                      [email protected]
                                      wrote last edited by
                                      #18

                                      There are dozens of us! But also, I have a masochistic tendency to update my old code to use the new language features and make it somewhat readable.

                                      Y 1 Reply Last reply
                                      2
                                      • cows_are_underrated@feddit.orgC [email protected]

                                        Yeah of course I Am testing. I Am usually just not writing very extensive tests. I try to break it as much as possible with as little effort and try then to prevent it from breaking.

                                        A This user is from outside of this forum
                                        A This user is from outside of this forum
                                        [email protected]
                                        wrote last edited by
                                        #19

                                        That sounds like you're doing TDD, albeit informally.

                                        cows_are_underrated@feddit.orgC 1 Reply Last reply
                                        0
                                        • A [email protected]

                                          That sounds like you're doing TDD, albeit informally.

                                          cows_are_underrated@feddit.orgC This user is from outside of this forum
                                          cows_are_underrated@feddit.orgC This user is from outside of this forum
                                          [email protected]
                                          wrote last edited by
                                          #20

                                          From what I understand the difference between how I code and what has Ben described as TDD in this thread is, that I set up everything first and then try to think of ways people could break the code and then test these vases/try to prevent them.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups