is this overkill for assessing Main(string[] args)

后端 未结 5 1986
無奈伤痛
無奈伤痛 2021-01-12 06:44

I\'ve got the following and was wondering if the initial test is overkill:

static void Main(string[] args) {
    if (args.Length == 0 || args == null) {              


        
5条回答
  •  Happy的楠姐
    2021-01-12 06:47

    According to this, you only need to check :

    if (args.Length == 0)
    {
        // Do X
    }
    

    Though checking for null doesn't do any harm, there is no real need.

提交回复
热议问题