Questions about Coding Practices
- From: wangdaixing@xxxxxxxxx
- Date: Sun, 13 Jul 2008 22:11:48 -0700 (PDT)
I am reading "Programming .NET Components" 2nd Edition by Juval Lowy,
O'Reilly. In Appendix E, there is a chapter "Coding Practices" which I
agree and practice mostly. However, there are a few items I don't
quite understand why as listed below, my questions are marked Q:
10. Avoid method-level document.
a. Use extensive external documentation for API documentation.
b. Use method level comments only as tool tips for other developers.
Q: Visual Studio and SandCastle have provided comprehensive support
for in-source document, so I would thin that method-level
documentation is encouraged. For example, in IDE, after you add /// on
the top of a method, framework of in-source document for the method is
created.
29. Avoid using the trinary conditional operator.
Q: Is it really hard to read?
35. Always mark public and protected methods as virtual in a non-
sealed class.
Q: what is the incentive to mark all as virtual?
58. Do not use late-binding invocation when early binding is possible.
Q: Microsoft Application Blocks seem to encourage the uses of late-
binding invocation. Personally I like early binding as the compiler
may check errors for me.
Can you answer or make a comment?
Cheers
Daixing
.
- Follow-Ups:
- Re: Questions about Coding Practices
- From: Pavel Minaev
- Re: Questions about Coding Practices
- From: Peter Morris
- Re: Questions about Coding Practices
- From: Peter Duniho
- Re: Questions about Coding Practices
- Prev by Date: Re: Forms.Timer - multithreaded?
- Next by Date: Re: How do I combine enumerated constants?
- Previous by thread: Installation
- Next by thread: Re: Questions about Coding Practices
- Index(es):