Are tests really that bad?

  Рет қаралды 2,454

Program With Gio

Program With Gio

Күн бұрын

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/38b9...
Domains on Namecheap - namecheap.pxf....
Envato Elements - 1.envato.marke...
** 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 Жыл бұрын
I chose types, because the client is the test 😎
@ProgramWithGio
@ProgramWithGio Жыл бұрын
I'm not that cool :D
@codingtalkies4749
@codingtalkies4749 Жыл бұрын
still the logic error will escape :)
@ProgressiveDeveloper
@ProgressiveDeveloper Жыл бұрын
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.
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Yup, both are important
@hassanag.dd.369
@hassanag.dd.369 Жыл бұрын
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.
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Thanks for the suggestion 🙌
@hectorluis9294
@hectorluis9294 Жыл бұрын
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 💀
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Heh yup, feel the pain
@donmikele07
@donmikele07 Жыл бұрын
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 Жыл бұрын
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 3 ай бұрын
@ProgramWithGio What software do you use to create AWESOME presentation ?
@ProgramWithGio
@ProgramWithGio 2 ай бұрын
Adobe Premiere & After Effects. I had help from video editor for some of the videos
@stephen.cabreros
@stephen.cabreros Жыл бұрын
well as you said I will choose test for validating logical errors and complex constructed objects.
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Good choice, although, you should really do both, tests + types
@walayat_khan
@walayat_khan Жыл бұрын
Tests are more comfortable, but I will choose types only to avoid early bugs and avoid writting more checking, nothing else.
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Tests would help avoid early bugs as well & late bugs. But you should totally do both if possible
@walayat_khan
@walayat_khan Жыл бұрын
@@ProgramWithGio sure
@Zubbee
@Zubbee Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@ProgramWithGio ok Gio. Thanks alot
@Zubbee
@Zubbee Жыл бұрын
@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
@kalvikaring1304
@kalvikaring1304 Жыл бұрын
i really like to know how to define type without test 🤔
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Just add type declaration?
@azengakevin2310
@azengakevin2310 Жыл бұрын
I concur
@ProgramWithGio
@ProgramWithGio Жыл бұрын
👍👍
@dr_ned_flanders
@dr_ned_flanders Жыл бұрын
Because everyone hates writing tests.
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Not everyone but good point
javaScript call apply and bind
15:23
techsith
Рет қаралды 356 М.
when you have plan B 😂
00:11
Andrey Grechka
Рет қаралды 53 МЛН
Why Most Programmers DON'T Last
18:56
Thriving Technologist
Рет қаралды 308 М.
This is Why Programming Is Hard For you
10:48
The Coding Sloth
Рет қаралды 847 М.
Stop Using Mocking in Unit Testing! | Code Cop #020
10:46
Nick Chapsas
Рет қаралды 43 М.
Coding Was HARD Until I Learned These 5 Things...
8:34
Elsa Scola
Рет қаралды 379 М.
Your Private GitHub Repos Aren't as Private as You Think
14:58
ProtonPenguin
Рет қаралды 156 М.
The Secret Science of Perfect Spacing
9:40
Chainlift
Рет қаралды 418 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 711 М.
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Dylan Beattie
Рет қаралды 157 М.