Click here to Skip to main content
16,004,778 members

Survey Results

How wide is your sourcecode?   [Edit]

Survey period: 7 Aug 2006 to 13 Aug 2006

We get a lot of submissions with code that is over 200 characters wide. Do people really code like that?

OptionVotes% 
80 characters wide or less30221.90
100 characters wide or less26319.07
120 characters wide or less18713.56
Some value greater than 120 characters836.02
Depends on the IDE I'm using1097.90
Depends on the monitor I'm using23116.75
No maximum line length20414.79



 
GeneralMostly 81 characters Pin
Hamed Musavi7-Aug-06 2:04
Hamed Musavi7-Aug-06 2:04 
GeneralMultiple Choice for Depends? Pin
Ed.Poore6-Aug-06 22:23
Ed.Poore6-Aug-06 22:23 
GeneralRe: Multiple Choice for Depends? Pin
Weiye Chen7-Aug-06 20:33
Weiye Chen7-Aug-06 20:33 
GeneralComments stretch the lenght out Pin
Gammill6-Aug-06 19:04
Gammill6-Aug-06 19:04 
GeneralRe: Comments stretch the lenght out Pin
Shawn Poulson7-Aug-06 4:11
Shawn Poulson7-Aug-06 4:11 
GeneralRe: Comments stretch the lenght out Pin
Paul Watson7-Aug-06 23:57
sitebuilderPaul Watson7-Aug-06 23:57 
GeneralRe: Comments stretch the lenght out Pin
PJ Arends8-Aug-06 16:21
professionalPJ Arends8-Aug-06 16:21 
GeneralRe: Comments stretch the lenght out Pin
David Veeneman9-Aug-06 3:42
David Veeneman9-Aug-06 3:42 
I have found that setting long comments off in a separate style helps readibility:

private void AssignID(int newItemIndex)<br />
{<br />
    // Get item added<br />
    TemplateItem itemAdded = this[newItemIndex];<br />
<br />
    /* When existing items are loaded from file, they already <br />
     * have a (non-negative) ID, so we don't assign one. When <br />
     * new items are added to the list, they have a (negative) <br />
     * dummy ID, so we assign an ID to the item. */<br />
<br />
    // Assign ID only if item doesn't have one<br />
    if (itemAdded.ID == -1)<br />
    {<br />
        itemAdded.ID = this.GetNextID();<br />
    }<br />
}


David Veeneman
www.veeneman.com

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.