I'm unsure if I should write use <name of module> in two special cases.
Special Case 1:
I'm in module A. This needs a functionality of module B. But it also needs the functionality of modules B1 and B2. B1 and B2 are inheriting from B. Or in other words B is the base class of B1 and B2.
Now in module A:
use B; # not necessary because B1 and B2 are using B. use B1; use B2;
Shall I write use B; or not. What is your opinion?
Special Case 2:
Class A has an object of class B inside and of course uses its functionality. Class A is not creating the object B. The object B is created somewhere else and to class A is given the already created object of B. Because the object B is created outside of class A, I can assume that the Module B was loaded before somewhere else. And thus writing use B; in class A would not be necessary. Would you write use B; in class A?
What is your opinion? Thank you very much!
In reply to use of modules in special cases by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |