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

Well, nobody forces you to use the setters/getters pattern. For internal implementation, you could access everything directly. For example, Zig encourages this style of programming.

In my experience in Rust, the use of getters and setters is less common compared to some other languages like Java.




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

Search: