434 karma · joined Sep 24, 2024 (2y ago) · 114 submissions
comment 4mo ago · link · parent
comment 11mo ago · link · parent
comment 1y ago · link · parent
This is easily achieved in Scala with a particular use of package paths. You are allowed to make some symbols only visible under a package path.
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
14.
Against Single-File Codebases(rugu.dev ↗)
2 points · by aiono · 1y ago · 2 comments
comment 1y ago · link · parent
On the other hand, when you have to write something yourself you drop down to slow and thinking state where you will pay attention to details a lot more. This means that you will catch bugs you wouldn't otherwise think of. That's why people recommend writing toy versions of the tools you are using because writing yourself teaches a lot better than just reading materials about it. This is related to know our cognition works.
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
> And if you are only writing a prototype, declare that it throws Exception, or if you can't, a catch (IOException ex) { throw new UncheckedIOException(ex); } really isn't that bad.
The problem with that is when you go back to do proper error handling you can't easily find all those places where you did this. For instance in Rust, you can find those by searching for `unwrap`.
comment 1y ago · link · parent
Author of the post here. I also see this parallel in error handling discussions. But seems like it's much harder to sell error handling than static typing. Static typing was also much more debatable in the past then now so maybe same can happen to error handling mechanisms in the future as well.
Your project seems very interesting! Typescript is sophisticated enough to model complex Result-like types that can narrow-widen error cases throughout the code. I will check it more if I find the time.