From owner-freebsd-chat Tue Oct 2 6:56:31 2001 Delivered-To: freebsd-chat@freebsd.org Received: from jake.akitanet.co.uk (jake.akitanet.co.uk [212.1.130.131]) by hub.freebsd.org (Postfix) with ESMTP id 2851337B40A for ; Tue, 2 Oct 2001 06:56:27 -0700 (PDT) Received: from dsl-212-135-208-201.dsl.easynet.co.uk ([212.135.208.201] helo=wopr.akitanet.co.uk) by jake.akitanet.co.uk with esmtp (Exim 3.13 #3) id 15oQ1x-0004WS-00; Tue, 02 Oct 2001 14:56:17 +0100 Received: from wiggy by wopr.akitanet.co.uk with local (Exim 3.21 #2) id 15oQ2B-0008qg-00; Tue, 02 Oct 2001 14:56:31 +0100 Date: Tue, 2 Oct 2001 14:56:31 +0100 From: Paul Robinson To: j mckitrick Cc: Brad Knowles , freebsd-chat@freebsd.org Subject: Re: code density vs readability Message-ID: <20011002145631.C33832@jake.akitanet.co.uk> References: <20010927141333.A44288@dogma.freebsd-uk.eu.org> <20011002133112.B98079@dogma.freebsd-uk.eu.org> <20011002135226.A33832@jake.akitanet.co.uk> <20011002142257.C98079@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011002142257.C98079@dogma.freebsd-uk.eu.org>; from jcm@FreeBSD-uk.eu.org on Tue, Oct 02, 2001 at 02:22:57PM +0100 X-Scanner: exiscan *15oQ1x-0004WS-00*$AK$t6gTx7DvaXUxFQFRYmapW.* Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Oct 2, j mckitrick wrote: > So i'll bet you don't have a lot of blank lines or unnecessary "*****" > comment lines and fancy boxes. :-) Not really. If I'm writing stuff for servers nearby, then vi or vim is flexible enough to allow me to do all that, and I often will, but what I might be writing might end up only ed'able (no pun intended) later on, so certain things have to be thought about for certain applications. For me, a 'for' loop works better in that environment like this: for( i = 0; i < top_of_count; i++ ){ ... } Which I dare say you won't find on any other sites, and you probably wouldn't use yourself. Indenting is fine, but the idea behind this is that in ed I can do say '/i++' and it will find the above line, which I can replace with 's/i/i = a' to produce the line 'i = a++', but perhaps with some escaping on the command to be safe. Seems weird, but sometimes it needs to be done that way. Thankfully not very often. :-) > When every keystroke counts, especially during editing itself, you would > probably have a more parsimonious style. See above. Code comments are incredibly important to some of the stuff I do, and readability is pretty important. However, tightness is kind of important as well. I wouldn't go so far as to describe it as parsimonious though. :-) Thankfully I get to work on easier projects as well, which means I don't have to write code like the above all the time. :-) > This is why they tell us we should all learn our way around vi because > it is *always* there, unlike other editors, and it was *designed* for > just this kind of environment (slow terminals, odd settings, etc). Absolutely. It's also quite easy to pick up after a while. I remember having to spend a good few weeks getting my head around h, j, k and l though and probably wasted many hours trying to get my cursor to go in the direction I needed it in. :-) > I finally took several people's advice. I didn't give up VI, but emacs > is amazing for big, complicated jobs. I always hate the emacs bigotry though - when you're a vi-man and it's made known, the tone of voice that I sometimes encounter is most annoying. But then, I also run Zeus as my webserver, exim as my MTA, and my FTP is all handled out of SQL tables. I get a lot of people telling me I'm not doing things 'right'. I shall look at emacs again soon though and see if I can get the hang of it. -- PR To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message