3 ms·
I think the simple reason is that two characters are harder to type then one character, if they both are a key combo. And to keep syntax more clean.
by z3t4 9y ago
I think the simple reason is that two characters are harder to type then one character, if they both are a key combo. And to keep syntax more clean.
- DonaldPShimoda 9y agoYeah but this introduced an easy path for errors. You could mean to write `==` and instead write `=` and it'll work fine in C in practically all locations (even as conditions of if-statements). Using `:=` could have likely alleviated this error to a noticeable degree, if not entirely.
- z3t4 9y agoChefs rather use a sharp knife then a blunt one, even if they cut themselves from time to time. If safety is a priority, there are special designed languages like Ada that use :=
- DonaldPShimoda 9y agoBut... sharp knives are safer than blunt knives, specifically because they reduce the likelihood of being cut. That's why they're preferred. I see your point, though. I was just bringing up an alternative consideration in the debate regarding equality.