GrandmomPanties's blog

By GrandmomPanties, history, 8 years ago, In English

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 :)

  • Vote: I like it
  • +17
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it +10 Vote: I do not like it

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 years ago, # |
  Vote: I like it +3 Vote: I do not like it

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.