Comment on Typing is not a programming bottleneck
philm@programming.dev 10 months agoI’m totally aware of the benefits of encapsulation, but the way java does it seems so unnecessarily boilerplatey (C# is better, functional programming makes encapsulation even simpler, but that’s a different paradigm…)
I like how Rust approaches this via the module system and crates (you have pub
for the public interface, pub(crate)
for crate/lib wide access and no modifier for being only allowed to access in the current module and submodules of that module)
Dunstabzugshaubitze@feddit.de 10 months ago
Not to aware of how c# works, or interested in defending java, especially ancient java versions, but what does it do better in that regard?
Only records for more or less pure data objects come to mind, but those are also in modern Java.
philm@programming.dev 10 months ago
It has Properties (basically syntax sugar…)
pycorax@lemmy.world 10 months ago
And it’s so good that Kotlin adopted them too in their journey to fix Java.