How many characters do you use per line?
-
- 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?
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++?
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.
-
- Minion to the Exalted Pooh-Bah
- Posts: 2790
- Joined: Fri Jul 18, 2003 2:28 pm
- Location: Irvine, CA
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.
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.
-
- Grand Pooh-Bah
- Posts: 6722
- Joined: Tue Sep 19, 2006 8:45 pm
- Location: Portland, OR
- Contact:
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.
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.
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?
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.
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.
-
- Tenth Dan Procrastinator
- Posts: 3055
- Joined: Fri Jul 18, 2003 3:02 am
- Location: Varies
- Contact:
BOOYA!Dwindlehop wrote: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.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.
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