Rust in the 6.2 kernel
Rust in the 6.2 kernel
Posted Nov 21, 2022 21:16 UTC (Mon) by micka (subscriber, #38720)In reply to: Rust in the 6.2 kernel by steveklabnik
Parent article: Rust in the 6.2 kernel
Looking at the Either crate api, it’s awful. At least Result gives you a meaningful name for each variant (ok, err).
Either gives you a... left and a right. Which is which? If both have the same content type, how do you differentiate?
By the way, some people (like me) can’t tell the right from the left. Or rather can’t give them a name (but never will for example drive on the wrong side of the road). I had to work on codd which used an Either type in another language and could never manage to understand any of it even after multiple years.
I guess it’self OK as write-only code...
Either gives you a... left and a right. Which is which? If both have the same content type, how do you differentiate?
By the way, some people (like me) can’t tell the right from the left. Or rather can’t give them a name (but never will for example drive on the wrong side of the road). I had to work on codd which used an Either type in another language and could never manage to understand any of it even after multiple years.
I guess it’self OK as write-only code...
Posted Nov 22, 2022 14:11 UTC (Tue)
by TheGopher (subscriber, #59256)
[Link]
Rust in the 6.2 kernel
Agree. Having worked with either in scala I can say that the overhead of a dedicated struct/union/variant is minimal - and the readability is much higher! This is the wrong place to be lazy.
