On Saturday, 13 September 2014 at 20:10:55 UTC, eles wrote:
Are those points valid?:
static if is a total abomination
• Unstructured, can do everything (just like goto)
• Complicates static analysis (AST-based tools get hard to
write)
• Blocks the path for concepts
• Specifies how things are done (implementation)
• Is three slightly different “ifs” using a common syntax
• Redefines the meaning of common notation (such as { ... })
The lack of « something like static if » in C++ and his
opposition to it (which dates back from many years ago) is what
made me search for better languages and discover D.
C++ has only half-assed metaprogramming limited to types, and the
lack of static if has forced me so many times to rewrite very
similar code from one function to another.
With D I can have a « function skeleton » and avoid all
redundancies with static if. Plus mixins expand enormously on the
C preprocessor (although AST macros would be even better).
IMHO it's all good for D, full-featured metaprogramming is a
killer feature and can save a great amount of time and headaches.
The more backwards C++ chooses to remain the faster alternatives
will grow.