From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d275ffeffdf83655 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Ada vs C++ vs Java Date: 1999/01/22 Message-ID: #1/1 X-Deja-AN: 435530864 Sender: matt@mheaney.ni.net References: <369C1F31.AE5AF7EF@concentric.net> <369DDDC3.FDE09999@sea.ericsson.se> <369e309a.32671759@news.demon.co.uk> <369F1D39.64A65BC1@sea.ericsson.se> <369f81a9.31040093@news.demon.co.uk> <77ommt$9bo$1@nnrp1.dejanews.com> <77vhjf$nn9$1@nnrp1.dejanews.com> <77vld9$qvg$1@nnrp1.dejanews.com> <782rp0$kn6$1@nnrp1.dejanews.com> <6Oap2.16170$MW1.4028@news2.giganews.com> <783nnb$s9c@drn.newsguy.com> <784qvi$a0a$1@nnrp1.dejanews.com> <78549k$iqv$1@nnrp1.dejanews.com> <785fo3$thj$1@nnrp1.dejanews.com> <36A6F997.CA210C39@easystreet.com> <36A775B3.666042D8@easystreet.com> <788svu$gl9@drn.newsguy.com> NNTP-Posting-Date: Thu, 21 Jan 1999 22:36:30 PDT Newsgroups: comp.lang.ada Date: 1999-01-22T00:00:00+00:00 List-Id: bill_1@nospam.com writes: > In article , Matthew says... > > > >When you're all done with your edits, and all your code is compliant > >with coding standards, then you check it back in. > > > > Not only this is a good idea, but how else will one makes sure their > code is formatted in consistant way other than using a standard formating > pattern with the help of a tool? > > I beleive the best solution is as shown above. > > Eveyone will agree on ONE standard format. > > Then before the code is checked in, one enters few commands to format the > code to this common format. Not quite. The standards-compliant formatting is done on-the-fly, not just before you check the code in. When using emacs, using C-j instead of RET indents the current line to its proper place, and then moves you to the next line, with the cursor properly indented. For more complex formatting, you may have to issue another key sequence to format code. For example: C-c C-w to format the with statements ala ACT: with Pretty; use Pretty; with Girl; use Girl; C-C C-r to format a record declaration, i.e. go from this: type T is record Isnt_This_Where : Integer; We_Just : Float; Came_In_Another : Brick; In_The_Wall : Pink; end record; to this type T is record Isnt_This_Where : Integer; We_Just : Float; Came_In_Another : Brick; In_The_Wall : Pink; end record; It's never necessary to lay this out by hand. You issue the command as soon as you (loosely) type the record declaration in, and then emacs will properly format it. On my list of things to do is teach emacs (ada-mode) how to format a record representation clause. So it's never the case that I type in the code without any formatting, and then let emacs just automatically reformat it to compliance at check-in time. The code gets properly formatted on-the-fly, at the time of writing. And of course, absolutely no tabs are inserted at any time in the file. Tabs do nothing except reek havoc with formatting algorithms, and cause very strange-looking print jobs. Thank goodness, er, I mean, RMS, for untabify. I'm going to be taking over maintenance of ada-mode in another month or so. If you have any suggestions for me, let me know. Matt