This just struck me as an oversight by Microsoft. Since arrays and other data-structures within the .NET framework begin from zero (zero-based) why don't we have a line 0 within the code view in Visual Studio?
Ponder that one :-)
Software Engineering Stack Exchange is a question and answer site for professionals, academics, and students working within the systems development life cycle. It only takes a minute to sign up.Sign up to join this community
There is a difference between counting and indexing. The index can start at any number (some languages support that), but for many reasons it is most often practical to have it start at zero. Counting also starts at zero, but as soon as one does count a set that is not empty, the first element is 1, and so on.
By convention, normal humans count starting from 1, while many programmers and some mathematicians count starting from 0.
The question you have raised about line numbers is not specific to Microsoft Visual Studio. It applies to every other text editor tool, because counting lines from 1 has been adopted as a universal convention in software.
While it wouldn't be wrong to count lines starting from 0, it would break the established convention and cause a massive amount of confusion to everyone involved, from the developers to the users.
A link which counters some of Dijkstra's points (in an article which is sooner or later gonna come out in this discussion).