Why would var be a bad thing?

前端 未结 17 1908
误落风尘
误落风尘 2020-12-04 17:21

I\'ve been chatting with my colleagues the other day and heard that their coding standard explicitly forbids them to use the var keyword in C#. They had no idea

17条回答
  •  春和景丽
    2020-12-04 18:24

    Surely this is a mistake. It's because some folk don't realise that it is actually strongly typed, and not at all like a var in VB.

    Not all corporate coding standards make sense, I once worked for a company who wanted to prefix all class names with the company name. There was a massive rework when the company changed it's name.

提交回复
热议问题