Page 1 of 1
How many characters do you use per line?
Posted: Fri Apr 08, 2005 3:15 pm
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++?
Posted: Fri Apr 08, 2005 3:47 pm
by Jonathan
I don't. I maximize emacs on my 1280x1024 screen. If stuff wraps on that, it just wraps.
Posted: Fri Apr 08, 2005 4:44 pm
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.
Posted: Fri Apr 08, 2005 5:02 pm
by Dave
2
//
Posted: Fri Apr 08, 2005 5:17 pm
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.
Posted: Fri Apr 08, 2005 5:20 pm
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.
Posted: Fri Apr 08, 2005 5:22 pm
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.
Posted: Fri Apr 08, 2005 5:25 pm
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.
Posted: Fri Apr 08, 2005 5:53 pm
by George
I've gotten in the habit of not indenting the contents of a namespace.
Posted: Fri Apr 08, 2005 6:30 pm
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.
Posted: Fri Apr 08, 2005 6:32 pm
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.
Posted: Fri Apr 08, 2005 8:19 pm
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?
Posted: Fri Apr 08, 2005 9:08 pm
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.
Posted: Sat Apr 09, 2005 12:23 am
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.
Posted: Sat Apr 09, 2005 12:28 am
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.
Posted: Sat Apr 09, 2005 1:20 am
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.
Posted: Sat Apr 09, 2005 1:34 am
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.
Posted: Thu Mar 02, 2006 11:14 pm
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
Posted: Thu Mar 02, 2006 11:30 pm
by Jonathan
So much concentrated awesome. I will have to start using C-x 3 now.
Posted: Thu Mar 02, 2006 11:34 pm
by Jonathan
Should be setq truncate-partial-width-windows ‘nil
Now with extra hyphen.