Using ED as an editor to write programs reminds me of the story of the blind man.
0. The man came to Jesus for help. 1. Jesus spat on the dry ground. 2. ...Rubbed the mud in his eyes. 3. ...Told him to wash it off. When the man washed his eyes, he could see. In this little parable, those using ED are like the blind man. This list is like... The Oracle. Consider the miracle of EditPlus. --B -----Original Message----- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Joshua Gallant Sent: Thursday, June 25, 2009 8:55 AM To: U2 Users List Subject: Re: [U2] Mixed Case UV Basic Programming Standards. People use something other than ED? For the most part, all programmers on our staff do use the ED editor but there are a few of us who like the functions like syntax highlighting, etc. We code in all UPPER case here. We've had programs around for 30 years so the base programs were always uppercase and we just stuck with it over the years. - Josh -----Original Message----- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Symeon Breen Sent: Thursday, June 25, 2009 5:59 AM To: 'U2 Users List' Subject: Re: [U2] Mixed Case UV Basic Programming Standards. An important point there from Brian on editors, yes the editors we use (no one writes code in ed do they?) will colour highlight verbs, literals, comments, variables etc + do case insensitive searches.. -----Original Message----- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Brian Leach Sent: 25 June 2009 10:14 To: 'U2 Users List' Subject: Re: [U2] Mixed Case UV Basic Programming Standards. Hi I use mixed case using the same capitalization as for Delphi and VB (rather than camelCase for C# and Java). OpenSeq NumberOfFields = DCount(SomeVariable, @FM) However I use upper case to distinguish things that are 'special' e.g. equate literals, file and select variables, common variables and compiler directives. That way they stand out. I also use upper case for STOP and the main RETURN from an external subroutine, which helps to distinguish it from the Return from a local GoSub. I don't worry about searching since the editors I use are capable of searching case-independently, and you can always write an IDescriptor to do an UPCASE(@RECORD) if you want to search in a source file. In fact, generally I find doing a SELECT with a LIKE clause on that is faster than using the SEARCH command. There should be no need to do anything special to format your comments since any editor worth using will distinguish these (as a bare minimum). I have a simple 'autodoc' markup in the comments that makes it easy to generate technical docs. So, putting it all together: PROGRAM ShowStuff *--------------------------------------------------------------------- * @@Name : ShowStuff * @@Project : Demo * (other autodoc header info here) *--------------------------------------------------------------------- * @@Info{ * Shows some stuff. * <b>And some other comments in here with HTML markups</b> * } *--------------------------------------------------------------------- * (other autodoc comments here: modifications, keywords, todo etc. *--------------------------------------------------------------------- * version stamp goes in here - assigned to a variable so it compiles into * the object and I can then rip it from the string table. VERDATA = "Version=001002003;" VERDATA:= "VerDate=12345;" VERDATA:= "VerDesc=Short Description here;" (etc) *--------------------------------------------------------------------- $INCLUDE BOOK_TITLES.h Open "BOOK_TITLES" To TITLES Else Crt "Cannot open the TITLES File" RETURN End Execute "SSELECT BOOK_TITLES", SELECT. > SLIST Fin = @False Loop ReadNext TitleId From SLIST Else Fin = @True End Until Fin Do GoSub ShowISBN Repeat RETURN *---------------------------------------------------------------------- * ShowISBN: show the title id, ISBN and price *---------------------------------------------------------------------- ShowISBN: Read TitleRec From TITLES,TitleId Then Crt TitleId, TitleRec<BOOK_TITLES.ISBN>, OConv(TitleRec<BOOK_TITLES.PRICE>,"MD2") End Return I find it much more legible, since I spent at least half of my life in client languages. But I understand the point of view of those raised on upper case only who don't use modern (grin) languages, and may initially find it confusing. It's just a question of what you're used to. Incidentally, this has evolved over the years. I started off upper case (no other choice back then), went to lower case in the 'C/UNIX' age, and then camelCase before settling on this style. When I go back to older code I can see that this one works best. But the main thing is to be consistent with your style and use a good editor. Brian _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users