How do you generally resolve a programming problem, for example, when you have to parse a ini file?
If it is my task, I will :
First check if there is already a weapon suitable for it in my arsenal. I mean check the libraries I am familiar with, like Glib, APR, or just standard C API.
If I don't find anything suitable, I will check if there exist an open source library to solve this problem. I will see the quality of its API, if it has long history, what people say about it, and test it by myself.
If I found nothing, then I will make my own implementation. But, this situation is very rare.
In this way, I believe I can concentrate more on business, on something that is unique to our organization.
BUT, what I usually see a completely different approach.
- Only believe C/C++ standard libraries.
- Implement anything else unless it's completely impossible.
For example, when I ask my colleague, how he parse ini file, she said, "just character by character". Seems that he never considers that this problem might has been resolved by someone else.
He argues that : We are writing a commercial product, stability is most important. So we should depends on third party libraries as less as possible. And it also took time to learn new API.
Sometimes , I feels that this is only a personal choice depends on one's character. It's OK when people with different approach do his own job. But when they have to cooperate, one has to compromise.
What do you think about it? How do you parse .ini files?