How many characters do you use per line?

For general rambling.
Post Reply
Peijen
Minion to the Exalted Pooh-Bah
Posts: 2790
Joined: Fri Jul 18, 2003 2:28 pm
Location: Irvine, CA

How many characters do you use per line?

Post by Peijen »

When you edit your code in any text editor how many characters per line do you set your editor to wrap? Or the character indicator like Notepad++?

Jonathan
Grand Pooh-Bah
Posts: 6722
Joined: Tue Sep 19, 2006 8:45 pm
Location: Portland, OR
Contact:

Post by Jonathan »

I don't. I maximize emacs on my 1280x1024 screen. If stuff wraps on that, it just wraps.

quantus
Tenth Dan Procrastinator
Posts: 4891
Joined: Fri Jul 18, 2003 3:09 am
Location: San Jose, CA

Post by quantus »

I do basically the same as Jonathan, except it if wraps, I'll find a logical place to break the line and just hit enter and tab it. Usually it's an if condition or a long list of options in a shell script so the break is pretty natural.
Have you clicked today? Check status, then: People, Jobs or Roads

Dave
Tenth Dan Procrastinator
Posts: 3483
Joined: Fri Jul 18, 2003 3:40 pm

Post by Dave »

2

//
It takes 43 muscles to frown and 17 to smile, but it doesn't take any to just sit there with a dumb look on your face.

George
Veteran Doodler
Posts: 1267
Joined: Sun Jul 18, 2004 12:26 am
Location: Arlington, VA

Post by George »

I turn off the wrap option entirely and put in the line breaks myself. I tend to break at 79, since some editors aren't real smart about how they handle the carriage return character. I'd rather have the code disappear off the side of the screen than wrap back and obscure the indentation.
I feel like I just beat a kitten to death... with a bag of puppies.

VLSmooth
Tenth Dan Procrastinator
Posts: 3055
Joined: Fri Jul 18, 2003 3:02 am
Location: Varies
Contact:

Post by VLSmooth »

I try to stick to 70 characters for easy readability. This is also what my xemacs configuration (default?) wraps to when I use <alt>+q

If I remember how to lookup xemacs bindings, I'll get the command for you.

VLSmooth
Tenth Dan Procrastinator
Posts: 3055
Joined: Fri Jul 18, 2003 3:02 am
Location: Varies
Contact:

Post by VLSmooth »

Btw, does anyone know how to enable xemacs line-wrapping in horizontal split mode? (<ctrl>+x, 3).

Panning gets horribly annoying at times.

Peijen
Minion to the Exalted Pooh-Bah
Posts: 2790
Joined: Fri Jul 18, 2003 2:28 pm
Location: Irvine, CA

Post by Peijen »

Ok, I guess 'wrap' isn't the word I am looking for. I mean what's the maximum limit you will allow your code to be? I don't use word wrap either, I basically do what George does, and I use word wrap to let me know when I go over the limit.

I have been programming with fully qualified name ie. Namespace1.Namespace2.Class, and the lines tend to get pretty long. 80 character is really limited in this case since namespace, class, and functions takes up 3 indents right there (at 4 characters per tab that's 12 characters gone). I also use long meaningful names, and that takes up more characters still.

I am using 120 currently but that doesn't turn out every good when I try to create documents with it.

George
Veteran Doodler
Posts: 1267
Joined: Sun Jul 18, 2004 12:26 am
Location: Arlington, VA

Post by George »

I've gotten in the habit of not indenting the contents of a namespace.
I feel like I just beat a kitten to death... with a bag of puppies.

Jonathan
Grand Pooh-Bah
Posts: 6722
Joined: Tue Sep 19, 2006 8:45 pm
Location: Portland, OR
Contact:

Post by Jonathan »

I don't keep to a hard and fast rule. One codebase around here uses 8 character indents, which gets pretty wide pretty fast. When I'm fiddling with that, I'll just create ridiculously long lines.

Otherwise, I try to break up lines at logical places, not points defined by a character count. Per argument, per array element, left hand statement/right hand statement, whatever makes sense in the context of what I'm writing. I dislike backslashes in code and never use them. If a statement can't be joined by a plain end of line, then it belongs on a single line.

By documents you mean paper? I used a projector when I had to discuss code with other people.

Jonathan
Grand Pooh-Bah
Posts: 6722
Joined: Tue Sep 19, 2006 8:45 pm
Location: Portland, OR
Contact:

Post by Jonathan »

VLSmooth wrote:Btw, does anyone know how to enable xemacs line-wrapping in horizontal split mode? (<ctrl>+x, 3).

Panning gets horribly annoying at times.
Nope. Post when you figure it out, cause I want to know. Usually I wind up using C-x 2 for precisely this reason. I need a 24" monitor.

George
Veteran Doodler
Posts: 1267
Joined: Sun Jul 18, 2004 12:26 am
Location: Arlington, VA

Post by George »

I was on one program where Word documents were used for code reviews, since they have built in reviewing and commenting capability.

On another program, we printed the code for each code review, and distributed copies to each reviewer several days early so they could redline it with any comments they had.

On my current program, we use a projector for code reviews, but it's caused people not to bother looking at the material before the review meeting. As a result, most of the errors slip through and have to be caught during later phases. But at least we're technically compliant with CMM level 4, so what else matters?
I feel like I just beat a kitten to death... with a bag of puppies.

Jonathan
Grand Pooh-Bah
Posts: 6722
Joined: Tue Sep 19, 2006 8:45 pm
Location: Portland, OR
Contact:

Post by Jonathan »

The usual method here involves identifying sections that required specific persons to inspect through inline comments. They look at them, insert additional inline comments, and then we have the review using a projector.

Jason
Veteran Doodler
Posts: 1520
Joined: Fri Jul 18, 2003 12:53 am
Location: Fairfax, VA

Post by Jason »

I do it based upon the size of the monitor I'm using at the time. Since I have a 24" at work now, I've actually almost never had to create a new line. Eclipse on a monitor that large is SWEET.

Peijen
Minion to the Exalted Pooh-Bah
Posts: 2790
Joined: Fri Jul 18, 2003 2:28 pm
Location: Irvine, CA

Post by Peijen »

Jason wrote:I do it based upon the size of the monitor I'm using at the time. Since I have a 24" at work now, I've actually almost never had to create a new line. Eclipse on a monitor that large is SWEET.
Well, I only have 1280x1024 screen at work. Yeah by document I meant word file/printed paper.

quantus
Tenth Dan Procrastinator
Posts: 4891
Joined: Fri Jul 18, 2003 3:09 am
Location: San Jose, CA

Post by quantus »

Dwindlehop wrote:I dislike backslashes in code and never use them. If a statement can't be joined by a plain end of line, then it belongs on a single line.
I find backslashes are useful when shell scripting and I'm chaining a lot of commands through pipes.
Have you clicked today? Check status, then: People, Jobs or Roads

George
Veteran Doodler
Posts: 1267
Joined: Sun Jul 18, 2004 12:26 am
Location: Arlington, VA

Post by George »

I use line-continuations in Makefiles a lot, and on rare occasions in #define macros. Although I usually only use macros like that in test code where I want to avoid cutting and pasting, but don't feel like using a template or inheritance.
I feel like I just beat a kitten to death... with a bag of puppies.

VLSmooth
Tenth Dan Procrastinator
Posts: 3055
Joined: Fri Jul 18, 2003 3:02 am
Location: Varies
Contact:

Post by VLSmooth »

Dwindlehop wrote:
VLSmooth wrote:Btw, does anyone know how to enable xemacs line-wrapping in horizontal split mode? (<ctrl>+x, 3).

Panning gets horribly annoying at times.
Nope. Post when you figure it out, cause I want to know. Usually I wind up using C-x 2 for precisely this reason. I need a 24" monitor.
BOOYA!
Courtesy of my roommate wrote:Regarding that question you asked me a little while ago….

The variable checked when determining whether emac’s lines are wrapped or not is “truncate-lines”. When set to “ ’nil ”, it disables truncation and does line wrapping. You can toggle it using “ M-x toggle-truncate-lines “. However, this doesn’t apply to windows with a vertical split (C-x 3)…..

For that, you must set the variable “truncate-partial-width-windows“ to ‘nil. I just do a ‘ M-: (setq truncate-partial-width windows ‘nil)’ on the evaluation line, but if you want it each time you might just want to stick that setq in your init.el, or make a toggle for it to. In fact… I might just do that now….

Hope that’s helpful

Jonathan
Grand Pooh-Bah
Posts: 6722
Joined: Tue Sep 19, 2006 8:45 pm
Location: Portland, OR
Contact:

Post by Jonathan »

So much concentrated awesome. I will have to start using C-x 3 now.

Jonathan
Grand Pooh-Bah
Posts: 6722
Joined: Tue Sep 19, 2006 8:45 pm
Location: Portland, OR
Contact:

Post by Jonathan »

Should be setq truncate-partial-width-windows ‘nil
Now with extra hyphen.

Post Reply