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-
Force casts should not be used
Why you should care Because force casting (as!) does not perform any type safety validations, it is capable of performing dangerous conversions between unrelated types. When the types are truly un...
-
Prefer to use an expression body for functions whose body consists of a single expression
Why you should care Prefer using an expression body for functions with the body consisting of a single expression. How we detect CAST Highlight counts one occurrence each time a function consisti...
-
Avoid abstract classes without abstract or concrete methods
Why you should care Abstract classes can have public constructors, and this is required in some particular cases. But a public constructor means that the class can be instantiated directly while, ...
-
Use short variable declarations (:=) for variables with default values
Why you should care Short variable declarations (:=) should be used if a variable is being set to some value explicitly. How we detect CAST Highlight counts one occurrence each time a local varia...
-
Avoid naming unused receivers
Why you should care If the receiver of a method is unused, do not give it a name. It's more readable because it's clear that the receiver is not used in method. How we detect CAST Highlight count...
-
Avoid instantiation with new
Why you should care Use &T{} instead of new(T) when initializing struct references so that it is consistent with the struct initialization. How we detect CAST Highlight counts one occurrence each...
-
Avoid 'switch' with too many 'case' statements
Why you should care When switch statements have large sets of case clauses, it is usually an attempt to map two sets of data. A real map structure would be more readable and maintainable, and shou...
-
Variables should not be shadowed
Why you should care Overriding a variable declared in an outer scope can strongly impact the readability, and therefore the maintainability, of a piece of code. Further, it could lead maintainers ...
-
Variables should be declared with 'let' or 'const'
Why you should care The distinction between the variable types created by var and by let is significant, and a switch to let will help alleviate many of the variable scope issues which have caused...
-
Multiline string literals should not be used
Why you should care Continuing a string across a linebreak is supported in most script engines, but it is not a part of ECMAScript. Additionally, the whitespace at the beginning of each line can't...