Re: The Elements of Informix-4gl Style?
Posted in 1992
Path: emory!wupost!cs.utexas.edu!sun-barr!west.West.Sun.COM!male.EBay.Sun.COM!exodus.Eng.Sun.COM!appserv.Eng.Sun.COM!sun!amdcad!weitek!pyramid!infmx!johnl From: johnl@informix.com (Jonathan Leffler) Newsgroups: comp.databases.informix Keywords: 4gl style Message-ID: <1992Mar6.131106.16361@informix.com> Date: 6 Mar 92 13:11:06 GMT References: <1992Mar5.021035.18374@StarConn.com> <1992Mar6.032749.6321@nas.nasa.gov> Sender: Jonathan Leffler (johnl@obelix.informix.com) Organization: Informix Software, Inc. In article <1992Mar6.032749.6321@nas.nasa.gov> jcarter@sun204.nas.nasa.gov (John R. Carter Sr.) writes: >In article <1992Mar5.021035.18374@StarConn.com> pmahler@StarConn.com >(Paul Mahler) > dumped on us: >> So what do you folks think? What makes for an attractive, >> legible, practical 4gl style? > >And I respond: > Why the BIG BOLD LETTERS, of course. That way I can find the >keywords faster. I also prefer the formatting the way Snyder did it. > > ... > >But honestly, I couldn't speed read your version >as fast as I could the original. What would have made the original even >easier to read is more blank lines between sections of related code, >like after every COMMAND: > > COMMAND "Exit" "Returns to the INFORMIX-SQL menu." HELP 1 > EXIT MENU > > COMMAND KEY (CONTROL-G) > CALL fgl_prtscr() > > ... > >What makes sense to me is what reads well, not what looks aesthetically >beautific (?) by some programming standard. I would second John's view. When I write C, I write in the C idiom and use lower case keywords. When I write in I4GL, I use upper case for keywords, lower case for program variables, and mixed case for database objects, thus: SELECT T1.*, T2.* FROM Table01 T1, Table02 T2 WHERE T1.Column01 = T2.Column01 AND T2.Column02 >= r_table02.widget_size This make it clear (to me), that Table01 and Table02 are tables, r_table02.widget_size is a program variable, and SELECT etc are keywords. Its a moot point whether the table aliases I used are a good idea: if the two tables were Widget and Stock, I'd have used W and S as aliases. The original code from Dave Snyder has fewer blank lines than I'd use, but otherwise conforms to the style I prefer. -- ------------------------------------------------------------------- Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>