Template in C++ is the single reason that I still keep using it. Previously, I thought generic programming in C is nothing but ugly and painful. Now I have changed my mind a bit, in the light of tree.h written by Niels Provos. Generic programming in C can be done without much pain and with [...]
Posts Tagged ‘C’
Generic Programming in C
Posted in development, tagged C, programming on September 2, 2008 | 4 Comments »
Comparison of Hash Table Libraries
Posted in development, tagged benchmark, C, cpp, hash, myprog, programming on August 28, 2008 | 27 Comments »
As a Perl programmer, I enjoy a lot using hash tables. I keep this habit in C/C++ programming. Then what C/C++ hash libraries are available? How are they compared to each other? In this post, I will give a brief review of hash libraries and present a small benchmark showing their practical performance.
Hash table libraries
In [...]
C++ Reduces Coding Time?
Posted in thinking, tagged C, cpp, language-war, programming, thinking on August 27, 2008 | 1 Comment »
Just now I got an email from a mailing list, saying that C++ helps to greatly reduce coding time in comparison to C. I have heard a lot about this argument. But is that true?
C++ can possibly accelerate development in two ways: firstly, OOP (Object-Oriented Programming) helps to organize large projects, and secondly, STL (Standard [...]
Improved GNU sort (from textutils-1.22)
Posted in development, tagged C, myprog, programming, software on August 22, 2008 | Leave a Comment »
GNU sort is one of my favorite program. It is fast and highly flexible. However, when I try to sort chromosome names, it becomes a pain. In bioinformatics, chromosomes are usually named as chr1, chr2, …, chr10, chr11, … chr20, …, chrX and chrY. It seems to me that there is no way to sort [...]
Garbage Collection for C
Posted in development, tagged C, memory management, programming on August 20, 2008 | Leave a Comment »
I was ignorant. An hour ago, I thought it is impossible to implement a garbage collector (GC) for C, but this is certainly wrong.
For an interpretated language like Perl, it is cheap to keep track of memory that is not referenced and therefore it is not so hard to identify and free unused memory in [...]
C++ iostream can be Slooow…
Posted in development, tagged C, cpp, programming on August 20, 2008 | Leave a Comment »
A colleague of mine just told me that C++ iostream is typically an order of magnitude slower than printf. His example shows that printing out a string like “%s\t%d\tabc\t%s\t%s\n” with C++ iostream is 3 times slower than printf in Perl! This observation agrees my experience, although I have never done any benchmark. I abandoned iostream [...]
Mastering C Pointers (or not)?
Posted in development, tagged C, memory management, myprog, programming, tutorial on August 20, 2008 | 3 Comments »
C pointer is the most powerful and nasty concept. Whether marstering C points or not separate intermediate C programers from the elementary ones. Want to know whether you have mastered C pointers? Have a look at this program. If the basic idea is clear to you, you are qualified to be an intermediate programmer. If [...]