Hacker News new | ask | show | jobs
by arcanus 3957 days ago
Eigen is header only and heavily templated, which certainly keeps the source down.

However, SLOC is a poor metric for the quality of a codebase, especially scientific ones. I've certainly found many instances where longer line counts are more performant, for instance with hand-unrolling loops (very rare edge case, not suggesting doing this as a rule!).

Unless you intend to become involved in development of the library, I see no reason you would care about the lines of code. Even at that point, design philosophy, features, etc. are more likely to be major factors in your choice.

FYI: Computational Scientist here. I am neither affiliated with Blaze nor Eigen.

1 comments

I'd say lines of code does matter if the set of functionality is the same, i'd wager that, if you have the same functionality in less lines of code, generally it's easier to verify that it's correct + avoid daft bugs.

.. Unless it's written in a completely uncomprehensible way of course (such as some meta c++ stuff), but in languages with good metaprogramming.

Scientific software should absolutely, always be verified through regression and unit tests. Anything less is non-negotiable.

In a decade of work in hpc and computational science, I have very seldom found looking at the code to be a useful tool for either verification or debugging.

Instead, use the scientific method: hypothesis testing by constructing simple examples with known analytic solutions and using that for clues as to where the real problem lies.

Scientific software should absolutely, always be verified through regression and unit tests. Anything less is non-negotiable.

I like your world. Let's live there. :)