4 ms·
Author here. I personally don't have any strong feelings against C++ (it's just a language/platform I don't prefer), but my target audience is delighted that th
by dragandj 6y ago
Author here. I personally don't have any strong feelings against C++ (it's just a language/platform I don't prefer), but my target audience is delighted that they don't have to mess with C++. It's one of the main selling points of the book!
- CamperBob2 6y agoInteresting. Why not just use C? I can understand why C++ isn't appropriate for this. Object-oriented programming has little to do with linear algebra, and a nightmarishly-complex language that's desperately trying to reinvent itself also isn't appropriate for pedagogy. But you still need a lingua franca, a language you can use to express the relevant principles without trying to evangelize one arcane functional language or another at the same time like so many authors try to do these days. Being a relatively straightforward procedural language, C works well for this purpose. Everybody doing numerical computing is at least familiar with the fundamentals of C programming, or should be. Is there some institutional resistance to plain old C, or is it just a matter of widespread personal prejudice among both students and teachers?
- dragandj 6y agoYou can easily see the answer to this question when you try to write (and copmpile, and package, and use as a library in another software) in C any of the examples written in higher-level dynamic languages (Clojure, in my case, or Python, Julia, etc. if you prefer that). Compare the number of LOC or any other metric. Once you have high-level access to underlying algorithms (implemented in whatever native technology, but hidden), it is much, much, simpler to work at high-level.
- CamperBob2 6y agoSo, are you teaching people to optimize their LoC count, or are you teaching people linear algebra? I don't see how you can effectively do both.
- dragandj 6y agoI'm not sure why you don't see it, but elegant code and math go hand in hand.
- divs1210 6y agoWhy do you think NumPy, SciPy, etc are so popular? Why don't people use C/C++/Fortran instead? It's because LoC and readability and maintainability matters. Teaching Linear Algebra using NumPy isn't equivalent to teaching people linear algebra + teaching people to optimize LoC. Flawed argument.
- Koshkin 6y agoGenericity. It is the C++ templates that make the language an invaluable tool for implementing, efficiently, numeric algorithms in general and calculations with matrices in particular. (That, and operator overloading for aesthetics: you’d want to be able to write A + B for their sum.)