摘要:
Documentation comments are the best, most effective way to document your API. Their use should be considered mandatory for all exported API elements. Adopt a consistent style that adheres to standard conventions. Remember that arbitrary HTML is permissible within documentation comments and that HTML meta characters must be escaped. 阅读全文
阅读排行榜
Effective C# 学习笔记(五十)构建小型内聚程序集
2011-09-12 23:17 by 小郝(Kaibo Hao), 415 阅读, 收藏,
摘要:
构建程序集的考虑要点
1. 将处理一个功能集的公有类型及其基类和接口放到一个程序中
2. 将各个公有类型共用的Utility类作为internal放到该程序集中
3.将各个程序集公用的Utility单独构建程序集(如:logging、Exception Handling) 阅读全文
Effective C# 学习笔记(三十)多用重载少用事件处理器
2011-07-17 21:12 by 小郝(Kaibo Hao), 408 阅读, 收藏,
摘要:
在.net中有两种实现事件机制的方式,一种方式是附加一个事件处理器,另一种是重载基类的虚方法。此两种方式各有其适用的环境。 阅读全文
JavaScript Patterns 5.9 method() Method
2014-07-04 13:11 by 小郝(Kaibo Hao), 405 阅读, 收藏,
摘要:
This post introduces how to use the method() method to extend the function object. 阅读全文
Effective Java 48 Avoid float and double if exact answers are required
2014-04-11 14:49 by 小郝(Kaibo Hao), 405 阅读, 收藏,
摘要:
Don't use float or double for any calculations that require an exact answer. Use BigDecimal if you want the system to keep track of the decimal point and you don't mind the inconvenience and cost of not using a primitive type. 阅读全文
Effective Java 41 Use overloading judiciously
2014-04-04 18:45 by 小郝(Kaibo Hao), 405 阅读, 收藏,
摘要:
You should generally refrain from overloading methods with multiple signatures that have the same number of parameters. You can name the method with same prefix rather than overloading the write method. Such as , these variants of ObjectOutputStream have signatures like writeBoolean(boolean), writeInt(int), and writeLong(long). 阅读全文
Effective C# 学习笔记(三十九) 使用Dynamic处理范型参数的运行时类型
2011-07-29 19:35 by 小郝(Kaibo Hao), 405 阅读, 收藏,
摘要:
由于Enumerable.Cast方法,其对T类型所知范围仅限于Sytem.Object类型的那些方法,所以对于T类型的特殊类型转换方法(无论是Implicit还是Explicit的)其都不会理睬。所以在使用运行时类型枚举转换时请注意使用适当的方法。 阅读全文
Effective C# 学习笔记(十六)尽量少的创建对象,给GC减减负
2011-07-08 22:12 by 小郝(Kaibo Hao), 405 阅读, 收藏,
摘要:
频繁的使用GC回收大量垃圾会使你的程序变得很慢,这时你要优化你的设计,构建复用的对象和在使用时才初始化的方法可以帮助你为GC减负。 阅读全文
Effective Java 54 Use native methods judiciously
2014-04-17 20:29 by 小郝(Kaibo Hao), 402 阅读, 收藏,
摘要:
Think twice before using native methods. Rarely, if ever, use them for improved performance. If you must use native methods to access low-level resources or legacy libraries, use as little native code as possible and test it thoroughly. A single bug in the native code can corrupt your entire application. 阅读全文
Effective Java 12 Consider implementing Comparable
2014-03-07 12:59 by 小郝(Kaibo Hao), 402 阅读, 收藏,
摘要:
Implementation Key point
• The implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x))for all x and y. (This implies that x.compareTo(y)must throw an exception if and only if y.compareTo(x)throws an exception.)
• The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0)implies x.compareTo(z) > 0.
• Finally, the implementor must ensure that x.compareTo(y) == 0 implies that
sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all 阅读全文
浙公网安备 33010602011771号