A bad API design in .NET
来源:互联网 发布:厕所没门知乎 编辑:程序博客网 时间:2024/04/29 17:33
ArgumentNullException constructor is really a bad API design sample. First let us review the constructor definition of ArgumentException and ArgumentNullException(From MSDN):
public ArgumentException( string message, string paramName )
public ArgumentNullException( string paramName, string message )
As we know ArgumentNullException is the derived class of ArgumentException, but I don't know why the first param of derived class is paramName wheares base class is different. What's worse is both of params are string type so misunderstanding can't be found by compiler.
This bad design has been existing in all .NET versions(1.0-3.5), so we can conclude that a bad design is not easy to fix especially in case of compatibility is considered.
- A bad API design in .NET
- 《PHP: a fractal of bad design》笔记
- PUT or POST in RESTful API design
- How To Design a (module) API
- Software Design in a Postmodern Era
- A design & implementation of reflection in C++
- The only disability in life is a bad attitude
- AngularJS: a bad idea to manipulate DOM in controllers
- Web Design in a Nutshell : A Desktop Quick Reference (In a Nutshell)
- How to Design a Good API and Why it Matters
- Practical API Design: Confessions of a Java Framework Architect
- How to Design a Good API and Why it Matters
- How to Design a Good API and Why it Matters
- A SoundEx implementation in .NET
- ADO.NET in a Nutshell
- ADO.NET in a Nutshell
- INFO: Design Issues When Using IOCP in a Winsock Server
- How to design a tabpanel in blackberry like iPhone style
- SQL动态交叉表
- 今天学习hibernet
- java動態調用的範例(包括class/jar)
- Form表单中method="post/get"的区别
- 胃酸过多症的食疗方 [转]
- A bad API design in .NET
- Jikes 研究虚拟机(RVM)五 结论
- 突破WinXP下IIS连接数10的限制
- 这钱得收
- 解决WIN2003服务器不能上传大文件的限制
- Java代码编写的30条建议
- 黑客常用的命令和快捷键
- C#查询DNS的MX地址的代码
- 解决w3wp.exe占用CPU和内存问题 [转]