3 ms·
OK, technically correct but I still disagree they are actually 10 because aside from `str` (which should be used only for constants really) and `String` everyth
by pdimitar 5y ago
OK, technically correct but I still disagree they are actually 10 because aside from `str` (which should be used only for constants really) and `String` everything else is strictly optional and you're not mandated to work with it unless you got a specific scenario (like CStr / CString).
Compare this to Haskell where you have lazy and non-lazy / Unicode and non-Unicode strings which is at least 4 (I think there was more but I forgot now) and you are practically forced into using any of them depending on which library you're interacting with -- and I don't mean with C libraries in this instance.
I personally never even used anything beyond `str` and `String` for any app development, including a bit lower level stuff (though not embedded or tight integration with system libraries).
- samus 5y agoHaskell also has `String`, which is a linked lazy list of boxed UTF32 characters. Yes, it's as horrible for performance as it sounds. Also, there are `ByteString`s which wrap strings in other encodings.
- codeflo 5y agoI don’t think we actually disagree, see my last paragraph.
- pdimitar 5y agoTrue, I overreacted a little, sorry. Thanks for being a good sport.