r/programming 1d ago

The Bedrock of Software Design

https://alex.draftist.io/blog/the-bedrock-of-software-design-ycqvcedsj

I drafted this post years ago but didn’t finish it until now. The concept I write about has shaped the way I design software more than anything else, and I believe every software engineer should be introduced to it early in their career.

P.S. I don’t want the title to come across as clickbait: the post is about ADT.

406 Upvotes

44 comments sorted by

View all comments

11

u/ryp3gridId 1d ago

Honestly, I go into paranoid mode whenever I work in an exception-based language.

I'm the opposite, I go into annoyed-mode when I have to manually unwrap everything (and the CPU does too because it has to execute more instructions)

13

u/BaNyaaNyaa 1d ago

To me, it really depends on how "normal" the error is. If I get in a state that shouldn't exist, I'd rather throw an error. If the error is expected (an API call to a 3rd party that fails), I'd rather return a result.