Will the compiler only compile code that can get executed?

后端 未结 6 2006
梦谈多话
梦谈多话 2020-12-15 03:37

I have a class library and am using only part of it. Is there a need to delete what isn\'t being used in order to shrink the size of the created code (in release configurati

6条回答
  •  太阳男子
    2020-12-15 04:08

    to the question of whether there is a "need to delete what isn't being used in order to shrink the size of the created code": i think this would only be useful to save network bandwidth. removing unused code is crucial in web applications to improve loading speeds etc.

    if you're code is an exe or a library, the only reason i see to remove dead code, is to improve your code quality. so that someone looking at your code 2 years down the line won't scratch their heads wondering what it does.

提交回复
热议问题