3 ms·
But do you understand that some values of a 32 bit int can be used to encode meta-data about a 8 bit char? If you understand both, which one is conceptually ea
by enriquto 7y ago
But do you understand that some values of a 32 bit int can be used to encode meta-data about a 8 bit char?
If you understand both, which one is conceptually easier to you?
- empath75 7y agoOptions for sure, at least in rust. Rust has tons of help dealing with options built into the language.
- epolanski 7y agooption obviously. I just do not understand what the problem with Option is. It's either Some(1) or None. If it's some you have the value, otherwise you handle the fact you don't have it. It's so simple and basically every modern language uses it to handle nullable types.
- dmit 7y agoOption<T> is conceptually easier because: 1) It applies exactly the same way to any type, not just char. 2) You don't need to read the man page for every single function that returns an int on the off chance that said int actually contains a bool, a char, or a short plus additional flags.