MENU

Fun & Interesting

"Don't Throw Exceptions, Use A Result Pattern" is BAD ADVICE!

Codewrinkles 4,424 lượt xem 6 months ago
Video Not Working? Fix It Now

"Don't throw exceptions, use a result pattern instead" is the kind of #programming advice that we see viralizing everywhere. The way I see it, that's actually a very Bad advice. Join me in this video as I'll provide a detailed historical context and evolution to show why exceptions were introduced in programming in the first place. The result pattern basically introduces the problems developers had 60 years ago in modern codebases. That's not inherently bad, as programming languages have evolved and we have far better tooling. So what would be a better advice regarding throwing exceptions or returning results? Watch and you'll find out!

Do you want to master API versioning and never break your APIs consumers? Get my "API Versioning for The Real World" book: https://leanpub.com/practical-api-versioning

Content:
1. Intro: 00:00
2. Functional Programming vs OOP: 01:49
3. Programming Language Timeline: 03:13
4. What problems did exceptions solve? 05:45
5. LISP code "from the 60s": 06:43
6. The real pain before exceptions: 08:53
7. Result pattern - back to the 50s problems: 11:12
8. What's the Good advice? 13:55
9. A logical fallacy at the end: 17:01

Comment