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,65cf1c5c90ed694,start X-Google-Attributes: gid103376,public From: rodemann@mathematik.uni-ulm.de (Joerg Rodemann) Subject: Ada vs. C++ (Readability) Date: 1997/09/09 Message-ID: <341566c7.0@news.uni-ulm.de>#1/1 X-Deja-AN: 271023625 Organization: University of Ulm, SAI, Germany Newsgroups: comp.lang.ada Date: 1997-09-09T00:00:00+00:00 List-Id: Mr. Trey White brought our attention to expression templates in C++ as they are used in blitz++. Well, I had a short glance at it and the performance gains he mentionened are quite impressive to me. Although I do not under- stand this concept completely by now, probably I took the main principles. This really seems to be a powerful method for numerics. However, looking at some examples I was suddenly struck by frustration: There was some code, that obviously could not work!!! At least that's what it looked like. Or how would you interpret the lines: ray x, n; x = 1.00, 0.40, -1.00; n = 0.31, 0.20, 0.93; Surely at first glance whatever type x and n will be, x will be assigned the value 1.00, n will be assigned 0.31. The remaining expression is not relevant at all from the definition of the colon operator!!! This is truly the worst case I ever saw with respect of using side effects and I am very convinced that this will cause a lot of confusion when those members who developped the library have changed the employer. Look how much confusion are already cause by normal C macros because the look like functions with a specific calling convention but are merely text replacements. I think: such extensions may be reasonable if noticeable. But here you wont even recognize the "," comes from blitz++. For me it comes to this: it maybe a good tool if high computing performance is needed for a short-living, small project. If you want reusability and maintainability, use something more explicit (and accept the loss of performance). Maybe I am no god wrt programming skills but the C or C++ syntax already holds enough pitfalls for a programmer new to a existing project to guess "what the fuck is it doing here?" (Sorry for the speech.) Sorry, if this comment is somewhat harsh, but maybe you try to read some code written by someone else using the mentioned library. Certainly you will notice my excitement soon. If now I'll bow deeply at your feet for you must be a real god... ;-> My personal opinion only Yours Joerg -- rodemann@mathematik.uni-ulm.de | Dipl.-Phys. Joerg S. Rodemann Phone: ++49-(0)711-5090670 | Flurstrasse 21, D-70372 Stuttgart, Germany -------------------------------+--------------------------------------------- rodemann@rus.uni-stuttgart.de | University of Stuttgart, Computing Center Phone: ++49-(0)711-685-5815 | Visualization Department, Office: 0.304 Fax: ++49-(0)711-678-7626 | Allmandring 30a, D-70550 Stuttgart, Germany