Krishna, You can find an extensive discussion on the design choices made here <https://arxiv.org/pdf/1910.13247.pdf>. I think section 2.4 answers your question. The short answer is that using template makes the code run faster because the compiler can do a better job at optimizing everything and it allows us greater flexibility in the choice of data structure.
Best, Bruno On Friday, December 20, 2019 at 8:12:56 AM UTC-5, Krishnakumar Gopalakrishnan wrote: > > With the highest deference to the amazing quality of software development > that deal.ii developers follow, I wish to ask a question about the > particular development paradigm chosen (with no disrespect to any of the > developers intended). This question is just out of personal curiosity. > > deal.ii makes heavy use of templates for spatial-dimension independent > programming. However, as already acknowledged in the FAQ, compiling > template-heavy code takes a long time. > > Since the number cases are only 3 (possible spatial dimensions), it > strikes me that the variadic arguments feature (facilitated by the > cstdarg.h header file) might be a slightly bit more natural choice for > this use case? Apologies if I am wrong about this, since I am a novice C++ > user. > > Can the developers/users of deal.ii provide an objective reasoning of why > they went the template-route instead of variadic arguments? > > Regards, > Krishna > -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/15f96801-09e4-438b-b159-e7baf8b5a587%40googlegroups.com.