Hacker News new | past | comments | ask | show | jobs | submit login

The point of the article was to compare how resource cleanup works in general in different languages. What you show here is a very special case that does not extend to other resources or even other file operations. Still, try-with-resources and AutoClosable is the best what Java has to offer, and it is clearly inferior to Rust/C++ approach (and to some degree also to Go and Zig, but less so).



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: