Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Immutable collections exit, they were just added later. See System.Collections.Immutable:

https://learn.microsoft.com/en-us/dotnet/api/system.collecti...



Those collections are more like copy-on-write than actual immutable. System.Collections.Frozen is the real thing.


Isn't Frozen something you do to a set or dictionary to say, I'm not going to add any more values, please give me a version of this which is optimized for lookup only?


I do a lot of .NET programming, and I've never seen them getting used. :O


Roslyn, the C#/VB compiler, uses them extensively, but in other code they're indeed quite rare.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: