News for hackers. Stuff that matters.
Re:Rust for JavaScript Developers – Pattern Matching and Enums by nilkn on Sunday July 12, 2020 @02:05PM (#23813318)
I am not sure this has anything to do with enums. When sending serialized data over the network you always have to have logic for dealing with the situation where what you get isn't quite what you expected. Not doing that is what causes things to break, not using enums.
Re:Rust for JavaScript Developers – Pattern Matching and Enums by cle on Sunday July 12, 2020 @02:22PM (#23813466)
In my experience, these kind of bugs happen overwhelmingly with enums. The nature of enums makes this mistake pretty easy to make. Enums are otherwise fantastic tools, I’m just pointing out that in certain common contexts they have some ergonomic problems.