4 ms·
Just because a language is not high level enough to have a unique concept of "string" type doesn't mean you shouldn't take it seriously.
by SkiFire13 1y ago
Just because a language is not high level enough to have a unique concept of "string" type doesn't mean you shouldn't take it seriously.
- swiftcoder 1y agoEven very high-level languages don't have singular concepts of string. Every serious language I can think of differentiates between: - A sequence of arbitrary bytes - A sequence of non-null bytes interpreted as ASCII - A sequence of unicode code points, in multiple possible encodings
- int_19h 1y agoI can't think of many languages that differentiate between #1 and #2 in your list. And languages that differentiate between #1 and #3 generally don't refer to #1 as "strings" at all, so you still have a single definitive notion of what a string is (and some other things that are emphatically not strings).
- swiftcoder 1y agoYeah, a bunch of languages don't strongly differentiate between all three of these. For example, C++ differentiates between #1 and #2 (although it has woefully inadequate out-of-box support for #3). Python (> 3) calls #1 bytes / bytearray, and calls #3 string. #2 is only really supported for FFI with C (i.e. ctypes.c_char_p and friends)