Vita Rara: A Life Uncommon

How I Got Over "import java.util.*;"


Categories: |

It's taken me years, but I finally got over import java.util.*;. First, I don't use an IDE. I know an IDE could manage my imports, but I'm not an IDE guy. So, for years I've managed my imports manually, or given up and done import java.util.* and felt guilty about it. Well, I'm over that, and I can give Groovy the credit. By default Groovy imports java.util.*. I've been using Groovy every day now for about a year and a half and the house is still standing, our code compiles, we haven't had name conflicts. Things work, and it's a lot easier.

I used to worry about name clashes and compilation speed, and other shiboleths spoken of around coder camp fires and in hushed tones. After all everyone "knows" that the * should be avoided. Well, I'm over it, import java.util.* is just fine with me. Now when I start a Java source file I almost always just add java.util.*.

java.util.* is one of the most frequently used packages in my code. I don't want to spend mental time managing imports, and no I'm not going to an IDE, at least not now. So, it's import java.util.*. Hey, I even do import javax.persistence.* from time to time now! Oh me oh my!

Reply

Please solve the math problem above and type in the result. e.g. for 1+1, type 2
  • Allowed HTML tags: <a> <img> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <h1> <h2> <h3>
  • Lines and paragraphs break automatically.
More information about formatting options