没有合适的资源?快使用搜索试试~ 我知道了~
首页C# 代码规范(微软)
C# 代码规范(微软)
5星 · 超过95%的资源 需积分: 11 406 下载量 129 浏览量
更新于2023-03-16
评论 2
收藏 177KB DOC 举报
微软出的C#代码规范,呵呵。 避免将多个类放在一个文件里面。 2. 一个文件应该只有一个命名空间,避免将多个命名空间放在同一个文件里面。 3. 一个文件最好不要超过500行的代码(不包括机器产生的代码)。 ......................................
资源详情
资源评论
资源推荐
C# Coding Standards
Your Company Name Here
Abstract
This document contains coding conventions and style guidelines that will ensure that C# code will
be of consistent and superior quality. It includes general coding guidelines as well as discussions
on naming, formatting, and language usage patterns.
Contents
1. Introduction......................................................................................................................................................... 3
1.1 Purpose 3
1.2 Scope 3
1.3 Document Conventions 3
1.4 Feedback 3
2. C# Golden Rules................................................................................................................................................. 4
3. Formatting........................................................................................................................................................... 5
3.1 Class Layout 5
3.2 Indicating Scope 5
3.3 Indentation & Braces 6
3.4 White space 6
3.5 Long lines of code 7
4. Commenting........................................................................................................................................................ 8
4.1 Intellisense Comments 8
4.2 End-Of-Line Comments 8
4.3 Single Line Comments 8
4.4 // TODO: Comments 8
4.5 C-Style Comments 8
5. Capitalization & Naming..................................................................................................................................... 9
5.1 Capitalization 9
5.2 Naming 9
6. Programming.................................................................................................................................................... 10
6.1 Namespaces 10
6.2 Classes & Structures 10
6.3 Interfaces 10
6.4 Constants 11
6.5 Enumerations 11
6.6 Variables, Fields & Parameters 11
6.7 Properties 12
6.8 Methods 13
Your Company Name Here 1
6.9 Event Handlers 13
6.10 Error Handling 13
Appendix A. Naming Parts & Pairs..................................................................................................................... 15
A.1 Common Adjective Pairs A.2 Common Property Prefixes 15
A.3 Common Verb Pairs 15
A.4 Common Qualifiers Suffixes 15
Appendix B. References...................................................................................................................................... 16
Revision History................................................................................................................................................... 17
Your Company Name Here 2
1. Introduction
1.1 Purpose
The purpose of this document is to provide coding style standards for the development of source code written in C#.
Adhering to a coding style standard is an industry proven best-practice for making team development more efficient and
application maintenance more cost-effective. While not comprehensive, these guidelines represent the minimum level of
standardization expected in the source code of projects written in C#.
1.2 Scope
This document provides guidance on the formatting, commenting, naming, and programming style of C# source code
and is applicable to component libraries. web services, web sites, and rich client applications.
1.3 Document Conventions
Example code is shown using the Code font and shows syntax as it would be color coded in Visual Studio’s code editor.
1.4 Feedback
Feedback on these guidelines is highly encouraged. Please send any questions or comments to your application
architect.
Your Company Name Here 3
剩余17页未读,继续阅读
patrickpan
- 粉丝: 559
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 2023年中国辣条食品行业创新及消费需求洞察报告.pptx
- 2023年半导体行业20强品牌.pptx
- 2023年全球电力行业评论.pptx
- 2023年全球网络安全现状-劳动力资源和网络运营的全球发展新态势.pptx
- 毕业设计-基于单片机的液体密度检测系统设计.doc
- 家用清扫机器人设计.doc
- 基于VB+数据库SQL的教师信息管理系统设计与实现 计算机专业设计范文模板参考资料.pdf
- 官塘驿林场林防火(资源监管)“空天地人”四位一体监测系统方案.doc
- 基于专利语义表征的技术预见方法及其应用.docx
- 浅谈电子商务的现状及发展趋势学习总结.doc
- 基于单片机的智能仓库温湿度控制系统 (2).pdf
- 基于SSM框架知识产权管理系统 (2).pdf
- 9年终工作总结新年计划PPT模板.pptx
- Hytera海能达CH04L01 说明书.pdf
- 数据中心运维操作标准及流程.pdf
- 报告模板 -成本分析与报告培训之三.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论30