Are tests really that bad?

Поділитися
Вставка
  • Опубліковано 4 вер 2023
  • Today's video is a thought-provoking discussion about a recent Twitter poll that sparked debate in the tech Twitter (X). Would you choose Types or Tests if you could only pick one?
    🔍 What We Discuss:
    - The importance of Types and Tests in software development
    - Why Types won in a Twitter poll with ~51% over 12,000 total votes
    - PHP example that demonstrates the limitations of relying solely on Types
    - My opinion on why Tests offer a more comprehensive validation of code
    SOME OF THE WAYS YOU CAN SUPPORT THE CHANNEL
    👍 Smash the like button
    🤝 Subscribe to the channel & turn the notifications on
    💬 Post comments, any feedback is greatly appreciated
    ⭐ Become a Patreon: / programwithgio
    THANK YOU!
    🛠️ TOOLS & SERVICES I USE
    Digital Ocean Hosting - Get 100$ credit - m.do.co/c/38b935ad74e5
    Domains on Namecheap - namecheap.pxf.io/rnRjdQ
    Envato Elements - 1.envato.market/c/2937311/298...
    ** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.

КОМЕНТАРІ • 29

  • @FGj-xj7rd
    @FGj-xj7rd 10 місяців тому +9

    I chose types, because the client is the test 😎

  • @hassanag.dd.369
    @hassanag.dd.369 10 місяців тому +2

    I see also the tests is much more important and assuring than types.
    If you made a course about tests and TDD, that would be super nice.

  • @ScorpusMugnes
    @ScorpusMugnes 10 місяців тому +3

    I can also go with tests although types are also important in the long run. Tests ensures future security and extensibility where as types only directs you in a better path of writing strict code to handle type errors, types prevent unneccessary type check like using if statements and other checks but tests comes in with a couple variations composed of solutions and confidence, tests can handle all errors -- even the logic ones as you said.

  • @hectorluis9294
    @hectorluis9294 10 місяців тому +2

    I understood the importance of testing over types when I had to upgrade the node version and key libraries in a Typescript legacy project with no tests 💀

  • @donmikele07
    @donmikele07 10 місяців тому

    Great video as always! But one thing is missing or I'm missing something: why we can't use both at the same time?

    • @ProgramWithGio
      @ProgramWithGio  10 місяців тому +2

      You absolutely can & should. This was just a hypothetical poll and I was surprised by results so decided to share my opinion. In real world you probably will never have to make such decision to pick one or the other.

  • @user-zj2bb2pj8u
    @user-zj2bb2pj8u 22 дні тому

    @ProgramWithGio What software do you use to create AWESOME presentation ?

    • @ProgramWithGio
      @ProgramWithGio  День тому

      Adobe Premiere & After Effects. I had help from video editor for some of the videos

  • @stephen.cabreros
    @stephen.cabreros 10 місяців тому

    well as you said I will choose test for validating logical errors and complex constructed objects.

    • @ProgramWithGio
      @ProgramWithGio  9 місяців тому +1

      Good choice, although, you should really do both, tests + types

  • @Zubbee
    @Zubbee 10 місяців тому

    I must confess that I run away from the idea of building tests. I'm thinking, if the application works, why do I need to build a test again? But watching this video reveals two things to me.
    First is, test are important. Maybe the apps I have made are yet too small for me to appreciate that.
    Second is that I probably avoid tests due to ignorance. I would need to look into tests more and not avoid them.
    With regards to the comparison, because of the way I was taught about types from "learn Php the right way", I don't think I ever had the impression that one (types) can replace the other(tests). Saw them as two different checks.
    Thanks for that Gio

    • @ProgramWithGio
      @ProgramWithGio  10 місяців тому +1

      Yea for small apps sometimes it isnt worth the extra effort depending on what the app is doing. Both types & tests are important, this was just a hypothetical poll

    • @travholt
      @travholt 10 місяців тому +3

      You don't write tests to test that an existing app works. You start by writing a test for the code/functionality you're going to write. This test will fail. Then you write code to make the test pass. Then you refactor the code to make it better, still running the test to make sure the code still works after refactoring.
      Then you repeat the cycle, adding tests for more code/functionality as needed, seeing the new tests break, and writing code to make them pass. When you're done, you run _all_ the tests again to check if what you just did broke anything else in your app. (And at some point it will; it happened to me just a few days ago, but the test clearly identified the error and I had it fixed in seconds.)
      I've been coding our website/app using test-driven development (TDD) for half a year, and it has been pretty slow going up until now. But at this point I can add new functionality with confidence because my test suite confirms that I don't break anything, or shows me exactly what broke and why.

    • @Zubbee
      @Zubbee 10 місяців тому +1

      @@ProgramWithGio ok Gio. Thanks alot

    • @Zubbee
      @Zubbee 10 місяців тому +1

      @travholt oh wow, this sounds great. I would like to be able to do this. I'm about to embark on a personal project much much larger than the projects I have done. Building up the code along with tests sounds like the best way to go about it. Just that I need to learn more about how to write tests

  • @walayat_khan
    @walayat_khan 9 місяців тому

    Tests are more comfortable, but I will choose types only to avoid early bugs and avoid writting more checking, nothing else.

    • @ProgramWithGio
      @ProgramWithGio  9 місяців тому +1

      Tests would help avoid early bugs as well & late bugs. But you should totally do both if possible

    • @walayat_khan
      @walayat_khan 9 місяців тому

      @@ProgramWithGio sure

  • @kalvikaring1304
    @kalvikaring1304 10 місяців тому

    i really like to know how to define type without test 🤔

  • @azengakevin2310
    @azengakevin2310 9 місяців тому

    I concur

  • @dr_ned_flanders
    @dr_ned_flanders 10 місяців тому

    Because everyone hates writing tests.