Path: utzoo!attcan!uunet!mcsun!ukc!slxsys!ibmpcug!dylan From: dylan@ibmpcug.co.uk (Matthew Farwell) Newsgroups: comp.editors Subject: Re: vi and emacs Message-ID: <1991Feb1.033021.18650@ibmpcug.co.uk> Date: 1 Feb 91 03:30:21 GMT References: <1991Jan30.224717.6150@bradley.bradley.edu> Reply-To: dylan@ibmpcug.CO.UK (Matthew Farwell) Organization: The IBM PC User Group, UK. Lines: 68 In article <1991Jan30.224717.6150@bradley.bradley.edu> larry@bradley.bradley.edu (Larry D. Stratton) writes: >Good God! I do know how to survive using vi and emacs. I've been using >them for months. The point is that a new programmer has an exaggerated >learning curve with these products as opposed to an editor with function >keys defined and use of the full range of keys on the keyboard. > >The objective, my dear sir, is not the mastery of an editor but rather the >productivity of the staff. Yours is a typical answer of a CS rather than a >manager. Get real. But if the staff were to master a editor then their productivity would increase.... Let me cite an example. In my younger days, I had a text file which was the basis of a program I was writing. (It was actually an interactive version of the purity test, which then added up the yes answers and gave the results to you. It actually also mailed the individual answers to me, but thats by the by). Anyway the line were something like 1) Have you ever done this and that in a moving land vehicle of over 800 tonnes unladen weight, blah blah blah. I spent about three days going through this file changing each question so that the input looked like 1) blah blah blah *** 2) blah blah blah2 *** etc. Now if I'd known how to use the editor properly at that time, I could have written a macro or two to cope%, ie :map q /^[0-9][0-9]*)^MO***^[jv :map v q :se nowrapscan Which would complete the job in significantly less time than three days. Another example: The other day I had a 400 line perl script in which I wanted (for various reasons) to change all instances of if () { die("\n"); } to die "\n" if (); This took me 20 seconds or so (one vi macro), instead of 20 minutes which it would have taken if I'd done it manually. If you wanted to loop thru a lot of lot of files changing all instances of #include "foo.h" to #include "whee.h", again thats two simple macros. If you want productivity to go up, then you should teach your programmers to use an editor properly, not tell them to use function keys. Dylan. -- % Admittedly, all of these particular example could be done using sed/awk/perl, but thats not the point of this article. -- Matthew J Farwell | Email: dylan@ibmpcug.co.uk The IBM PC User Group, PO Box 360,| ...!uunet!ukc!ibmpcug!dylan Harrow HA1 4LQ England | CONNECT - Usenet Access in the UK!! Phone: +44 81-863-1191 | Sun? Don't they make coffee machines?