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!
Programming
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
A bit long and I miss some concret code examples, but nice to read.
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…
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...
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/.
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.
Well put
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.