News for hackers. Stuff that matters.
Re:Invented here syndrome (2015) by imagist on Monday October 10, 2016 @10:39AM (#12677294)
The longer I work, the more NIH I get. There are two reasons for this:

1. The ease of creating a library these days is resulting in a proliferation of utterly crap libraries, so bringing on a new library is more and more of a liability, both to future reusability of code and to security.

2. As I get better at programming, I more and more often realize that I can write a better version of the library, or just one that better fits my needs.

These combine to create a situation where I'm less and less likely to want to import something.

Re:Invented here syndrome (2015) by MaulingMonkey on Monday October 10, 2016 @12:29PM (#12678087)
I'm the opposite.

1. The proliferation of libraries enables devs to get very, very picky about their libraries - the slightest wart or lack of understanding will cause them to label a library "utterly crap". But anything they create to replace it will run afoul of another programmer's picky tastes even worse! (And to what degree they may have a point, exactly 0 devs will be previously familiar with the warts and misfeatures of this new code.)

2. As I get better at project management, I realize that myself and my fellow devs are constantly underestimating the ongoing maintenance burdens of new code. It's hard enough getting us to make sufficiently pessimistic time estimates for the initial implementation that PMs don't have to smile and multiply by large integers - nevermind accounting for the next few years of adding additional debug logic, logging, fixing edge cases, supporting legacy decisions, adding a full set of fuzzing and regression tests, etc.

I wonder if we're regressing toward the same mean, or away from it...

Re:Invented here syndrome (2015) by imagist on Monday October 10, 2016 @01:40PM (#12678609)
> 1. The proliferation of libraries enables devs to get very, very picky about their libraries - the slightest wart or lack of understanding will cause them to label a library "utterly crap". But anything they create to replace it will run afoul of another programmer's picky tastes even worse! (And to what degree they may have a point, exactly 0 devs will be previously familiar with the warts and misfeatures of this new code.)

Ah yes, the "it's all subjective" argument. The thing is, it's not subjective. Sure, it may be hard to objectively measure the qualities of a library, but that doesn't mean we should give up and assume there's no underlying objective truth.

My "picky tastes" are for libraries that are battle-tested, performant, and scalable. If that runs afoul of someone else's tastes, frankly, I don't care.

> 2. As I get better at project management, I realize that myself and my fellow devs are constantly underestimating the ongoing maintenance burdens of new code. It's hard enough getting us to make sufficiently pessimistic time estimates for the initial implementation that PMs don't have to smile and multiply by large integers - nevermind accounting for the next few years of adding additional debug logic, logging, fixing edge cases, supporting legacy decisions, adding a full set of fuzzing and regression tests, etc.

I definitely agree that the ongoing maintenance burden of new code is consistently underestimated, but it doesn't follow from that that we should prefer third-party libraries to our own code. A new third party library is still new code, and it's not often a reliable assumption that someone else will maintain that code forever. Further, general-purpose third party libraries aren't tailored to our needs, so they often contain more code than we would write. The result? We often end up with a larger maintenance burden by using a library. And finally, even if someone else maintains your library, that doesn't mean they will maintain the integration point between your code and theirs. Keeping up with changes in a library that doesn't value reverse compatibility highly can be just as costly as maintaining a library yourself.

Re:Invented here syndrome (2015) by MaulingMonkey on Monday October 10, 2016 @06:12PM (#12680154)
> Ah yes, the "it's all subjective" argument. The thing is, it's not subjective.

Some things are, some things aren't - and even some of the subjective objections can be reasonable. If your entire dev team is a bunch of crusty C programmers with no exception handling experience, introducing a new library that throws exceptions has drawbacks, no matter how reasonably they might be used. They're simply not in the right mindset for it. If it's just 1 member of your dev team, however, perhaps it's time for them to learn to deal with exception handling if the library is otherwise good.

Then I see devs getting very passionate about vanilla XML vs JSON, CamelCase vs snake_case, and making kneejerk reactions to well documented edge cases that their replacement implementations would also have (minus the documentation.)

Your tastes are a bit better, but even there I can think of scenarios where all three aren't vital to me - easily fungible dev-only debug tools come to mind.

> Sure, it may be hard to objectively measure the qualities of a library, but that doesn't mean we should give up and assume there's no underlying objective truth.

Agreed. But I find that the best way to measure is to have at least one person try - or have previous experience with - using the library.

Obscenely convoluted dependency chains that can't be simply checked into VCS? Consistently unstable? Insecure by design and defaults? Constant public interface churn? I agree that there are reasons to kill a library with fire - sometimes before you decide to integrate it in the first place, sometimes after the fact when you've realized it was a mistake.

> The result? We often end up with a larger maintenance burden by using a library.

I see this rather rarely, which does make me think we've spent time on opposite ends of the NIH spectrum. It does happen though, and those are libraries that I will still avoid.

Re:Invented here syndrome (2015) by crpatino on Monday October 10, 2016 @01:57PM (#12678718)
> ... but it doesn't follow from that that we should prefer third-party libraries to our own code.

Agreed. The big tragedy of Open Source is that after its initial wave of success it good flooded with freeloaders. If you allow me to repeat myself: The one flaw of the GPL is that it did not offer provisions to prohibit distribution in binary form. "You want free? Better you know how to unpack the tarball and build the project from scratch... all by yourself (No build scripts beyond Makefile permitted, thank you very much)".

Of course, such overzealous GPL would need to also make provisions to accept dual licensing with nice, commercial, royalty seeking licences. That way, everybody gets what they value the most: You want freedom, you pay with sweat; you just want access, you pay in cash.

Re:Invented here syndrome (2015) by imagist on Monday October 10, 2016 @04:50PM (#12679696)
That would pretty much defeat the entire goal of free software. Setting up a technical barrier to usage is counter to free software goals.
Re:Invented here syndrome (2015) by crpatino on Thursday October 13, 2016 @01:05PM (#12702266)
And what are those goals? Provide free labor to corporate interests? Give away free products to cheap people that cannot care to recognize for one second the personal effort invested by the producers?

Creators are going to create, they cannot help it. I do not say that you cannot provide altruistic value to others, but my opinion is that you should care about your own people first. And the big mistake of programmers as a profession is that we do not see other fellow programmers as our own people.

Re:Invented here syndrome (2015) by crpatino on Monday October 10, 2016 @01:47PM (#12678646)
I upvoted your comment and the GP's, as you both make good points.

It does not have to be one or the other, though. The obvious solution to have the best of both camps is to find an open source library with a (mostly) sane architecture and either support it actively or fork it (depending on the bullshit-to-effective ratio in the code and user base).

If you end up forking it, you may end up outcompeting the original if you band together with like minded devs/users from the previous incarnation... instead of keeping it behind your org's firewall.

Re:Invented here syndrome (2015) by awinder on Monday October 10, 2016 @11:30AM (#12677615)
#2 I feel like is the trap. As beings with limited amounts of time on this planet, the test should not be about absolutes, but if what we would build is better given the time we would have to devote.

And this isn't that strange of a phenomena when you think about it. Construction workers choose hammers rather than forging them on their own, we buy food from supermarkets instead of growing it on our own, etc. One of the principle elements of humanity is our ability to stand on their shoulders of giants, which shouldn't be lost

Re:Invented here syndrome (2015) by imagist on Monday October 10, 2016 @12:05PM (#12677894)
> #2 I feel like is the trap. As beings with limited amounts of time on this planet, the test should not be about absolutes, but if what we would build is better given the time we would have to devote.

I don't think it's really about the time you have to devote. Integrating a library can take longer than writing the code yourself, and that doesn't change with respect to the time you have.

> And this isn't that strange of a phenomena when you think about it. Construction workers choose hammers rather than forging them on their own, we buy food from supermarkets instead of growing it on our own, etc. One of the principle elements of humanity is our ability to stand on their shoulders of giants, which shouldn't be lost

This fact isn't lost on me. My point is that there are actually relatively few giants who have solved an average arbitrarily-chosen problem, and even fewer who have shared their work. If you have 10+ years of programming experience, it shouldn't be hard to find an area where you are the giant.

Re:Invented here syndrome (2015) by phaedrus on Monday October 10, 2016 @12:54PM (#12678278)
This is not just a defense of NIH but also a good rule of thumb for how to do NIH "right". The more narrowly you define the problem the more likely that the DIY approach will be better in both time and quality.
Re:Invented here syndrome (2015) by phaedrus on Monday October 10, 2016 @12:56PM (#12678298)
There's a high end pizza place in my city. They buy their flour, but they grow their own arugula. They didn't build their own building from scratch, but they did build their own brick ovens from scratch.
Re:Invented here syndrome (2015) by jandrese on Monday October 10, 2016 @01:49PM (#12678661)
This is something I've come to appreciate over the years as well. The more libraries a project has the harder is it to maintain, despite the libraries supposedly being used to ease maintenance.

This goes triple if the libraries in question are commercial closed source things. One company decides to stop supporting that product or the company goes under or gets bought out and suddenly your project is anchored to something that may or may not stay working as the OS changes underneath it.

Every library provides a benefit especially on the front end with reducing development time, but also brings liabilities. So you need to strike a balance between getting enough utility out of it and not loading your project down with so many liabilities that it will be impossible to maintain or port.

The maintenance overhead of keeping your own code working is usually far less than the maintenance overhead of chasing API changes in the libraries or discovering new bugs that crop up in minor version updates. Even if you go and pull the libraries directly into your project (so you're fixed on specific versions), you still have problems with having a far more complicated build process that fails far more often thanks to problems with the library builds. Or worse, you have version conflicts with installed libraries.

In sort: Keep your list of dependencies as short as possible, but no shorter.

Re:Invented here syndrome (2015) by mortoray on Monday October 10, 2016 @10:50AM (#12677365)
#1 has a big influence on my argument. I think it was Python and NodeJS library systems that made it super simple for people to publish libraries. There are a lot of trivial libraries out there, and many of questionable quality. Sometimes using a library ends up as more work than writing the bits of code myself.

It's not like I'm going to decide to write a new 20k line library for my project, but if something is only a few hundred lines of code it's definitely easier to just rewrite.

Re:Invented here syndrome (2015) by phaedrus on Monday October 10, 2016 @12:39PM (#12678174)
I find myself trending the same way, but for another reason. I've gone back and forth on my viewpoint over my programming career, and now whenever I decide to revisit an old project, I find the "more NIH" I wrote it the more likely it is that I can load it up in a current version of the compiler / IDE and hit "Build and Run" and it will Just Work. Even if I included the external library in the repository, the library still contains extra code I don't need which may fail to build.
Re:Invented here syndrome (2015) by onion2k on Monday October 10, 2016 @11:28AM (#12677602)
"As I get better at programming, I more and more often realize that I can write a better version of the library, or just one that better fits my needs."

That's a good sign. As you get better and more experienced as developer you start to realise the benefit of thinking things through before launching in to writing code or reaching for an existing library. Some times you want to do the first, and other times you want to do the second. There isn't a straightforward "one size fits all" rule to say which approach is best.