Date: Tue, 2 Oct 2001 14:56:31 +0100 From: Paul Robinson <paul@akita.co.uk> To: j mckitrick <jcm@FreeBSD-uk.eu.org> Cc: Brad Knowles <brad.knowles@skynet.be>, freebsd-chat@freebsd.org Subject: Re: code density vs readability Message-ID: <20011002145631.C33832@jake.akitanet.co.uk> 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 %2B0100 References: <20010927141333.A44288@dogma.freebsd-uk.eu.org> <p05100334b7d8e6544d17@[194.78.144.27]> <20011002133112.B98079@dogma.freebsd-uk.eu.org> <20011002135226.A33832@jake.akitanet.co.uk> <20011002142257.C98079@dogma.freebsd-uk.eu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Oct 2, j mckitrick <jcm@FreeBSD-uk.eu.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011002145631.C33832>