2 ms·
Most relevant and non obscure languages support a const feature of some kind.
by c_crank 3y ago
Most relevant and non obscure languages support a const feature of some kind.
- mrkeen 3y agoIt's too little. There's no language I know of where slapping 'const/final' in front of a field or a function will free you of the burden of considering whether you can safely share it (with the exception of primitives). If I have a final field of Set<AllowedUsers>, I can't return it, because the caller can insert a new user.
- c_crank 3y agoSpeaking as someone working in the CRUD Java salt mines, I've never had an issue with sharing variables like this that allegedly makes imperative programming fundamentally broken and unproductive. Scoping and any basically functional program layout does 95% of the work for you.