开发者

Are DefType statments considered Bad Practice?

I want your thoughts on why or (why not) this statement should (or should not) be used.

Since this is a little subjective, here is my criteria: Upvotes given for concrete reasons (as opposed to unreasoned opinion). Final answer accepted will be the most comprehensi开发者_如何学编程ve answer.


In a well-crafted program, Defxxx statements are pointless, because all variables and functions will be explicitly typed.

Except for one case: DefObj A-Z, in conjunction with Option Explicit, makes it (practically) impossible for any untyped or undeclared variable, function, or member to exist in your code, and makes anything that would wind up as a Variant stand out in sharp relief.

DefObj A-Z is the suspenders to Option Explicit's belt.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜