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,f92fbb4a0420dd57 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: some questions re. Ada/GNAT from a C++/GCC user Date: 1996/04/02 Message-ID: #1/1 X-Deja-AN: 145421153 references: <4jjul6$637@ra.nrl.navy.mil> <3160ACC6.7FC@mcs.com> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-04-02T00:00:00+00:00 List-Id: Mike says: "It's rare to find even poorly written C++ code "several pages long," let alone nested scopes that size. You can find poor programmers in any discipline, apparently." Odd! Many people say this sort of thing about both C++ and Ada, but in my actual experience, real life large scale C++ and Ada programs do not conform to this dictum. Very long files and procedures are common. Sometimes, this is inevitable. Both Ada and C++ provide no way of separately compiling pieces of a large switch/case statement. So if your application has a case statement with hundreds of branches, then you are going to have a long procedure, even if you write externs and calls for procedures for each branch. Sometimes, it is true that long = bad code, but this is by no means always the case. I have often seen short bad code, and good long code, the correlation is only vague. What makes code easy to read is not shortness per se, but good structure and organization, and logical thinking. I am actually surprised how often we run into the case of very large single procedures, but it happens in both the Ada and C++ code I have seen (you really would not expect much difference between the two languages in this particular respect!)