When, if ever, is “number of lines of code” a useful metric?

后端 未结 30 2481
無奈伤痛
無奈伤痛 2020-12-08 09:32

Some people claim that code\'s worst enemy is its size, and I tend to agree. Yet every day you keep hearing things like

  • I write blah lines of code in a day.
30条回答
  •  [愿得一人]
    2020-12-08 09:36

    It seems to me that there's a finite limit of how many lines of code I can refer to off the top of my head from any given project. The limit is probably very similar for the average programmer. Therefore, if you know your project has 2 million lines of code, and your programmers can be expected to be able to understand whether or not a bug is related to the 5K lines of code they know well, then you know you need to hire 400 programmers for your code base to be well covered from someone's memory.

    This will also make you think twice about growing your code base too fast and might get you thinking about refactoring it to make it more understandable.

    Note I made up these numbers.

提交回复
热议问题