[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
7.3 Why C++?
Why did we choose to implement GiNaC in C++ instead of Java or any other
language? C++ is not perfect: type checking is not strict (casting is
possible), separation between interface and implementation is not
complete, object oriented design is not enforced. The main reason is
the often scolded feature of operator overloading in C++. While it may
be true that operating on classes with a +
operator is rarely
meaningful, it is perfectly suited for algebraic expressions. Writing
3x+5y as 3*x+5*y
instead of
x.times(3).plus(y.times(5))
looks much more natural.
Furthermore, the main developers are more familiar with C++ than with
any other programming language.