DefType定义是否被认为是坏实践? [英] Are DefType statments considered Bad Practice?
问题描述
我想要你的想法为什么或(为什么不)这个声明应该(或不应该)使用。
I want your thoughts on why or (why not) this statement should (or should not) be used.
由于这是一个主观,这里是我的标准:
upvote给出具体原因(相对于无理意见)。最后接受的答案将是最全面的答案。
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 comprehensive answer.
推荐答案
在精心设计的程序中, Defxxx 语句是毫无意义的,因为所有的变量和函数都将被显式地输入。
In a well-crafted program, Defxxx statements are pointless, because all variables and functions will be explicitly typed.
除了一个案例:Defobj AZ,结合 Option Explicit ,使得(实际上)任何无类型或未声明的变量,函数或成员都不可能存在于代码中,并且使任何可以作为变体突出的东西都突出显示出来。
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 AZ是Option Explicit的腰带的吊带。
DefObj A-Z is the suspenders to Option Explicit's belt.
这篇关于DefType定义是否被认为是坏实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!