vb.net - If I imported a class, should I still prepend that class name to its methods when they're used in a different class? -
i work codebase there many classes thousands of lines of code. i've noticed inconsistencies in style concerning prepending class names when using methods , i'm trying figure out previous developer's reasoning. if we
import generalcode
in class a, bad practice write
generalcode.dosomething()
in class since imported (instead of using dosomething()
)? think so, suppose it's nice know methods come classes @ glance, since class imports many classes , uses methods several of them.
edit: vb.net, not java (sorry wrong tag, rough morning). new vb.net generalcode
, dosomething()
not declared static, neither import in class a.
might vb.net, dosomething()
can indeed used or without prepending generalcode
.
a method need prefixed
the class name if it's static method.
the name of instance when it's not static method.
unless calling method own class.
Comments
Post a Comment