Re:Why bad scientific code beats code following “best practi...
by chopin on Sunday August 28, 2016 @05:59PM
(#12378740)
That would be a final field. But generally I agree with you and its by far the pattern I use most.
[ Parent
| on HN ]
Re:Why bad scientific code beats code following “best practi...
by kuschku on Sunday August 28, 2016 @07:51PM
(#12379132)
The issue is, for example, if you have for example a class encapsulating a bunch of flags, and allowing the user to either set each flag seperately, or a bitfield representing all of it.
In C, you might be able to do some magic, but in Java, you’ll need setters and getters there – you can’t even do final fields there.
Luckily, in C#, you can just use accessors, and maybe in Java with Lombok, too.