When declaring literal numbers such as
LongorFloat, use upper case suffix. For example, prefer2Lto2l.
Depending on the font and the syntax highlighting scheme, some letters look a lot like numbers. In some configurations, for example, l (lower case L) and 1 (one) are basically indistinguishable. Github, for instance, while not the worst offender, isn’t doing a great job there.
To the casual reader, the following has a fair chance of looking like a list of Ints, but a Long sneaked in:
List(1, 11, 111, 111l, 11111, 11111, 11111)
Using upper-case letters makes this more obvious:
List(1, 11, 111, 111L, 11111, 11111, 11111)
| Linter | Rule |
|---|---|
| Scalastyle |