vodinhphong

For a more comformtable C/C++

In Programming on June 25, 2009 at 2:36 pm

C/C++ coding is often a nightmare with me because of its allocation/deallocation mechanism is delegated to programmer. But it is exact the way I like.  Flexibility is a two-blade knife, it can help you much and it can kill  you at once! Since I was a IT student, I rarely used C/C++ to write programs, and used Java instead. At that time, I adored Java and hated C/C++ because of Visual Studio. I had not known that there are so much cool IDEs that I can use free.

By now, I am on the way to become a PhD student and I like C/C++. However, using C/C++ in a right way is the problem.

The first thing I think, it is what kind of OS I should use? Linux!

The second thing is which IDE do I use? Eclipse. With Eclipse, I can manipulate makefile with supports from Eclipse, or write and maintain by myself. This point is quite important because when you deploy an application/your code on another computer/system, the most portable way is to use Makefile.

The next thing is how to use C/C++ in the most comformtable way? Use good external libraries to reduce time to develop or fix bugs.

The most important library is STL (sure!)

If you want to write programs with rich command line options (and you should write that), use the Boost library with Program_options package. Writing a GUI application is a tedious task and I personally think it is the bad way. Within several minutes, you can add numerous of functionalities into your program without doubt about where to place these buttons, these textboxes, etc. If your OS is Windows, please install Boost from this site. Do not waste time to install from Boost homepage, it is just good for Linux users and tutorials.

In fact, the more you depend on external libraries, the more problems you get when deploying on other computers. So, be thoughtful before decide to use them. On the next post, I might introduce about Blitz++.

  1. What is this C/C++ language you are talking about? I’m familiar with C and C++. But I don’t know any programming language named “C/C++”. :-p

    Cheers!

    Good question!:D I means C or C++ :D