T
Tomás Ó hÉilidhe
More is less. More complexity is less usability. More features make
complexity grow, and it is non linear. If you add <n> features, you
get <n squared> complexity increase.
My point though is that if you want to stick to the "C features", then
you're free to. If you don't like the way templates are implemented in
C++ then don't use them.
I'm more of a procedural programmer; for instance at the moment I'm
working on a network penetration testing program and I'm writing it in
C. I'm happy to say that so far I haven't wanted for any of C++'s new
features.
However about three years ago, as a little hobby project, I wrote a
program to write out a cheque's value in human-readable language. For
instance, if the check was for $7.83, then my program would give
"Seven dollars and eighty three cents". I also had it writing out
German and Irish. There came a point where I realised that some
languages had a lot of things in common. So then I built a class
hierarchy:
Languages
|
/ \
Languages_Like_English Irish
|
/ \
English German
I had code written for "Languages_Like_English", and then I had more
specific code written for "English" and "German". The more specific
code was virtual functions.
And from that I reused a lot of my code. Now of course I could have
done this in C, but the solution in C++ was way more elegant and took
way less time. Plus it was nice not to have to play around with my own
V-Tables and so forth.
But anyway, back to my networking program. Even though I was doing
procedural programming and could use a C compiler, if there came a
point where I thought hmmm it'd be handy to have a template here, it
would have been handy to be using a C++ compiler.