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=-0.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1ff5003422436e4,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-04 22:33:41 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!paladin.american.edu!auvm!COMPUSERVE.COM!73672.2025 Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU Newsgroups: comp.lang.ada Message-ID: <941005030023_73672.2025_DHR103-1@CompuServe.COM> Date: Tue, 4 Oct 1994 23:00:23 EDT Sender: Ada programming language From: Ken Garlington <73672.2025@COMPUSERVE.COM> Subject: Easily-Read C++? Comments: To: "comp.lang.ada" Date: 1994-10-04T23:00:23-04:00 List-Id: Robin Rowe writes: << Here's how I read a piece of C++ code: if(!object) // "If not object [then]" { cerr<> Not that I'm a C++ expert, but I have noticed that a lot of C/C++ code looks like Greek to me. Certainly, that stuff on the right reads like English to me (is this normal C style to comment every line?) but the stuff on the left I have to think about a little. On the other hand: If Not(object) then Text_IO.Put_Line (Error_Message (corresponding_to => object)); else object := object + 1; end if; is easily read by _any_ engineer (never mind software engineer) on my project. (Of course, I would have to explain what the "not" of a numeric value is, maybe, but a more meaningful function name is probably a good idea in this case.) In fact, it looks suspiciously like the English explanation of the C code. Note that some of these engineers didn't take the math class where "++" means "add one to the thing before the ++." However, "X = X + 1" is something they got pretty early on. That colon hanging off the equal sign doesn't seem to bother them much. Has anyone tried a study like the following? Take some C++ code from Software Development, or Embedded Systems Programming, or whatever. Write the Ada 9X equivalent. Show the 9X code to C++ programmers who have never seen Ada, and the C++ code to Ada programmers who haven't worked with C recently. Which set of code would be understood more often?