Many times I define a class and soon I will feel the design is bad, making the problem more complex. Sometimes I define a lot interfaces today and change all my minds tomorrow and re-write them all.
That problem won't really go away if you switch to pure C, though, except that you obviously won't be writing any classes. Instead you'll write a set of functions operating on a certain type of data and then change your mind the next day and rewrite them all.
So I want to know how does professional C programmer write their daily codes? For example, when a linked list is used to organize some data, will you directly operate the pointer to next node in the application's algorithm, or will make an abstraction to hide the details of linked list?
There are probably various third-party libraries available that provide somewhat generic data structures such as lists and so on. It's just that in C, "generic" usually means mucking around with void-Pointers and constantly casting to the type of data you're using the structure with.
Really thanks for your replies.
Actually I am doing exact things you descripted: writing function to operate some data, as a class in C++, but with functions. From some books I read that abstraction is important because it decreases the complexity. But I always feel it's hard to do it. Sometimes I think programming without abstraction, just use plain data, may be more efficient, as I can waste less time designing interfaces and abandon thems, and may feel less frustrated.
Maybe I read wrong book. Books I read always tell the concepts, list a lot of its advantages but doesn't teach how to really do it. Even SICP, I read the two chapers and half the third chapter and did the most exercises in these chapters, doesn't help a lot. I feel the programs in these books are always too ideal or just toy programs. But practical programs are more dirty. Do you have some recommended books? Or should I read some sources code of open source projects?
And actually my point is not whether there are some third-party library for C. I'm asking whether professional C programmers write some general data structure once and use them frequently after (or just use some third-party libraries), or just combine these data structures into the applications' algorithm?