5 ms·
I really don't like static imports for stuff like that. You always have to do a double take to recognize where the method comes from.
by tokenizerrr 10y ago
I really don't like static imports for stuff like that. You always have to do a double take to recognize where the method comes from.
- rootlocus 10y agoPersonally I've never had this problem. The context was always sufficient, and a simple IDE shortcut can offer me any additional information. I would argue a double take is worth reducing the number of dots I have to follow when reading the code. Also, in the case of `Wearable.MessageApi.sendMessage`, you can statically import `MessageApi.sendMessage` which gives a little more context.
- barrkel 10y agoI really like being able to read code in source control historical diffs, pull requests, etc. IDE shortcuts aren't a full solution; not everyone has time to check out a branch at that commit, create a project (if necessary), fire up an IDE (if there's a UI available) just to understand a line of code. Similarly, static imports at the top of the file are usually remote from the point of use, so you lose that context when viewing a diff.