3 ms·
> This is an example where ownership semantics would have prevented that bug. It’s also a bug prevented by basic good practices in Java. You can’t cache copies
by brabel 1y ago
> This is an example where ownership semantics would have prevented that bug.
It’s also a bug prevented by basic good practices in Java. You can’t cache copies of mutable data and you can’t mutate shared data. Yes it’s a shame that Java won’t help you do that but I honestly never see mistakes like this except in code review for very junior developers.
- zozbot234 1y agoThe whole point is that languages like Java won't keep track of what's "shared" or "mutable" for you. And no, it doesn't just trip up "very junior developers in code review", quite the opposite. It typically comes up as surprising cross-module interactions in evolving code bases, that no "code review" process can feasibly catch.
- brabel 1y agoSpeak for yourself. I haven't seen any bug like this in Java for years. You think you know better and my experience is not valid? Ha. Ok. Keep living in your dreams.
- IshKebab 1y agoYes I think he knows better and your experience is not valid. Well, maybe not valid, but insufficient at least.