User Tools

Site Tools


principles:rule_of_explicitness

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
principles:rule_of_explicitness [2013-08-10 10:57] – [Context] christianprinciples:rule_of_explicitness [2017-01-09 20:43] – [Strategies] Added a mention of not importing entire namespaces for C++ 148.80.254.2
Line 34: Line 34:
     * Avoid highly configurable modules. Instead implement varying behavior explicitly.     * Avoid highly configurable modules. Instead implement varying behavior explicitly.
   * Explicitly state which module to use   * Explicitly state which module to use
-    * Avoid importing all classes of a given package/namespace and import the needed classes explicitly. In Java this means not to specify wildcard imports like ''import package.*'' and to avoid static imports. Similarly in Python this means not to use wildcard imports.+    * Avoid importing all classes of a given package/namespace and import the needed classes explicitly. In Java this means not to specify wildcard imports like ''import package.*'' and to avoid static imports. Similarly in Python this means not to use wildcard imports. In C++, do not import entire namespaces (e.g. do not use ''using namespace std;'').
     * Avoid ''with'' statements in Delphi and other languages having constructs that let you invoke methods without explicitly stating the associated object.     * Avoid ''with'' statements in Delphi and other languages having constructs that let you invoke methods without explicitly stating the associated object.
   * Explicitly name parameters   * Explicitly name parameters
principles/rule_of_explicitness.txt · Last modified: 2021-10-18 22:06 by christian