随笔分类 -  代码之美

摘要:Naming Conventions“c” = camelCase“P” = PascalCase“_” = Prefix with _Underscore“x” = Not Applicable.IdentifierPublicProtectedInternalPrivateNotesProject FilePxxxMatch Assembly & Namespace.Source FilePxxxMatch contained class.Other FilesPxxxApply where possible.NamespacePxxxPartial Project/Assembl 阅读全文
posted @ 2013-04-27 13:27 重庆Debug 阅读(248) 评论(0) 推荐(0)
摘要:The Art of Readable CodeAuthor:Dustin Boswell, Trevor FoucherPart 1: Surface-Level ImprovementsPart 2: Simplifying Loops and LogicPart 3: Reorganizing Your CodeSelected Topic: Readability and TestabilityKey IdeaPack Information into your names这里提供了六个准则,让你在命名程式中的变量(variable)、函数(function)、类(class)时,能取 阅读全文
posted @ 2013-04-25 12:28 重庆Debug 阅读(281) 评论(0) 推荐(0)
摘要:ReferencesNamingGeneral Naming Rulesint num_errors; // Good.int num_completed_connections; // Good.int n; // Bad - meaningless.int nerr; // Bad - ambiguous abbreviation.int n_comp_conns; // Bad - ambiguous abbreviation.// Good// These show proper names with no abbreviations.int num_dns_connections; 阅读全文
posted @ 2013-04-25 10:59 重庆Debug 阅读(307) 评论(0) 推荐(0)