Is it a bad practice to have multiple classes in the same file?

后端 未结 15 2265
眼角桃花
眼角桃花 2020-12-08 03:48

I used to have one class for one file. For example car.cs has the class car. But as I program more classes, I would like to add them to the same file. For

15条回答
  •  甜味超标
    2020-12-08 04:24

    If you are working on a team, keeping classes in separate files make it easier to control the source and reduces chances of conflicts (multiple developers changing the same file at the same time). I think it makes it easier to find the code you are looking for as well.

提交回复
热议问题