[post Nifty5] make Fields and MultiFields immutable?
Currently, Field
s and MultiField
s are the only NIFTy classes whose value can change after they have been constructed. It may be worthwhile to change this and make them immutable as well.
Pros:
- code will get quite a bit shorter (e.g. no more explicit
lock()
calls) - less potential for subtle usage errors
Cons:
- slight performance hit by additional copying of data (operators like += will not be as efficient any more)