Reply to comment

Are You Working Too Hard as A C++ Developer?

There is probably a multitude of ways that you can work too hard as a C++ developer, but there are two specific ones that I would like to focus on:

  1. Reinventing the Wheel
  2. Using C++ Where It Shouldn't Be Used

Reinventing the Wheel

Most C++ developers I have encountered seem bent on reinventing the wheel instead of building off of the work of others. Building code in house can be very gratifying. You have the thrill of building from scratch and the knowledge of full control. Building from scratch also means taking on huge time and cost risk for debugging and maintaining code, a price that has often been paid already by others. For most any difficult feature or data structure that you need to implement, you should ask yourself three questions:

  1. Does this feature already exist in the standard library?
  2. Part of the fact that nobody understands C++ is that nobody understands the C++ standard library (also referred to as the STL). There are several good references for the library, such as SGI's. My personal favorite is still C++ in a Nutshell.

  3. Is it in Boost?
  4. Yes, Boost is big. Yes, it can be a pain to add it to your application. However, the license is very free (MIT-like), and it contains an amazing amount of resources. We have covered boost several times in the past here.

  5. Has Anyone Else Done It?
  6. A virtual cornucopia of C++ libraries exist out there. Few of them are as well reviewed and designed as Boost. Google Code, Freshmeat and Sourceforge are all great resources for finding open source projects which might already meet your needs. There are many software licenses which may conflict with your personal interests, so do be careful when choosing a code base to use.

Using C++ Where It Shouldn't Be Used

C++ isn't the perfect language for every situation. It is a very versatile language, but sometimes other languages are better suited to the task at hand.

A method that may work well for your project:

  1. C++
  2. All of the back-end library and systems level code and anywhere performance is a concern.

  3. Lua
  4. Runtime configuration and scripting of your application. Also, using Lua as a possible way to extend functionality at runtime.

  5. Perl/Python/C#/Java/Javascript
  6. Scripting language of your choice should be used for the user interface.

SWIG can be used as the glue to pull the pieces together. Dynamic languages and scripting languages provide for faster prototyping and building of user interfaces than C++, on average.

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • You may post PHP code. You should include <?php ?> tags.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <cpp>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Images can be added to this post.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
2 + 3 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.