Sunday, October 30, 2005

C++ Coding

This is not a comprehensive list - just the things that come to mind right now.

Thing I like:
  • Classes. Having difficulty going back to C to do embedded work. My solution: try to convince everyone at day job to compile C code with a C++ compiler :-)
  • Very like C (which has it's own positives and negatives...) but I know it well and I can use old code I have.
  • Can drop into procedural style if necessary for certain problems (like some other languages, e.g. Python). Some people think this is a bad thing ... I think they are slightly mad ... more limitations is not good.
  • Can write everything from faceless computationally heavy stuff to gui stuff (although no standard makes it interesting)
  • Has a fairly good set of standard libraries as part of the language.
  • Love the container classes. Maybe not quite as easy to use as Python's lists. But fast and saves you having to write your own containers (as you did with C) which are never good enough and tend to end up as a compromise.
  • Easier to avoid buffer overrun problems.
  • Speed - never a problem. Obviously you have to have a good "algorithm" (or rather, not a bad one) but this has not been a problem for me. This is a definite advantage over Java, Python, etc. ...
Things I don't like:
  • I'm sure doing classes in C++ takes more lines of code (compared with classes in other languages), which I think might be slower to write? (Not entirely convinced by the suggestion that a line of code in any language takes the same time to write, however).
  • Sometimes the large amount of control over C++ classes is a burden (because things aren't controlled by the compiler and therefore, although they are more flexible, there are a lot of extras you need(?) to learn.
  • The book "The C++ Programming Language" is a blessing and curse. Comprehensive and impenetrable. However, I haven't been able to replace it with a work that is as comprehensive. Definitely need the latest edition (3rd or special). Arrggghh..... Got lots of post-it notes in my copy at home - to find things quickly. Everything is in there, usually buried.


Post a Comment

<< Home

Newer›  ‹Older