Fog Creek Software
Discussion Board




An IDE 'itch'

Just a general comment.

When I look at code that my co-workers have written, the comment formatting is often out of whack. Specifically, the folks using 5 point fonts have loooong comment strings (prefixed with '//' in C++/Java) that fall off the right side of my monitor.

What I'd love is for my IDE (MS Studio or Eclipse) to recognize these comments strings, and format them so that they fit my editor width. I'm not talking about changing the code, but just visually fixing the layout.

I don't think this would be too difficult for them to do, has this been tried?

Edward
Wednesday, July 21, 2004

That's something I've seen MS been asked, and they said they had considered that. It didn't sound like they were going to implement it for sure, though.

sid6581
Wednesday, July 21, 2004

you could call it word wrap.

Andrew Cherry
Wednesday, July 21, 2004

Haven't seen this in a code editor, but Opera reformats lines and quotes (>) to minimise line count when viewing e-mails.

MugsGame
Wednesday, July 21, 2004

You're one of those old farts who codes in 24 pt font because you're half blind, aren't you?

muppet
Wednesday, July 21, 2004

I bet you use Comic Sans, too.

muppet
Wednesday, July 21, 2004

Once again, muppet's contribution is to insult someone with a different opinion.  Thanks, muppet.


Wednesday, July 21, 2004

If you're so self-rightous, why hide behind a blank?

Maybe it's just me, but I read muppet's comments with an implied ;)

We're not all deadpan serious here, boys and girls.

Greg Hurlman
Wednesday, July 21, 2004

I though Eclipse gave you a nice word-wrapped version in a pop up when you hovered over.  I'll have to check at home.

Frustrated Maintenance Programmer
Wednesday, July 21, 2004

"Maybe it's just me..."

Yes, it is just you.

anti-muppet
Wednesday, July 21, 2004

word wrap sticks the comment into the middle of the code your trying to read:

if
(x==1)
{
    y=5;                            //  This must be done first
because of some other problem
    z=6;
}

what would be nice is a wrap like this:

if
(x==1)
{
    y=5;                            //  This must be done first
                                            because of some other
                                            problem
    z=6;
}

Steamrolla
Wednesday, July 21, 2004

The free XCode IDE that comes with OS X does this softwrapping of long comments, but it's not really so exciting a feature. I, er, am one of those small-fonters myself so it doesn't affect me as a problem.

Sandy Mallorca
Wednesday, July 21, 2004

Emacs can be set up to behave like the first example.  I personally don't like it and turn that feature off.

christopher (baus.net)
Wednesday, July 21, 2004

/*
make everyone
comment like
this
*/

null fame
Wednesday, July 21, 2004

Or like this:

  if (x==1)
  {
      //  This must be done first because of some other problem
      y=5;                           
      z=6;
  }

Jussi Jumppanen
Thursday, July 22, 2004

Don't ever write a line longer than 80 characters.

Use an IDE that draws a line at the 80 character point, and make it a rule to never write past it.  Delphi does this.  I'm not sure about Visual Studio, but as of VS6, it did not.

JT
Thursday, July 22, 2004

I agree, but you didn't say why stay less than 80 columns.

The reason I agree is because printed listings work so much better this way.  Also, I do work on Unix systems where a Telnet session with vi is used, and 80 columns works better in this environment.

Buy why did you say this?

AllanL5
Thursday, July 22, 2004

80 columns is an accepted standard that goes back to those telnet terminals of which you speak.  You'll still find that a standard command prompt, text printout, and a lot of other things that deal with plain text, will assume an 80 column line width.  Is one of those standards that is really quite historical, and in today's technology, arbitrary.  It's what the FAA calls a "concensus" standard.  It's 80 because everyone says it is.

JT
Friday, July 23, 2004

Thank you for the extended illustration, that's exactly what I wanted to know.

Also, the original punch card was 80 columns.

However, just because it is historical, doesn't make it wrong.  Doesn't make it right, either, my Commodore 64 only had a 40 column wide screen, and I STILL find 40 columns to be too short.

80 columns seems to be a good comprimise between space on the screen, amount of text allowed, and where to word-wrap. 

132 columns is also good -- but not as flexible as 80 columns.

AllanL5
Saturday, July 24, 2004

*  Recent Topics

*  Fog Creek Home