Arrays in Visual Basic

后端 未结 5 1989
长发绾君心
长发绾君心 2020-12-12 04:34

In declaring an array in VB, would you ever leave the zero element empty and adjust the code to make it more user friendly?

This is for Visual Basic 2008

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-12 05:20

    First, it is about programmer friendly, not user friendly. User will never know the code is 0-based or 1-based.

    Second, 0-based is the default and will be used more and more.

    Third, 0-based is more natural to computer. From the very element, it has two status, 0 and 1, not 1 and 2.

    I have upgraded a couple of VB6 projects to vb.net. To modify to 0-based array in the beginning is better than to debug the code a later time.

提交回复
热议问题