Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Honestly, I feel like `some_list.first` is the most ergonomic.

And if the API provides `second`, `third`, `antepenultimate`, `penultimate`, and `last` methods it covers a large part of what one most often use.

Past third rank, then I will feel better served with a `slice` method, whose documentation provides explicitly it’s index convention, whether it makes a modulo on out of bounds, etc.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: