Hacker News new | ask | show | jobs
by halfastack 2734 days ago
I have difficulty seeing what this would add. As a Java developer, I know what "List" is, just like I know what "ArrayList" is. If someone instantiated new better.ArrayList(), I immediately have to check what the hell is the import (go to the top of the class, uncollapse the import statements, and see what is "better").

As with all code readability, I assume to write and use import aliases, that's very easy. The person who's gonna read it after you, they've got a problem. And that's why I'd personally be strongly against this in my code review.

2 comments

Using the example from your other reply:

import java.awt.List as awtList

import java.util.List as utilList

Granted, there's not a lot of scenarios where you have this sort of collision, but it does happen and using aliasing makes the code easier to read.

> As a Java developer, I know what "List" is

Is that java.awt.List or java.util.List?