Generally speaking, is the program written separately as much as possible, or is it written in a single file as much as possible

  android, question

图片描述

图片描述

Is there any operational difference? Performance?

Many people cooperate to write in multiple files as much as possible, and the writing of a single file tends to become more complicated, resulting in the difficulty of maintaining the entire program.
When writing programs, it is best to have a hierarchical concept, such as MVC hierarchy. Codes at the same level are written at the same level. Complex codes can be abstracted as much as possible.