Блог пользователя GrandmomPanties

Автор GrandmomPanties, история, 8 лет назад, По-английски

Hi, there was a question in my mind today I want to ask! Why the hell all the problems in the world want the answer 1-based when 90% of programmers work 0-based????? every time we should -- the input and ++ the answer :| sorry for poor English :)

  • Проголосовать: нравится
  • +17
  • Проголосовать: не нравится

»
8 лет назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

I think that's depends on writer. Some writers think 1-indexed (1-based) is more natural problem statement than 0-indexed one. Or if writers don't think about 0-indexed or 1-indexed, many problems will be 1-indexed. (It's only my guess, if it isn't I'm sorry)
By the way, how did you get the information of "90% of programmers are using 0-indexed"?

»
8 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

What indexing is more natural? It looks like discussion about is zero natural number.
I think 1-based indexing is better because you will not get confused, when you say "first element", "second element", "third element" and so on.