Optimize Usings Comments
I wasn't reallu sure what the optimizing usings would do, so I loaded
a small project and tried it out. Here are the usings before optimizing:
using System;
using System.Collections; // ArrayList
using System.Drawing;
using System.Data ;
// Using Reporting Engine from:
// http://www.mag37.com/projects/Printing/index.html?tabid=10
using ReportPrinting ;
using MyCustomNamespace ;
Here are the usings after optimizing:
// ArrayList
// Using Reporting Engine from:
// http://www.mag37.com/projects/Printing/index.html?tabid=10
using System;
using System.Collections;
using System.Data;
using System.Drawing;
using MyCustomNamespace;
using ReportPrinting;
]]>
I know this is probably a tough thing to format, but here are some comments.
I occasionally will add a comment on the same line as the using so I know
why I was using it. In this case, I added the comment // ArrayList for
System.Collections. However, after optimizing, the comment was stripped
and added to the top of the file away from the original using statement.
I also like to separate third party and custom usings from Microsoft's
with a blank line as shown in the before, this was also not persisted.
The other comments about the ReportEngine were also stripped.
Keep up the great work!
Derek Price
Please sign in to leave a comment.
Derek Price wrote: >I wasn't reallu sure what the optimizing usings would do, so I loaded >a small project and tried it out. Here are the usings before optimizing: > > >using System; >using System.Collections; // ArrayList >using System.Drawing; >using System.Data ; > >// Using Reporting Engine from: >// http://www.mag37.com/projects/Printing/index.html?tabid=10 >using ReportPrinting ; >using MyCustomNamespace ; > > >Here are the usings after optimizing: > > >// ArrayList >// Using Reporting Engine from: >// http://www.mag37.com/projects/Printing/index.html?tabid=10 >using System; >using System.Collections; >using System.Data; >using System.Drawing; >using MyCustomNamespace; >using ReportPrinting; > > >I know this is probably a tough thing to format, but here are some comments. >I occasionally will add a comment on the same line as the using so I know >why I was using it. In this case, I added the comment // ArrayList for >System.Collections. However, after optimizing, the comment was stripped >and added to the top of the file away from the original using statement. >I also like to separate third party and custom usings from Microsoft's >with a blank line as shown in the before, this was also not persisted. >]]>The other comments about the ReportEngine were also stripped.
For comments on using I'd settle for inline comments support. For spacing I
agree, some mechanism should be provided for separation, since that's very
common. In my previous life I was using Java IDE (IDEA's commercial competitor)
that had option to specify order of import statements (including blank lines)
with some regular expressions support (even though I think * was the only
expression supported :)). It would be very cool if we can get something
similar.
Curious to know, which IDE did you use? :)
--
Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Predrag Stanar" <reply.to.usenet@nospam.com> wrote in message
news:1nk4a01amrue682hgbsu1c96cqc8hqku4n@4ax.com...
>
comments.
>
I
competitor)
lines)
"Valentin Kipiatkov \(JetBrains\)" <valentin@intellij.com> wrote:
>> In my previous life I was using Java IDE (IDEA's commercial competitor)
>
>Curious to know, which IDE did you use? :)
Oh, you know ... that Jay-ConstructionWorker from company used to be called same
as they are now. How's that for lousy obfuscation?