Unused code is harmful

Unused code — a variable, parameter, or literally some code — is harmful. Not because it does something in a wrong way — by definition it does not — but since it sits unused it tells that it is very likely it not by design, rather by omission. Hence Skila reports an error in such case — so far I implemented check for unused parameters. If it is intended, because you have to implement some interface method and in your particular implementation this or that parameter does not play any role, mark it explicitly:

def foo(@x : Int) : Int
  ...

The name of the parameter is “x”, and “@” character is here as an attribute. Of course the check works in other way too — you cannot use such parameter.

Tagged

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: