Common Code Smells
Dead Code Example
Please read the comment in the code below. Will the SD 5.1 code ever get removed?
Or will programmers wonder whether it is still being used somewhere by someone and not want to risk deleting it?
public class Query…
// this is a login for SD 5.1
// NOTE: remove this when we convert all applications to 5.2
public void login(String server, String user, String password) throws QueryException {
sd52 = false;
try {
sdSession = sdLogin.loginSession(server, user, password);
} catch (SDLoginFailedException lfe) {
throw new QueryException(QueryException.LOGIN_FAILED, "Login failure " + lfe, lfe);
} catch (SDSocketInitFailedException ife) {
throw new QueryException(QueryException.LOGIN_FAILED, "Socket fail " + ife, ife);
}
}
Hey! Check this out! Here's a handout:
(Reading...)
Formatting Hints:
To format... | use this markup: |
---|---|
source code | {source:lang=java|lineNumbers=false}...{source} (Supported languages: java, cpp, csharp, c, python.) |
bold text | __some text__ |
italicized text | ~~some text~~ |
underlined text | @@some text@@ |
a method or class name | ``myMethod(...)`` |