this post was submitted on 29 Dec 2025
84 points (97.7% liked)

Programming

24097 readers
302 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
top 8 comments
sorted by: hot top controversial new old
[–] FizzyOrange@programming.dev 4 points 4 hours ago

I think this could have been about 1/4 the length. Fairly basic stuff by modern standards and you don't need so many words. It is all correct at least, as far as I could see!

[–] lascapi@jlai.lu 3 points 4 hours ago

A bit long and I miss some concret code examples, but nice to read.

[–] fulg@lemmy.world 6 points 10 hours ago

This was a great read, thanks for sharing!

The thumbnail caught my eye because I bought the Dragon Book many years ago to get some insight on compilers. So much knowledge that is still relevant today…

[–] Undertaker@feddit.org -2 points 5 hours ago (3 children)

Some knowledge about compiler was interesting. The advise to use combined return types (for errors and value) instead of exceptions is ridiculous. Some other points are weird as well. Changing language to avoid null...

[–] expr@programming.dev 1 points 25 minutes ago

https://en.wikipedia.org/wiki/Algebraic_data_type

Some reading material for you. Sum types allow for proper, compiler-enforced error handling and optionality rather than the unprincipled free for all that is exceptions and nullability.

Tony Hoare, the person that originally introduced nulls to the programming world, is oft-quoted as calling nulls the "billion dollar mistake". Here's the talk: https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare/.

[–] douglasg14b@lemmy.world 11 points 5 hours ago (1 children)

Combined return types are wonderful and make for, generally, better engineered software.

Exceptions still have their place, for exceptional circumstances, but the grand majority of errors should not be exceptions.

[–] theneverfox@pawb.social 1 points 1 hour ago
[–] Michal@programming.dev 2 points 3 hours ago

Combined return types is a Rust feature.

I recently started learning Rust, and would prefer exceptions. Even Java checked exceptions aren't too bad to work with. Rust approach is Ok though and ir has a purpose.