Alex Thottunkel
- Total activity 2329
- Last activity
- Member since
- Following 0 users
- Followed by 0 users
- Votes 1
- Subscriptions 1176
Articles
Recent activity by Alex Thottunkel Sort by recent activity-
Avoid protected member in final classes
Why you should care The difference between private and protected visibility is that child classes can see and use protected members, but they cannot see private ones. Since a final class will have...
-
Avoid loop counter modification
Why you should care Loop counters shall not be modified in the body of the loop. However other loop control variables representing logical values may be modified in the loop, for example a flag to...
-
Avoid Equals methods not testing their parameters
Why you should care Because the equals method takes a generic Object as a parameter, any type of object may be passed to it. The method should not assume it will only be used to test objects of it...
-
Avoid catches that only rethrow
Why you should care A catch clause that only rethrows the caught exception has the same effect as omitting the catch altogether and letting it bubble up automatically, but with more code and the a...
-
Avoid nested try-catch blocks
Why you should care Although this is sometimes unavailable, nesting try/catch blocks severely impacts the readability of the source code as it makes it difficult to understand which block will cat...
-
Avoid long case statements
Why you should care The switch statement should be used only to clearly define some new branches in the control flow. As soon as a case clause contains too many statements this highly decreases th...
-
The code contains non-wrapped immediate function calls
Why you should care When a function is to be invoked immediately, the entire invocation expression should be wrapped in parents. Wrapping an immediate function invocation in parentheses is usefull...
-
The code contains too many var statements declaring several variables in it
Why you should care Although JavaScript allows to declare multiple variables in a single chain, it is recommended to declare each variable separately as it is easier to read and reduce the risk of...
-
The code contains too many jump instructions that derive the control flow out of a finally structure
Why you should care Using return, break, throw, and continue from a finally block overwrites similar statements from the suspended try and catch blocks. How we detect CAST Highlight counts one oc...
-
Avoid small switch/Case
Why you should care SWITCH statements are useful when there are many different cases depending on the value of the same expression. However, code will me more readable with IF statements for one o...