March 30th, 2011, 4:35 am
QuoteOriginally posted by: katastrofaQuoteOriginally posted by: CuchulainnThe STL book by Josuttis (and template programming) are essential foundations for C++ imo. This is the trend in C++ 0X and Boost. It leads to robust and fast code.Templates lead to fast code but slow builds&debugging.What you lose on the swings you gain on the roundabouts It should not be a reason for not using templates.Another advantage is you get compile-time errors and not run-time errors as with OOP approach. And this means less try catch blocks, for example.Example array<double, 20> a1;array<double, 10> a2;This won't compile;a1 = a2;// And template debugging is an art form, aka try, try, try.If you design templates logically and program in a step-by-step manner you won't have many problems. One error can cause an avalanche of errors, so in these cases _root cause_ analysis and resolution will save you much time.
Last edited by
Cuchulainn on March 29th, 2011, 10:00 pm, edited 1 time in total.