Convention for Filenames of Generic Classes

后端 未结 11 1134
广开言路
广开言路 2020-12-08 00:20

I want to be able to distinguish between a generic and regular (non-generic) version of a class. Much like the .NET framework does with it\'s generic and non-generic version

11条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 00:47

    All new Microsoft classes use generics. The Queue and ArrayList were there before generics came out. Generics is the way forward.

    The convention for one-class-per-single file is to name the filename after the class name (whether generic of not). For MyClass, you'll have MyClas.cs. For every new namespace you'll need to create a new folder. This is how Visual Studio also works.

提交回复
热议问题