4 ms·
> E.g. sort by this field will happily do a decimal sort instead of the string 00.10. So that system is not consistent with type checking? How is this not cons
by alpaca128 6y ago
> E.g. sort by this field will happily do a decimal sort instead of the string 00.10.
So that system is not consistent with type checking? How is this not considered a bug?
- chrisdone 6y agoI mean if the value is imported as a decimal, then a sort by that field will sort as decimal. This might not be obvious if a system imports 23.53, 53.98 etc - a user would think it looks good. It only becomes clear that it was an error to import as a decimal when we consider cases like “00.10”. E.g, package versions: 10.10 is a newer version than 10.1. Types only help if you pick the right ones.
- jhugo 6y agoSure. In most static type systems though, you would be importing the data into structures that you defined, with defined types. So you wouldn’t suddenly get a Decimal in place of a String just because the data was different. You’d get a type error on import.