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

Oh, I thought I was clearer than I was. I feel zero-based is more natural.

However, I do agree with you that in the vast majority of loops there aren't any interesting index tricks. For this reason, I actually think language constructs like "foreach" and iterators and so on are better than counting from either 0 or 1 in most cases. In high-level languages, use high-level looping constructs, and let the compiler figure out the indices for you :-).



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

Search: