Static/strong typing and refactoring

后端 未结 5 1849
谎友^
谎友^ 2021-01-05 11:21

It seems to me that the most invaluable thing about a static/strongly-typed programming language is that it helps refactoring: if/when you change any API, then the compiler

5条回答
  •  渐次进展
    2021-01-05 11:49

    One of the benefits of using var in C# 3.0 is that you can often change the type without breaking any code. The type needs to still look the same - properties with the same names must exist, methods with the same or similar signature must still exist. But you can really change to a very different type, even without using something like ReSharper.

提交回复
热议问题