3 ms·
The go designers are brilliant. This is exactly the right priority. We would all do better it think more the way they do.
by philosopher1234 4y ago
The go designers are brilliant. This is exactly the right priority. We would all do better it think more the way they do.
- lamp987 4y agoThis was a joke right?
- philosopher1234 4y agoNo I’m being sincere. Clarity is more important than performance. This is a very thoughtful decision, it relieves devs of the idiotic pressure to micro optimize.
- frou_dh 4y agoIt's amusing to mention clarity, given the topic. Because the cargo-cult of this kind of function having return type 'int' is lack of clear thinking manifest. Int has 4-billion distinct values and all they want is three. Here's clarity: datatype order https://smlfamily.github.io/Basis/general.html#SIG:GENERAL.order:TY https://smlfamily.github.io/Basis/general.html#SIG:GENERAL.o... function compare https://smlfamily.github.io/Basis/string.html#SIG:STRING.compare:VAL https://smlfamily.github.io/Basis/string.html#SIG:STRING.com... case String.compare(a, b) of | LESS => ... | EQUAL => ... | GREATER => ...