Hacker News new | ask | show | jobs
by Roboprog 4607 days ago
Indeed, many languages would benefit simply from having modifiers that reverse the typical use of "const". Make everything immutable / side-effect-free by default, and add a "mother may I" keyword that allows mutation / side-effects without giving a compile error.

Hopefully, programmers would learn to avoid writing code that requires the "stomps-all-over-shit" keyword except when they really did need it. (assuming tail call elimination for simple loops)

1 comments

One of D's improvements upon C/C++ is its ability to enforce "deep const-ness".