Monday, February 02, 2009

C is so powerful but not nice as Java

I am doing Java programming more than 6 years now, and I think I had a chance to most of the J2SE components. And specially from Axis2 I learn a lot about Java. I always found Java is so nice, due to various reason, first it is easy to program, second it has number of tools support. If you have some problem, there is a high probability that someone has already found and written code for that, so that make your job so easier. Another most important factor is debugging support for Java, it is so easy to debug Java programs, including remote debugging. Additionally most of the IDEs written for Java has better support for debugging.

Anyway recently I got a chance to work on some of the cool C stuff, I remember I have done some C program for my undergraduate. There I did not do much work other than implementing some of the data structures and few sorting algorithms. So I believe my knowledge on C so little compared to Java. So the recent work involved a lot of low level C, concurrency, load balancing. I think that is a cool experience someone should have with C.

While doing so I faced some strange problem sometime took days figure out the issues, one of the main reason was my lack of knowledge on C program debugging. I tried to use “gdb” but that did not work for most of the cases. Other problem I faced was getting negative time, basically I got the time before starting my execution and got the time again after execution, and when I deduct end-start I got negative values. I found that a known problem and I even tried some of the workarounds sometimes. Anyway finally I got everything working fine, now I think now I am comfortable of reading any kind of C program at least understand that correctly, and may be modify that.

1 comment:

rajika said...

hm...vim+gcc(make)+gdb combination always works fine for me. Like doing java developments in most of the IDEs I didn't have to wait until load the project, didn't have to wait half an hour to compile the project while doing C programming.
I like C programming!