comp.lang.ada
 help / color / mirror / Atom feed
From: rodemann@mathematik.uni-ulm.de (Joerg Rodemann)
Subject: Ada vs. C++ (Readability)
Date: 1997/09/09
Date: 1997-09-09T00:00:00+00:00	[thread overview]
Message-ID: <341566c7.0@news.uni-ulm.de> (raw)




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





             reply	other threads:[~1997-09-09  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-09  0:00 Joerg Rodemann [this message]
1997-09-09  0:00 ` Ada vs. C++ (Readability) Hyman Rosen
1997-09-10  0:00   ` Simon Wright
1997-09-11  0:00     ` Robert Dewar
1997-09-11  0:00       ` Hyman Rosen
1997-09-12  0:00         ` Joerg Rodemann
1997-09-15  0:00         ` Richard A. O'Keefe
1997-09-10  0:00   ` Joerg Rodemann
1997-09-11  0:00     ` Hyman Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox