Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
pekim
on May 6, 2019
|
parent
|
context
|
favorite
| on:
Clear is better than clever [pdf]
return a < b ? -1 : a > b ? 1 : 0;
That's a nice approach. However the document is about Go, and Go doesn't have a ternary operator. So that probably leaves the switch solution as the clearest one.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: