5 ms·
> Other more quaint languages like Java may have type systems that check properties such as "The program does not add numbers and strings" Poor example. In Ja
by finnw 13y ago
> Other more quaint languages like Java may have type systems that check properties such as "The program does not add numbers and strings"
Poor example. In Java, number + string means "convert the number to a decimal string then concatenate", and it can be invoked unintentionally.
- jeapostrophe 13y agoThat's not a counter-example. I'm not saying that Java doesn't allow syntax that might look like "number + string", just that it does not actually add them, like C does where: 3 + "4" means something very surprising.
- Someone 13y agoDoes it? I thought string + number does that, but number + string does not compile.