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: 1014db,d95b511473b3a931 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,d95b511473b3a931 X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,d95b511473b3a931 X-Google-Attributes: gid109fba,public From: john@assen.demon.co.uk (John McCabe) Subject: Re: Language Choice and Coding style Date: 1996/07/04 Message-ID: <836505506.6472.0@assen.demon.co.uk>#1/1 X-Deja-AN: 163710723 x-nntp-posting-host: assen.demon.co.uk references: <4quk22$78@krusty.irvine.com> <4r059t$2at0@info4.rus.uni-stuttgart.de> <4r3bp1$cea@Starbase.NeoSoft.COM> newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++ Date: 1996-07-04T00:00:00+00:00 List-Id: dewar@cs.nyu.edu (Robert Dewar) wrote: <..snip..> >I strongly disagree. In theory this sounds OK, but style covers much more >than simple rules that can be messed around with by a formatting editor. >If a team is not willing to agree on unimportant little things, but insists >on going their own individual way, I think you have little hope of >achieving a high degree of coding style consistency, something I think >is vital for the success of software projects with more than one person >involved. This all really depends on how you define "coding style" and where you consider code formatting to be a particularly important part of that. Personally I consider "coding style" to mean how things are done rather than the way they look. If I can give an example of one style compared to another (from C as it is a very obvious and common one): a = ((x < 0) ? y : z); and if (x < 0) { a = y; } else { a = z; } are two ways of doing the same thing, but using what I consider to be different coding styles. The point is, there can be many different and equally valid ways of producing e.g. an algorithm code. No one can say they know the best way of doing it, so why should they enforce a style that they are comfortable with? Not only could that lead to inefficient code, but allowing coders more freedom to do things the way they want to is also likely to be a learning experience for the others in the team. Code formatting on the other hand is a very mechanical thing and can be easily modified by machines into a format that a coder feels most comfortable with. I find that as long as code looks the same (in terms of formatting), then someone else's style of coding becomes much easier for me to understand. I would therefore consider a comfortable format of code to be far more important for maintenance purposes than enforcing a particular style, and if machines (by way of formatting editors) can help in this then it should be actively encouraged. Best Regards John McCabe