Too many imports spamming my code

后端 未结 8 2650
既然无缘
既然无缘 2021-02-18 13:37

In my project I have a shapes package which has shapes I designed for my graphics program e.g Rectangle, Circle. I also have one or two more packages that have the

8条回答
  •  北恋
    北恋 (楼主)
    2021-02-18 14:17

    Yes, too many imports is a bad thing because it clutters your code and makes your imports less readable.

    Avoid long import lists by using wildcards.

    Kevlin Henney talks about this exact Stack Overflow question 27:54 into his presentation Clean Coders Hate What Happens to Your Code When You Use These Enterprise Programming Tricks from NDC London 16-20 Jan 2017

提交回复
热议问题