On Mar 14, 2008, at 1:50 PM, [EMAIL PROTECTED] wrote:

You'd think KISS principle would make people embrace the Linux coding style....

(80 column lines & 8 space indents)


That's all well and good if you code on a serial console, IMHO.

I've got a 1920x1200 pixel display on both my home and work desks, and my laptop displays have been larger than 1024x768 for some time now.

My preferred coding/editing environment is a gvim window set to 80cols x however many rows will fit on the display, and I try to keep my code looking good (and readable) in the 80col constraint. Let's face it, though, most people code like they have explosive diarrhea, and end their lines when they're damn well good and ready. I'm not against grabbing the edge of the window and pulling it wider until the lines stop wrapping, even if that means I give up and just hit the maximize button.

Most times it's because of offenses like

myresult = obj1.meth1(obj2.meth2(obj3.meth3(arg1, arg2, obj2.meth5(arg5))));

Basically, the programmer getting lazy and stuffing as much code into a method call as possible to get out of having to actually stuff method results in variables and take up precious lines on his screen. Don't talk to me about optimizing code by not defining intermediate variables, as I'll likely say something gruff and unsociably rude to you.

My own code, though, generally fits in 80 lines, with exceptions where there is no good way to break a line.

Insofar as spacing, though, I've adopted the habit of using VIM's shiftwidth setting in conjunction with autoindent, and my indent stops are at multiples of 4 spaces. Now, I realize that this can cause problems if someone changes their tabstop from the default 8. I know and respect several people that use tabs for all indenting, and simply adjust the tabstop in their editor to be 2 (or 4, or whatever) spaces. This has the benefit that you don't mix tabs and spaces, but more easily results in lines that blow past 80cols when you use a default 8-space tab stop.

Personally, I don't care so much about indent spacing or practices, and I'm capable of readily adapting to whatever style is used in the code I'm working with.

Gregory

--
Gregory K. Ruiz-Ade <[EMAIL PROTECTED]>
OpenPGP Key ID: EAF4844B  keyserver: pgpkeys.mit.edu


Attachment: PGP.sig
Description: This is a digitally signed message part

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to