+1
I actually cannot remember when I last wrote imports manually. For me using auto-completion, quick-fixes and organize
import do the job most of the time.
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Alena Laskavaia
Sent: Montag, 19. Januar 2015 17:44
To: CDT General developers list.
Subject: Re: [cdt-dev] Using '*' for java imports
+1 for using "Organize Imports". I think people should enabled this as save action.
On Mon, Jan 19, 2015 at 11:34 AM, Marc Khouzam <marc.khouzam@xxxxxxxxxxxx> wrote:
I wasnt' suggesting going through CDT's code to clean that up :)
Maybe just a recommendation to avoid using import wildcards.
Actually, the recommendation should be to use Eclipse's automatic import feature (ctrl-sht-O) all the time. That will avoid a rearrangement of imports when some other change is made by someone else.
I believe using wildcards for imports can, in some cases, cause issues.
http://www.coderanch.com/how-to/java/WildCardVsSpecificImports
http://stackoverflow.com/questions/147454/why-is-using-a-wild-card-with-a-java-import-statement-bad/147461#147461
This question should not apply to CDT in general if we we use Ctrl-Shift-O to manage our imports since Eclipse won't use wildcards unless you have more than 99 similar imports. I think there is only one file were that happens, which triggered Elena's question.
I agree not to ask people to change their settings. For that one file, I'll probably change it back myself when I notice it, but I won't ask others to do it.
Now, to my surprise, I do see that wildcards are used once in a while in CDT for imports. Those are imports that were included by hand. I think we should avoid those as a general rule.
I'd would suggest CDT not uses wilcards for imports unless Eclipse does it itself using Ctrl-Shift-O. This addresses Elena's concern, and makes the code more robust.
Opinions?
Does it really make the code more robust? I just want to make sure if we’re going to spend a lot of time on an issue, that it’s a real issue.
Marc
Marc are you ok with that?
On Mon, Jan 19, 2015 at 9:54 AM, Doug Schaefer <dschaefer@xxxxxxx> wrote:
I just use the defaults. I have too many workspaces to be changing settings other than getting my emacs keys turned on.
We have no official rules. I think we’re all to busy with the little time we have working on fixing up and growing the CDT to worry much about that. The defaults
are fine.
Do you edit default eclipse settings for "Organize Import"?
I do Organize imports too and it collapses them into * if I have more than 99 import, which is default.
So what is our "official" rule for that?
On Fri, Jan 16, 2015 at 10:00 PM, Doug Schaefer <dschaefer@xxxxxxx> wrote:
I always do an Organize Imports when I edit a file. My experience is that gets rid of the '*'s. So if it's a file I'm editing, the *'s won't last long.
It does say though that we use default Eclipse formatting. By default eclipse folds imports into * if you have more then 99 imports (that was the case I had). Unless
it is really needed I would not
be a fan of changing eclipse defaults, i.e. we should allow fold imports if more than 99.
Anybody have strong objections to do otherwise?
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev
|