I like it in general, but readonly is really jarring. It should be more succinct to declare something immutable than mutable.
readonly
Why punish devs for trying to do the right thing?
To be clear, readonly is not the same as immutable. See here: https://basarat.gitbooks.io/typescript/content/docs/types/readonly.html
Also, since TS is a superset of JS, making immutability more concise is likely impossible By default. Perhaps with a compiler flag?
I like it in general, but
readonlyis really jarring. It should be more succinct to declare something immutable than mutable.Why punish devs for trying to do the right thing?
To be clear, readonly is not the same as immutable. See here: https://basarat.gitbooks.io/typescript/content/docs/types/readonly.html
Also, since TS is a superset of JS, making immutability more concise is likely impossible By default. Perhaps with a compiler flag?