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-
Boolean checks should not be inverted
Why you should care It is needlessly complex to invert the result of a boolean comparison. The opposite comparison should be made instead. This is furthermore the case in compound conditions. How ...
-
Avoid using multiple labeled returns in lambda expression
Why you should care The return keyword is relative to the nearest enclosing function (or anonymous function). So for returning from lambda, a labeled return is needed. But as recommended by offici...
-
Avoid generic catch
Why you should care You should not ignore exceptions. It can be tempting to be lazy when catching exceptions and do something like this: (see example below). Developers should avoid this. In almo...
-
Use Elvis operator to avoid unclear syntax pattern
Why you should care Elvis operator ?: is an syntactic sugar for if (!x) { x=something }. Prefer Elvis notation for readability considerations. How we detect CAST Highlight counts one occurrence e...
-
Avoid undefined type on data or routines declaration
Why you should care Groovy support dynamic types, that is declarations where the type is def or unspecified. How we detect CAST Highlight counts one occurrence each time a function, method, field...
-
Avoid to update static fields from instance methods
Why you should care Correctly updating a static field from a non-static method is tricky to get right and could easily lead to bugs if there are multiple class instances and/or multiple threads in...
-
Avoid to update parameters inside routine's bodies
Why you should care Reassigning parameter of function to a new value within the body of the method/closure, is a confusing and questionable practice. Use a temporary variable instead. How we detec...
-
Avoid to cover two dimensional ranges with nested for loop
Why you should care Nested for loops are not a good practice because for loops are using an increment to cover a range, and nested for loops are meant to cover a two dimensional range, leading to ...
-
Avoid Public finalize() methods
Why you should care A program should never call finalize explicitly, except to call super.finalize() inside an implementation of finalize(). In mobile code situations, the otherwise error prone pr...
-
Avoid confusing initialization for variables declared on the same line
Why you should care Destructuring assignment are a practical sugar syntax, but due to dynamic typing, ommitting the parentheses lead to a syntactically correct, but however functionnally incorrect...