4 ms·
There seems to be some interest, so this isn't the best written, but here you go: Strings are too flexible. They can be used for anything and there should be s
by Pet_Ant 4y ago
There seems to be some interest, so this isn't the best written, but here you go:
Strings are too flexible. They can be used for anything and there should be semantic guard rails to types. Just like you never actually need booleans and enums, you could just use integers for both of those. I have seen developers instead of use strings instead of lists and just comma separate them. Strings are just a collection of characters with no restrictions to them. If you are going to add restrictions make them something else, create a better abstraction. I mean you wouldn't make a database just be nvarchar even if you could, because you aren't capturing semantic intent. Symbols do not have to be preserved at runtime, but do need to align during compilation. I mean should you be able to do string concatenation on a string in an import statement? How about to upper-case on it. If it doesn't behave like a string then it shouldn't look like one.