Slashdot Mirror


Invented-Here Syndrome

edA-qa writes: Are you afraid to write code? Does the thought linger in your brain that somewhere out there somebody has already done this? Do you find yourself trapped in an analysis cycle where nothing is getting done? Is your product mutating to accommodate third party components? If yes, then perhaps you are suffering from invented-here syndrome.

Most of use are aware of not-invented-here syndrome, but the opposite problem is perhaps equally troublesome. We can get stuck in the mindset that there must be a product, library, or code sample, that already does what we want. Instead of just writing the code we need a lot of effort is spent testing out modules and trying to accommodate our own code. At some point we need to just say, 'stop!', and write the code ourselves.

28 of 158 comments (clear)

  1. About time... by jythie · · Score: 5, Insightful

    I do not see this topic brought up nearly as much, which worries me. I have worked on quite a few projects where the unwillingness to write functionality internally lead to excessive testing of external options and overuse of generic frameworks which not only increased the dependency/complexity of the project but often required just as many lines of code to use as just writing our own damn module would have.

    It feels like this is worst in the Java (enterprise) community, but that could be my imagination. Sometimes I think those programmers need their 3rd party instantiation taken away from them....

    And crap, looks like I have been moved over to slashdot-beta so I will probably never see if I get responses....

    1. Re:About time... by jythie · · Score: 5, Interesting

      One example that really drove me crazy was a developer who was tasked with putting in a 'retry' mechanic. Rather than simply working with the socket he pulled in some spring library that altered the socket behavior according to an external XML file and was praised by the lead for doing it this way. The code (java + XML) was several times longer than it would have been otherwise, plus a new library had to be included in the build/distribution, but it was still 'proper'. I think that was the breaking point for me working on that project.

    2. Re:About time... by itzly · · Score: 5, Interesting

      What do you do when some complex, external code has a bug ?

    3. Re:About time... by SirGeek · · Score: 2

      I've seen this. Most coders just glue third party stuff together with a bit of business logic. Nobody ever writes anything from bare metal, no complex algorithms, nothing. It just takes too long to test your own stuff. The Java world is so rich in libraries that you can always track down something that does what you need.

      And as a certifiable.. I mean certified tester, I'm the person who should be testing shit (and lets face it - Too much of the code out there IS shit)

      Let the coders code, Find a person who understands HOW to test and let them test.

      Also. If you're going to code using a language like JAVA, Write a freaking JUnit test and pass in Min, Max, Max and a mid range value to your methods/objects. Make 100% certain that it handles the data and errors that inevitably WILL happen. Then you have a quick way to REGRESSION TEST when you do a new release...

    4. Re:About time... by Austerity+Empowers · · Score: 4, Insightful

      It's the penny-wise pound-foolish issue when engineers and developers are forced to be mindful of schedules and business objectives. We in essence become as brain damanged as our managers, and start behaving irrationally.

      It's well known we have absolutely no capacity to estimate schedule accurately, but we do have the "gut feel". If your gut says that it will take a day to implement functionality, assume it's a week and just do it, it's trivial. If it says 2 weeks, it's actually 2 months plus three squirrel years and a llama month divided by e^-jwt, maybe spend a day or two evaluating options. If it feels like 6 months, try very hard to find something OTS, because this may become the project you're working on when you retire (which in todays parlance means: you die in your swivel chair of old age).

      You could of course be entirely wrong. Last week in fact I decided modifying a script to do what I need would take at least a month, had an epiphany in the shower and had it done in 6 hours. Guts have failed even Homer Simpson. But unless someone comes along who has been-there-done-that with a better option, and who demonstrates he' serious by NOT trying to railroad you in a meeting, but in fact just walks by the cube and says "hey, use this", you're usually better off trying it out yourself. At worst you waste some time but learn the problem, and how to best evaluate other solutions that come up.

    5. Re: About time... by jythie · · Score: 2

      Sadly, it did not take a day. I really felt that the solution was not only more complicated but took longer to implement and test than the internal coding option would have. Granted the two approaches were not tried in parallel, but the amount of time and effort that was eaten up by taking the dependency injection route seemed quite excessive given the complexity of the problem being solved.

    6. Re:About time... by Kjella · · Score: 2

      Nothing is better than your own code. But given the choice between my predecessor's hairy ball of custom code and a hairy ball of clue between documented frameworks, I'm not so sure anymore. Because the other side to being generic is "will probably continue to function in a sane fashion if I tweak it a little" while one-off code tends to make a lot of assumptions that may have been true when it was written but falls apart in surprising ways when you try to change it. Unless your predecessor actually made clean, documented code but I know with myself that if you're in a hurry that won't happen. I had to walk a colleague through some systems we use once a year to update various coding schemes and such and to be honest it's an ugly mess. But we do it once a year and we're busy fixing the stuff we use often, so....

      --
      Live today, because you never know what tomorrow brings
    7. Re:About time... by blue9steel · · Score: 3, Insightful

      File a bug report.

    8. Re:About time... by itzly · · Score: 3, Insightful

      And then it gets fixed right away ?

    9. Re:About time... by Greyfox · · Score: 4, Insightful
      Or is just complex and unfamiliar. The problem with these frameworks is they work great when they work, but you only ever see them working because they've been published with the most trivial example. When you actually start trying to do things with them, you have to know implementation-level details of the framework in order to make it work for you. By the time you've invested all that time, you may as well have written something less generic that actually does what you want.

      Oh and when I say they work great, I was kind of lying. I have a favorite example. A while back a developer I was working with wrote some Spring/Hibernate code to pull records in from the database and print a billing report. Soon as he handed it off to me, I thought "What happens if I throw 100000 records at this?" Well what happened is that it crashed. So I cut the number in half and it still crashed. Down around 30000 records, it started taking about half an hour and THEN crashing.

      Turns out he was using the framework to pull all the records from a couple of different tables and doing the join in Java. The SQL join I wrote to test the code took a couple of minutes to run on a million records and returned the correct output. On a hundred thousand it was neighborhood of 10 seconds.

      Now the Spring/Hibernate people will be quick to point out that you can edit some XML file or something and make the framework do a join for you, thus solving that problem. And that is true, if you know a fair bit about the framework. And you'd have to know a fair bit about all the other frameworks they used on that project, too. By the time you got done learning all the frameworks they were using to the level of detail where you could actually be that effective with them, you could have written the application they'd built 10 times over.

      Fortunately this story has a happy ending. The team ended up deciding to run the original developer's code against the billing database several times a day so that it would never have so many records to process that it would crash, thus solving the problem once and for all!

      --

      I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

    10. Re:About time... by Bengie · · Score: 2

      Turns out he was using the framework to pull all the records from a couple of different tables and doing the join in Java

      Who gave him direct table access?! They should be fired!

    11. Re:About time... by Anonymous Coward · · Score: 2, Interesting

      What if the thing you write that substitutes for the missing external dependency has ten thousand times as many bugs?

      People always underestimate the investment in software development. I'm sure most people think someone pulls up a chair, types some code, puts it on a floppy disk and KAPOW it's on the market in every device. Nope. We have testing teams, build specialists, cross-platform planning, packaging requirements, release processes, A/B testing, refactoring, branching, madness.

      Any time you write a piece of code there are leagues of people involved who will have to deal with your code, whether you know who they are or not (and most of them you won't know). The problem with code is that we believe we can handle it and there'll be no problem. The code will just work first time for everyone, everywhere, on every platform. We think we're rockstars and our guitars are out of tune just a little.

      Having access to the code can be as dangerous as *not* having access to the code for a naive or time-pressured programmer. We might know not to put business logic in the GUI, but the 19yr old new hire doesn't necessarily know that yet. Tomorrow you're hiring a 14yr old and the day after that it's going to be some 8yr old girl-wonder from India who aced the Microsoft certification. The software industry skews young and the first thing that gets cut is rigorous testing process and quality control. As an older programmer I now spend the majority of my time cleaning up the broken crap left behind by the last pack of fly-by-night rockstars.

      Get off my lawn.

    12. Re:About time... by Lodragandraoidh · · Score: 3, Interesting

      I've told this story elsewhere, but it applies directly to this issue, so I'll recap in short:

      Vender is contracted to create an integrated support application for large sums of money ($millions) over a 6 month period; contractor chooses an obscure commercial java framework to build the system on. The application is delivered and appears to work fine for several months, then starts getting sluggish, then a month later the application locks up - and has to be restarted. This progressively gets worse, and is asymptotic with the growth of the underlying customer base - and soon becomes completely useless - shutting down within minutes of being started with a memory exhaustion error.

      The main problem we found was the equivalent of a memory leak in Java. The code would instantiate objects based upon the framework in the main loop, and they would never go out of scope. Furthermore the code imported hundreds of libraries that were never used - further impacting clarity and understanding of what the thing was doing.

      To make a long story short, since this was already in production and now there was even more pressure to get a solution in place fast (and all the lawyers threats in the world can't replace a knowledgeable developer) - we rebuilt the whole system using perl in a little over 1 week. That solution is still running today - even as we've scaled orders of magnitude since then.

      So - to your point - this stuff really does happen, and wastes godawful amounts of time and money, when a more simpler home grown solution would do just as well, if not better.

      --

      Lodragan Draoidh
      The more you explain it, the more I don't understand it. - Mark Twain
    13. Re:About time... by Jane+Q.+Public · · Score: 2

      Yep, you see this all the time in the iOS development community too. People coding my sticking together 100 slightly incompatible 3rd party libraries, and writing a bunch of glue code. Then hitting problems and responding to help solving them with "we can't do that, we're required to do it this way because the 3rd party library does it that way".

      Exactly. I don't mind including a good tool that does its job well and leaves everything else alone. But I've run across at least 2 very sad "syndromes" that add-ons sometimes cause:

      The first syndrome is represented by libraries that take over everything and unnecessarily restrict your otherwise legitimate actions, because they ASSUME everything will be done with or through them. 2 great examples come to mind from the Ruby world: Formtastic, and Devise.

      I dumped Formtastic because it insisted on generating its own <ul> for the form, and <li> tags for all the elements, which prevented you from laying out your forms your own way. Trying to wrap elements in named or classed <div>s so you could do your own layout resulted in invalid HTML. Maybe Formtastic has improved since then, I don't know. I discussed this problem with the author, and his response was "Why would you want to do that?" Which just illustrates my point.

      Devise is way too intrusive and makes too many assumptions. Besides being based around unproven Bcrypt (which has never been fully security audited), it tries to force you to do everything else its way, too. It may be "customizable", but in my experience that's far more trouble than it's worth. My opinion is that most people who use Devise do so because they don't understand how to do it themselves.

      The second syndrome is "copy and paste development". This irritates me to no end. "Why don't we just use X? It already does that." "Well, because it's like shooting an ant with a cannon. A cannon that also wants to wash your dishes."

      The right tool for the right job. Often, especially for small jobs, it's vastly preferable to roll your own tools, and do it your way.

    14. Re: About time... by Darinbob · · Score: 2

      I think there's a form of superstition out there to never write any code that's not glue code. Some of this is from a phobia about reinventing the wheel, so that people will waste time in order to avoid wasting time. But some also comes from thinking that third party code will be correct and so increase overall reliability (no matter how much flimsy duck tape is required to attach it).

      I see managers with this thinking, it's as if they are assuming their own staff are a bunch of morons so it's safer to rely on a third party. The worst is when the boss spends a lot of money on a third party library that you could have written yourself, and which you end up spending most of your time fixing it yourself instead.

    15. Re:About time... by Altrag · · Score: 2

      for large sums of money ($millions) over a 6 month period

      ...

      rebuilt the whole system using perl in a little over 1 week

      And I thought I was bad at estimates..

  2. Quality of the solution. by digsbo · · Score: 4, Insightful

    It comes down to the quality of the solution, versus the added headaches of managing dependencies. It's not a religious issue, but one of experience and engineering. It's also a good idea to make sure that if you're inventing something that someone else might eventually provide, you at least loosely couple it, so it can be swapped out later.

    With those thoughts in mind, don't get stuck in analysis paralysis. Use judgment and move on.

    1. Re:Quality of the solution. by BitZtream · · Score: 3, Interesting

      Do you want to keep up with the world around you?

      I was having a discussion with a programmer who is 50 (I'm 38) the other day about the time when you used to be able to write an OS entirely by yourself, and how we both miss that time. It wasn't trivial, but the OS was that small, it could be done. Remember, Linux is just a kernel, not 'an OS', and Linux hasn't been the work of one make for 20 years at this point (Not trying to discount what Linus has done, but he has help :).

      Today, if you want to be able to produce useful software with sufficient features for most purposes, you can't write it all yourself. Well you can, but you'll be the last person to bring your 'whatever' to market/public view and they'll be 20 others that have more features and more shiny than you because they relied on some other libraries. A single person isn't making Windows 3.1 or newer in any realisticly useful time frame. Windows 95 is well beyond the scope of one person.

      Even a good modern text editor isn't going to be written from scratch, you've just not got the time to write all the basic editor features and things like a regexp engine. Yes, you CAN, but not while staying relevant.

      Sure, there are places where you can get by without dependancies or MUST have no dependencies. Embedded work and Cryptography are two things I have experience with where re-implementing the wheel isn't uncommon due to various constraints placed on you. Note: Not reinventing, reimplement

      With that said ... I'm writing an OS by myself. It will never do anything impressive and no one will ever use it, but it will exist and has already taught me why I hate the x86 processor line in about 18,000 different ways :)

      --
      Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
    2. Re:Quality of the solution. by frank_adrian314159 · · Score: 2

      It will never do anything impressive and no one will ever use it, but it will exist and has already taught me why I hate the x86 processor line in about 18,000 different ways :)

      it worries me somewhat that you hadn't figured out that last bit before you started the project, but I wish you luck anyway.

      --
      That is all.
    3. Re:Quality of the solution. by ADRA · · Score: 2

      An OS? God, you're such a young lazy punk. Get the hell off my lawn!

      --
      Bye!
  3. Lockdown by tepples · · Score: 2

    At some point we need to just say, 'stop!', and write the code ourselves.

    I wonder how much of "invented here" syndrome is related with frustration with curation on the popular curated platforms (iOS, Windows Phone, Windows RT, and game consoles). Cryptographic lockdown applied by the operating system publisher blocks end users from writing their own applications or writing a mod for an existing application. Because people are unwilling to go through the organizational overhead of becoming a licensed developer, they stick with the vanilla version of whatever they can get from the platform's official app store.

  4. Not-Good-Enough Syndrome by Jason+Levine · · Score: 4, Insightful

    I'd say part of the cause of "invented-here syndrome" can be "not-good-enough syndrome." I'm often comparing my programming skills to people I see online - people whose skills far outpace my own. So when it comes time to access my programming skills, I'll understate how good I am because I'm simply not as good as those "coding superstars." Of course, when you see the online results of code people have written, you don't see the idiotic mistakes they made, the typos they've had to correct, the hours they spent Googling for an answer to a pesky problem. You just see some elegant, amazing looking code. It can be a daily struggle to balance admiring the programming skills of others without trying to compare myself to them (and thus knocking my own skills).

    --
    My sci-fi novel, Ghost Thief, is now available from Amazon.com.
    1. Re:Not-Good-Enough Syndrome by Kjella · · Score: 4, Insightful

      Sounds like you've never seen what passes for production code in the bowels of a major corporation. Look at the questions on experts-exchange or stackoverflow. You can safely assume most of them are for paid work. After that, you shouldn't have self esteem issues anymore.

      --
      Live today, because you never know what tomorrow brings
  5. Solution - Developers need to know code they call by ErichTheRed · · Score: 2

    I've seen the end result of this a lot working in systems integration and engineering. The problem is that, yes, most functionality has been written in some library or available through a public API, web service, whatever. Especially with mobile stuff, Apple/Google/Microsoft give the developer huge amounts of pre-built functionality, and encourage its use.

    The overall problems with it are, in my mind,
    - Developers and systems people not knowing how that huge chunk of functionality they use actually does what it does
    - Introducing dependencies on third party applications which may or may not be around later, have spotty support, etc.
    - Making applications more complex to deploy and debug -- "is this my bug or the API's bug? Why is a single row database update taking 45 seconds and 100% of a CPU core?"

    The reverse problem on the other hand has the potential to be worse. No one should be coding core functionality that has the potential to fail spectacularly or have major security problems. Examples might be writing your own PKI stack instead of relying on the OS/webserver to do it, designing your own file transfer protocols unless you have a _really_ good reason, and many more. So with NIH syndrome, you have to really trust that your developers did everything right. With IH syndrome, you need to install an application, plus the 45 modules it depends on, plus provide it access to public APIs, etc.

    I think the "solution", even though there's no right answer for all situations, is to make sure app developers are actually understanding development. It's too easy to write applications by gluing together pieces. With the framework movement, the pieces are much bigger and hide way more from the developer than, say, a library function.

    From my side, in systems, we have way too many admins who are scared of scripting. Windows installations are moving towards PowerShell now, and while very useful, PS hides almost everything from the end user. Scripts that used to be 100 lines of loading/parsing/checking code are reduced to a single call to a chain of cmdlets. Very powerful, but the language itself isn't the most intuitive out there and borrows syntax from many languages. This leads to admins finding something on StackOverflow and copying/using it unmodified and unverified, simply because they don't know what it actually does.

  6. Re:Blame the Simpsons by Immerman · · Score: 2, Insightful

    If only we had access to their code base!

    --
    --- Most topics have many sides worth arguing, allow me to take one opposite you.
  7. The Level of Abstraction by Art3x · · Score: 5, Interesting

    You will always have to write some code of your own. Even if you use a CodeIgniter, AngularJS, and every prewritten function on StackExchange, still, you will have to write some code to configure the frameworks and to pull it all together.

    You will always use some of someone else's code, too. Aren't you using Linux or something? You didn't write your own OS, did you? You're using a database, like MySQL or PostgreSQL or something, right? You didn't write your own database system, did you? And are you using a web server like Apache or Nginx?

    So the question is not, should I write my own code or use someone else's. The question is where to draw the line.

    I'm a web programmer, your typical LAMP developer (well, LAPP --- I use PostgreSQL). Like many PHP programmers, I first concentrated too much on the PHP. PHP is not the best language, as many have said, but I don't think it's quite as bad as people make it out to be. Anyway, I never took up any of the PHP frameworks. They seemed like too much trouble to adapt. (I should point out that I started with an intranet with a dozen or so applications already built.) I would research PHP frameworks from time to time, but always rejected them all, and felt a little self-doubt in doing so: "Do I suffer from Not-Invented-Here Syndrome?"

    But PHP, and scripting languages in general, provide the right level of abstraction, I think. It takes care of memory management. It provides a bunch of functions for HTTP. It has its own templating syntax. It's great if you don't overuse it. In other words, in the MVC pattern, PHP does great for the View and, together with Apache, the Controller. But if you write a lot of your Model in PHP, with all this data processing, checking, calculations, etc. --- well, that's what the database is for, I think.

    So, instead of eventually adopting a PHP framework, I learned more and more about Apache and PostgreSQL, and I learned that a lot of the things that I was doing in PHP could be done in SQL or in the Apache configuration, with a lot less typing (a lot more reading but a lot less typing). While most people are busy trying figure out how to write the practically all of the MVC in PHP, I realized that Apache was part of the Controller, PostgreSQL was part of the Model, and the browser was part of the View. I use PHP just to help them out, only when needed.

  8. Re:AKA... "don't reinvent the wheel" by g01d4 · · Score: 2

    Re:AKA... "don't reinvent the wheel"

    ...unless you have to redesign your car to make it fit.

    I think the point of the article was that that's sometimes the case.

  9. Sociological problem: CYA by aussersterne · · Score: 5, Insightful

    Part of the problem is the CYA issue.

    If you're writing the code, you sound like a laborer ("I have to..."). If it breaks, it's your fault and you're on the hook publicly.

    If you present a third-party component in a meeting, you sound like a manager ("I propose that we..."). Once three or four other people in the meeting have concurred, if something breaks it's the third party's fault. A ticket or two are initiated, it's someone else's problem and everybody gets to cast blame somewhere beyond the walls of the company.

    Rational behavior, regrettably.

    --
    STOP . AMERICA . NOW