News for hackers. Stuff that matters.
Re:C++11 FAQ by hacker_9 on Thursday January 26, 2017 @10:44AM (#13492243)
I agree. The other day I had to dive into the libigl [1] matrix structure (for those that don't know, a matrix is basically a 4x4 grid of numbers). What I found was over 10 levels of inheritance, along with rampant template use and macros _everywhere_. It actually took so long to parse I ended up just changing my algorithm completely to avoid having to use it. I have utmost respect for anyone that can work with C++ day to day, but I'll be staying away thanks.

[1] https://github.com/libigl/libigl/

Re:C++11 FAQ by rkangel on Thursday January 26, 2017 @10:58AM (#13492387)
The problem is that you can find bad code in any language. It's difficult to tell how much that is the fault of the language, and how much is the fault of that particular author.

I'm not defending C++ here, I actually agree with you, but it's difficult to provide decent evidence for its failings.

Re:C++11 FAQ by dimatura on Thursday January 26, 2017 @05:55PM (#13496142)
Doesn't libigl use Eigen for matrices? Eigen is a full-featured matrix library with a pretty decent API. If you just need a 4x4 grid of numbers, then you don't really need a library, sure. But once you need to do matrix arithmetic, basic linear algebra, various forms of indexing, mixing matrices of different types (e.g. float/double/int/etc), things get complicated, fast. A complex library like igl needs all this and more. I'm guessing this is why there's so many matrix libraries - everyone prefers rolling their own, after all, how hard can it be? (I'm guilty of this, so I'd know. But I reach for Eigen most of the time these days).
Re:C++11 FAQ by cbsmith on Thursday January 26, 2017 @01:23PM (#13493812)
Odd. I wonder why they didn't just use Boost uBLAS or similar.
Re:C++11 FAQ by claudius on Thursday January 26, 2017 @03:41PM (#13495073)
Last time I checked, Boost uBLAS was horribly slow and one should not use it. Use Eigen or Blitz++ (or just call BLAS directly) instead.
Re:C++11 FAQ by cbsmith on Friday January 27, 2017 @02:29AM (#13498316)
That's what I meant... Though Boost uBLAS is still way faster than a deeply inherited 4x4 matrix...