4 ms·
On certain way of structuring classes and structs - there was and still is dogma among many developers for single file == single class, mainly coming from Java.
by neonsunset 3y ago
On certain way of structuring classes and structs - there was and still is dogma among many developers for single file == single class, mainly coming from Java.
However, you will see a lot of projects, especially OSS ones which are structured in more C or Rust like style with e.g. Types.cs if API surface is small - no need for a file per class or struct if declaring it takes 1-10 lines (especially with records and primary constructors).