Article View: comp.std.c
Article #3909Re: "Canadian style" of indentation
From: mfinney
Date: Sun, 03 Sep 1995 20:33
Date: Sun, 03 Sep 1995 20:33
52 lines
2867 bytes
2867 bytes
In <810138845snz@soliton.demon.co.uk>, Ian Cargill <ian@soliton.demon.co.uk> writes: >And, of course, you will have to mandate the width of tabs >and/or forbid the use of tabs. Yes. Tabs are simply unacceptable even without the use of indentation for control structure. The company for which I current work has had all sorts of trouble maintaining readable code due to tabs being different in different editors -- our shop policy is now that you cannot use an editor in which disabling tabs is unavailable. That does NOT mean that you cannot use the tab KEY, and set that for any width you want -- it just can't insert tabs. > Otherwise, what happens when >you edited with tabs set to 8 and the compiler expects 4? Its worse than that! Languages such as COBOL -- of which we have a few programs :-( -- requires specific columns and tabs messes that up very nicely. And readability in asm files typlically does not use a fixed tab width. As far as I see it, the only acceptable policy regarding tab characters is DON'T! You can use fixed or variable tabbing all you want, just don't put it into the source file! >I would much rather rely on layout-independant braces to define >my block scope. Your choice. But I would rather reduce typing (and since I type at 85 wpm, it is NOT because I am a lazy typist <g>), reduce code clutter so I can read the code more easily, and reduce program bugs. I am used to following coding standards, a minor addition over identation rules is NOTHING compared to the benefits. >What happens when someone fouls up with global search and replace >or strange editors which changes the spacing/indentation? I have >had both done to me and it would have been a nightmare having to >go laboriously through code re-creating the block structure. You DO archive your source code don't you? Including significant temporary versions? I have also made massive global editing mistakes which messed up a program -- but I have never lost more than 5 minutes of work in the last 2 decades years due to such a mistake. The answer to problems like this is simply professionalism in the deveopment of code. Professionals use archives to protect against mistakes of this nature (and much more, of course), amateurs and the inexperienced don't. Michael Lee Finney
Technical Details
Message-ID:
<42d3e7$aks@mujibur.inmind.com>Path:
arc1-ca.pugleaf.net!mujibur.inmind.com!usenetReferences:
<41g464$6vv@ruby.ucc.nau.edu> <41gvsi$hfv@mujibur.inmind.com> <DE616L.6xq@ns1.nodak.edu> <4255vr$12@mujibur.inmind.com> <810138845snz@soliton.demon.co.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!mujibur.inmind.com!usenet From: mfinney@inmind.com Newsgroups: comp.std.c Subject: Re: "Canadian style" of indentation Date: 3 Sep 1995 20:33:11 GMT Organization: In Mind, Inc. Message-ID: <42d3e7$aks@mujibur.inmind.com> References: <41g464$6vv@ruby.ucc.nau.edu> <41gvsi$hfv@mujibur.inmind.com> <DE616L.6xq@ns1.nodak.edu> <4255vr$12@mujibur.inmind.com> <810138845snz@soliton.demon.co.uk> Reply-To: mfinney@inmind.com NNTP-Posting-Host: finneyman.inmind.com X-Newsreader: IBM NewsReader/2 v1.2