Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When do you use third-party code? [closed]

Tags:

c

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 :

  1. 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.

  2. 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.

  3. 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.

  1. Only believe C/C++ standard libraries.
  2. 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?

like image 220
ablmf Avatar asked Nov 25 '25 23:11

ablmf


2 Answers

I use third party code when I think the cost of using it is less than the cost of developing the code myself. Note that I'm not talking about just monetary cost, but overall cost in time, effort, money, limitations, etc.

like image 95
Evan Shaw Avatar answered Nov 28 '25 15:11

Evan Shaw


It sounds like your colleague is suffering from Not-Invented-Here Syndrome, which has generally been discredited. (On the other hand, Joel has an interesting piece that takes the other side.)

Developers often don't remember that they work for a business. Keys to business are value, cost, and risk. Certainly learning a complex API is a cost, as is dealing with bugs, but I see reinventing the wheel as a cost too. Either choice has associated risks.

As I see it, except for fairly trivial cases, it is a technical manager's job to decide from a business standpoint whether the cost and risk of finding and using a third-party component outweighs the cost and risk of writing the functionality in-house.

My own take is that I'll go third-party when the functionality has either been widely field-tested or when it's beyond the schedule and budget of my project. Reinventing the wheel is a cost that hurts my company's competitiveness.

like image 25
JeffH Avatar answered Nov 28 '25 17:11

JeffH