Re: The Elements of Informix-4gl Style?
Posted in 1992
Path: emory!europa.asd.contel.com!uunet!ddssuprs!lpc From: lpc@dickens.com (Luis P Caamano) Newsgroups: comp.databases.informix Keywords: 4gl style Message-ID: <1992Mar10.210913.18231@dickens.com> Date: 10 Mar 92 21:09:13 GMT References: <29B7A050.1042@tct.com> <1992Mar09.021316.10584@dickens.com> <29BC2DE7.7F9D@tct.com> Organization: Dickens Data Systems, Inc. In article <29BC2DE7.7F9D@tct.com> jim@tct.com (Jim Kunzman) writes: >According to lpc@dickens.com (Luis P Caamano): >>In article <29B7A050.1042@tct.com> jim@tct.com (Jim Kunzman) writes: > ><stuff deleted> > >>>I have to agree with Paul. Proper use of lower case and/or mixed case >>>makes code much easier to read. Early programs used upper case >>>exclusively because of teletype limitations and terminal limitations. >>>However, no magazine or newspaper would ever conceive of abusing >>>readers by overusing upper case. Neither should programming languages >>>or programmers. Uppercasing KEYWORDS is particularly annoying and >>>causes me to pause and wonder why anyone would want to bother >>>highlighting them. It decreases input speed for both the programmer >> ^^^^^^^^^^^^^^^^^^^^^^ >> I don't agree. >>>and the reader. -Jim > >You mean you can type upper case charcters as fast as lower case? >Most people can't, but perhaps you are the exception. > yes I do, but I also use vi's ab command (abbreviations). I added the most common keywords on my .exrc and then when wanting to type SELECT I just type sel (space) and vi will change that to SELECT. Here is a sample of my .exrc, as you can see I don't type the whole keywords anymore, and I also included in the example an abbreviation for the common centering code, of course you can put whatever piece of code you use the most. I just put it there to show that abbreviations are not limited to words. The trick is still useful even if you don't like UPPERCASE. If you want to test it type :set ab da DATABASE and then do insert and type 'da<space>' and you'll see how vi changes that to DATABASE. Maybe you know that but I'm adding it for those that don't. ------.exrc------ set autoindent set showmode set shiftwidth=4 set showmatch :ab ce LET scr_pos = 39 - (LENGTH(str) / 2)DISPLAY str CLIPPED AT xx,scr_pos :ab ini INITIALIZE :ab da DATABASE :ab sel SELECT :ab fr FROM :ab wh WHERE :ab fe FETCH :ab ins INSERT :ab dec DECLARE :ab scr SCROLL :ab cur CURSOR FOR :ab into INTO :ab ope OPEN :ab ord ORDER BY :ab notf NOTFOUND :ab upda UPDATE :ab clo CLOSE :ab call CALL :ab cons CONSTRUCT :ab defi DEFINE :ab disp DISPLAY :ab att ATTRIBUTE :ab fore FOREACH :ab func FUNCTION :ab disb DISPLAY BY NAME -----------END .exrc-------------------- >> >>I have to say that after you've written several apps in 4GL, you >>don't need to read the keywords. Hence, uppercasing KEYWORDS makes >>it easier to read 4GL code. Why? you'll read subsconciously the >>keywords and use some cpu cycles (or brain cycles :-) to read only >>the variables and table names. >> > >I can spot the keywords out of context. I don't need to use >uppercasing to remind me. This is akin to having your wife yell at >you all the time. I thought the big advantage to 4GL and SQL is that >they are so "English" like. > Well Jim, I guess you have a faster CPU than I do and I guess that's why they make toilets in different colors :-) people are different. Hope you don't get me wrong on this one but it seems that what we're discussing is just a matter of taste and not a subject that we can discuss objectively. C U later ... -- --------------------------------------------------------------------------- Luis P. Caamano | lpc@dickens.com Dickens Data Systems, Inc. | uunet!ddssuprs!lpc Norcross, GA | (404) 242-5991 --------------------------------------------------------------------------- If you think you know it all, you'll stop learning. -myself The more I learn, the more I know I know nothing. -somebody else