Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
unwind
on May 6, 2019
|
parent
|
context
|
favorite
| on:
Clear is better than clever [pdf]
I agree, but would go with:
return a < b ? -1 : a > b;
This does the right thing, but removes the nested tertiary which to me is a big win.
humblebee
on May 6, 2019
[–]
What language? Those are different types.
unwind
on May 6, 2019
|
parent
[–]
I assumed C, and both values are of type int so they match.
Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: