Comment

Comment by awild

It's usually on a syntactical level, to disable reassigning a value. For objects this means the reference is still mutable, value types are locked.

Js has const, C has const, Java final.

Imho it'd be awesome if mutability were not the default and we would have to mark mutability, but until then any variable that doesn't need it, is final. Which also helps skimming code

parent awild 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton