How do I use System.Net.ConnectStream?

后端 未结 3 1029
终归单人心
终归单人心 2021-01-27 01:36

I am trying to get my head around some of my predecessors code who, helpfully, has used \'var\' to declare everything.

I have a using statement which is below:



        
3条回答
  •  执念已碎
    2021-01-27 02:06

    Theres a great snippet from the var keyword on the InfoQ site. This talks about when and when not to use var. Its not quite as clear cut as don't' use it unless your using linq, its more you use it when you don't need to draw attention to the data type and use typed objects when you need to draw attention to the data type.

    Its one of the personal preference things... but normally the best preference is however your boss/code lead/architect likes their code 'grammar' to look to make it uniform.

提交回复
热议问题