DeveloperLx
DeveloperLx
理由:User 这个命名过于简略,用在没有命名空间的的OC语言上容易发生命名冲突。 可以想见,一个叫做CYLUser的类,如果将其实例化的话,其对象名称必然叫做“user”。对于如此简略的名称,我们一般更加习惯是在诸如NSString字符串这样类型的实例上使用。倘若此时同时有一个字符串对象的名称也叫做“user”,两者就会发生很不舒服的命名冲突,而且也不好将其中一个改为另外的名称。 个人认为类名CYLUserModel,实例名称userModel才是更加适合,不易引起其它冲突尴尬的命名方案 同理,对于CYLSex,个人认为 typedef NS_ENUM(NSInteger, CYLSexType) { CYLSexTypeMan, CYLSexTypeWoman, }; 才能更容易避免项目之后的尴尬和冲突,并且容易说明这是一个枚举类型。Type和Status理应作为绝大多数枚举类型的通行关键词
**Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll...
**Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll...