开发者

Are DefType statments considered Bad Practice?

开发者 https://www.devze.com 2022-12-14 13:08 出处:网络
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:

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

精彩评论

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