Should you use a library when you can do the task without it?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I am in a situation where I can use an open source JavaScript plugin to fulfill a task. But when I tried to use it,I found myself I have to redesign lot of things of what I already have done,and it adds a certain complexity, in my humble opinion, to the project. Whereas I can achieve the same task with a clean code I can craft myself, and without needing to change what I have done so far.



Should you opt for a library anyway in this situation (like for the sake of better quality code?)










share|improve this question























  • How are you measuring "quality". By the number of lines of code? Classes? Complexity? Maintainability? Resilience?
    – Laiv
    32 mins ago










  • Sorry if the title is not clear, but in my humble opinion the first paragraph of my question is enough specific to the situation I am talking about
    – Billal Begueradj
    26 mins ago










  • The answer is NO, no matter what you consider quality or not. But if you provide us with your idea of quality, answers will address their reasoning to explain why the number of libraries don't improve what you consider quality. It's a mere matter of precession. As it's now, a simple NO will answer the question with no need of explanation.
    – Laiv
    21 mins ago














up vote
1
down vote

favorite












I am in a situation where I can use an open source JavaScript plugin to fulfill a task. But when I tried to use it,I found myself I have to redesign lot of things of what I already have done,and it adds a certain complexity, in my humble opinion, to the project. Whereas I can achieve the same task with a clean code I can craft myself, and without needing to change what I have done so far.



Should you opt for a library anyway in this situation (like for the sake of better quality code?)










share|improve this question























  • How are you measuring "quality". By the number of lines of code? Classes? Complexity? Maintainability? Resilience?
    – Laiv
    32 mins ago










  • Sorry if the title is not clear, but in my humble opinion the first paragraph of my question is enough specific to the situation I am talking about
    – Billal Begueradj
    26 mins ago










  • The answer is NO, no matter what you consider quality or not. But if you provide us with your idea of quality, answers will address their reasoning to explain why the number of libraries don't improve what you consider quality. It's a mere matter of precession. As it's now, a simple NO will answer the question with no need of explanation.
    – Laiv
    21 mins ago












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am in a situation where I can use an open source JavaScript plugin to fulfill a task. But when I tried to use it,I found myself I have to redesign lot of things of what I already have done,and it adds a certain complexity, in my humble opinion, to the project. Whereas I can achieve the same task with a clean code I can craft myself, and without needing to change what I have done so far.



Should you opt for a library anyway in this situation (like for the sake of better quality code?)










share|improve this question















I am in a situation where I can use an open source JavaScript plugin to fulfill a task. But when I tried to use it,I found myself I have to redesign lot of things of what I already have done,and it adds a certain complexity, in my humble opinion, to the project. Whereas I can achieve the same task with a clean code I can craft myself, and without needing to change what I have done so far.



Should you opt for a library anyway in this situation (like for the sake of better quality code?)







code-quality libraries






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 min ago

























asked 2 hours ago









Billal Begueradj

4863726




4863726











  • How are you measuring "quality". By the number of lines of code? Classes? Complexity? Maintainability? Resilience?
    – Laiv
    32 mins ago










  • Sorry if the title is not clear, but in my humble opinion the first paragraph of my question is enough specific to the situation I am talking about
    – Billal Begueradj
    26 mins ago










  • The answer is NO, no matter what you consider quality or not. But if you provide us with your idea of quality, answers will address their reasoning to explain why the number of libraries don't improve what you consider quality. It's a mere matter of precession. As it's now, a simple NO will answer the question with no need of explanation.
    – Laiv
    21 mins ago
















  • How are you measuring "quality". By the number of lines of code? Classes? Complexity? Maintainability? Resilience?
    – Laiv
    32 mins ago










  • Sorry if the title is not clear, but in my humble opinion the first paragraph of my question is enough specific to the situation I am talking about
    – Billal Begueradj
    26 mins ago










  • The answer is NO, no matter what you consider quality or not. But if you provide us with your idea of quality, answers will address their reasoning to explain why the number of libraries don't improve what you consider quality. It's a mere matter of precession. As it's now, a simple NO will answer the question with no need of explanation.
    – Laiv
    21 mins ago















How are you measuring "quality". By the number of lines of code? Classes? Complexity? Maintainability? Resilience?
– Laiv
32 mins ago




How are you measuring "quality". By the number of lines of code? Classes? Complexity? Maintainability? Resilience?
– Laiv
32 mins ago












Sorry if the title is not clear, but in my humble opinion the first paragraph of my question is enough specific to the situation I am talking about
– Billal Begueradj
26 mins ago




Sorry if the title is not clear, but in my humble opinion the first paragraph of my question is enough specific to the situation I am talking about
– Billal Begueradj
26 mins ago












The answer is NO, no matter what you consider quality or not. But if you provide us with your idea of quality, answers will address their reasoning to explain why the number of libraries don't improve what you consider quality. It's a mere matter of precession. As it's now, a simple NO will answer the question with no need of explanation.
– Laiv
21 mins ago




The answer is NO, no matter what you consider quality or not. But if you provide us with your idea of quality, answers will address their reasoning to explain why the number of libraries don't improve what you consider quality. It's a mere matter of precession. As it's now, a simple NO will answer the question with no need of explanation.
– Laiv
21 mins ago










2 Answers
2






active

oldest

votes

















up vote
4
down vote













You can probably answer that one for yourself: No, of course the mere fact of using libraries doesn't improve your code. If it did, it would be easy to write great code for everything with no effort.



What people mean when they recommend reuse over roll-your-own is that code in a well-known library is probably more correct, efficient and/or usable than what you would yourself come up with, simply because the authors have spent much more time on one particular area of functionality than you (with your deadline for the entire project) can afford.



But that's only a trend, not a law. Certainly there can be libraries that aren't as useful to use as roll-your-own would be. Often this happens when the library actually does much more than what you need, and does it in a way that would force you to adapt your own code base to their conventions much more than is reasonable. It looks as if this is exactly what you've found in this instance.






share|improve this answer



























    up vote
    0
    down vote













    Bill Gates once famously said:




    "Measuring programming progress by lines of code is like measuring
    aircraft building progress by weight."




    This quote comes to mind because the same could ultimately be said for the number of libraries. As a rule, I don't use libraries unless:



    1. There's no other way of getting it done. Doing without would no longer be economically viable to produce the product on time and on budget.

    2. It would save me a significant chunk of time as I would require many of the features of said library

    3. Library is well-used and any potential problems I might have would be well-documented.

    Ideally all three conditions are met, but I'd settle for any two. Bottom line is you shouldn't be adding a library to your program unless it serves a purpose. If you have to ask what that purpose is, you probably shouldn't be adding it to your program. The code quality of your program therefore benefits because it elegantly calls upon each library without being weighed down by the need to necessarily rewrite libraries inside your program.



    Good luck!






    share|improve this answer


















    • 1




      Meaningful quote and I like fully agree with your answer.
      – Billal Begueradj
      30 mins ago










    • There's no other way of getting it done quite contradictory, isn't? If there's a library that does it, then there's "a way" to do it. It would save me a significant chunk of time this is the only reason.
      – Laiv
      29 mins ago











    • @Laiv I would invite you to try to write a program in Java without the jdk then. To clarify, I don't mean "impossible". I mean impractical.
      – Neil
      28 mins ago











    • Edited for clarity.
      – Neil
      22 mins ago










    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "131"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsoftwareengineering.stackexchange.com%2fquestions%2f380021%2fshould-you-use-a-library-when-you-can-do-the-task-without-it%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote













    You can probably answer that one for yourself: No, of course the mere fact of using libraries doesn't improve your code. If it did, it would be easy to write great code for everything with no effort.



    What people mean when they recommend reuse over roll-your-own is that code in a well-known library is probably more correct, efficient and/or usable than what you would yourself come up with, simply because the authors have spent much more time on one particular area of functionality than you (with your deadline for the entire project) can afford.



    But that's only a trend, not a law. Certainly there can be libraries that aren't as useful to use as roll-your-own would be. Often this happens when the library actually does much more than what you need, and does it in a way that would force you to adapt your own code base to their conventions much more than is reasonable. It looks as if this is exactly what you've found in this instance.






    share|improve this answer
























      up vote
      4
      down vote













      You can probably answer that one for yourself: No, of course the mere fact of using libraries doesn't improve your code. If it did, it would be easy to write great code for everything with no effort.



      What people mean when they recommend reuse over roll-your-own is that code in a well-known library is probably more correct, efficient and/or usable than what you would yourself come up with, simply because the authors have spent much more time on one particular area of functionality than you (with your deadline for the entire project) can afford.



      But that's only a trend, not a law. Certainly there can be libraries that aren't as useful to use as roll-your-own would be. Often this happens when the library actually does much more than what you need, and does it in a way that would force you to adapt your own code base to their conventions much more than is reasonable. It looks as if this is exactly what you've found in this instance.






      share|improve this answer






















        up vote
        4
        down vote










        up vote
        4
        down vote









        You can probably answer that one for yourself: No, of course the mere fact of using libraries doesn't improve your code. If it did, it would be easy to write great code for everything with no effort.



        What people mean when they recommend reuse over roll-your-own is that code in a well-known library is probably more correct, efficient and/or usable than what you would yourself come up with, simply because the authors have spent much more time on one particular area of functionality than you (with your deadline for the entire project) can afford.



        But that's only a trend, not a law. Certainly there can be libraries that aren't as useful to use as roll-your-own would be. Often this happens when the library actually does much more than what you need, and does it in a way that would force you to adapt your own code base to their conventions much more than is reasonable. It looks as if this is exactly what you've found in this instance.






        share|improve this answer












        You can probably answer that one for yourself: No, of course the mere fact of using libraries doesn't improve your code. If it did, it would be easy to write great code for everything with no effort.



        What people mean when they recommend reuse over roll-your-own is that code in a well-known library is probably more correct, efficient and/or usable than what you would yourself come up with, simply because the authors have spent much more time on one particular area of functionality than you (with your deadline for the entire project) can afford.



        But that's only a trend, not a law. Certainly there can be libraries that aren't as useful to use as roll-your-own would be. Often this happens when the library actually does much more than what you need, and does it in a way that would force you to adapt your own code base to their conventions much more than is reasonable. It looks as if this is exactly what you've found in this instance.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 41 mins ago









        Kilian Foth

        85.8k32231259




        85.8k32231259






















            up vote
            0
            down vote













            Bill Gates once famously said:




            "Measuring programming progress by lines of code is like measuring
            aircraft building progress by weight."




            This quote comes to mind because the same could ultimately be said for the number of libraries. As a rule, I don't use libraries unless:



            1. There's no other way of getting it done. Doing without would no longer be economically viable to produce the product on time and on budget.

            2. It would save me a significant chunk of time as I would require many of the features of said library

            3. Library is well-used and any potential problems I might have would be well-documented.

            Ideally all three conditions are met, but I'd settle for any two. Bottom line is you shouldn't be adding a library to your program unless it serves a purpose. If you have to ask what that purpose is, you probably shouldn't be adding it to your program. The code quality of your program therefore benefits because it elegantly calls upon each library without being weighed down by the need to necessarily rewrite libraries inside your program.



            Good luck!






            share|improve this answer


















            • 1




              Meaningful quote and I like fully agree with your answer.
              – Billal Begueradj
              30 mins ago










            • There's no other way of getting it done quite contradictory, isn't? If there's a library that does it, then there's "a way" to do it. It would save me a significant chunk of time this is the only reason.
              – Laiv
              29 mins ago











            • @Laiv I would invite you to try to write a program in Java without the jdk then. To clarify, I don't mean "impossible". I mean impractical.
              – Neil
              28 mins ago











            • Edited for clarity.
              – Neil
              22 mins ago














            up vote
            0
            down vote













            Bill Gates once famously said:




            "Measuring programming progress by lines of code is like measuring
            aircraft building progress by weight."




            This quote comes to mind because the same could ultimately be said for the number of libraries. As a rule, I don't use libraries unless:



            1. There's no other way of getting it done. Doing without would no longer be economically viable to produce the product on time and on budget.

            2. It would save me a significant chunk of time as I would require many of the features of said library

            3. Library is well-used and any potential problems I might have would be well-documented.

            Ideally all three conditions are met, but I'd settle for any two. Bottom line is you shouldn't be adding a library to your program unless it serves a purpose. If you have to ask what that purpose is, you probably shouldn't be adding it to your program. The code quality of your program therefore benefits because it elegantly calls upon each library without being weighed down by the need to necessarily rewrite libraries inside your program.



            Good luck!






            share|improve this answer


















            • 1




              Meaningful quote and I like fully agree with your answer.
              – Billal Begueradj
              30 mins ago










            • There's no other way of getting it done quite contradictory, isn't? If there's a library that does it, then there's "a way" to do it. It would save me a significant chunk of time this is the only reason.
              – Laiv
              29 mins ago











            • @Laiv I would invite you to try to write a program in Java without the jdk then. To clarify, I don't mean "impossible". I mean impractical.
              – Neil
              28 mins ago











            • Edited for clarity.
              – Neil
              22 mins ago












            up vote
            0
            down vote










            up vote
            0
            down vote









            Bill Gates once famously said:




            "Measuring programming progress by lines of code is like measuring
            aircraft building progress by weight."




            This quote comes to mind because the same could ultimately be said for the number of libraries. As a rule, I don't use libraries unless:



            1. There's no other way of getting it done. Doing without would no longer be economically viable to produce the product on time and on budget.

            2. It would save me a significant chunk of time as I would require many of the features of said library

            3. Library is well-used and any potential problems I might have would be well-documented.

            Ideally all three conditions are met, but I'd settle for any two. Bottom line is you shouldn't be adding a library to your program unless it serves a purpose. If you have to ask what that purpose is, you probably shouldn't be adding it to your program. The code quality of your program therefore benefits because it elegantly calls upon each library without being weighed down by the need to necessarily rewrite libraries inside your program.



            Good luck!






            share|improve this answer














            Bill Gates once famously said:




            "Measuring programming progress by lines of code is like measuring
            aircraft building progress by weight."




            This quote comes to mind because the same could ultimately be said for the number of libraries. As a rule, I don't use libraries unless:



            1. There's no other way of getting it done. Doing without would no longer be economically viable to produce the product on time and on budget.

            2. It would save me a significant chunk of time as I would require many of the features of said library

            3. Library is well-used and any potential problems I might have would be well-documented.

            Ideally all three conditions are met, but I'd settle for any two. Bottom line is you shouldn't be adding a library to your program unless it serves a purpose. If you have to ask what that purpose is, you probably shouldn't be adding it to your program. The code quality of your program therefore benefits because it elegantly calls upon each library without being weighed down by the need to necessarily rewrite libraries inside your program.



            Good luck!







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 22 mins ago

























            answered 32 mins ago









            Neil

            18.1k3161




            18.1k3161







            • 1




              Meaningful quote and I like fully agree with your answer.
              – Billal Begueradj
              30 mins ago










            • There's no other way of getting it done quite contradictory, isn't? If there's a library that does it, then there's "a way" to do it. It would save me a significant chunk of time this is the only reason.
              – Laiv
              29 mins ago











            • @Laiv I would invite you to try to write a program in Java without the jdk then. To clarify, I don't mean "impossible". I mean impractical.
              – Neil
              28 mins ago











            • Edited for clarity.
              – Neil
              22 mins ago












            • 1




              Meaningful quote and I like fully agree with your answer.
              – Billal Begueradj
              30 mins ago










            • There's no other way of getting it done quite contradictory, isn't? If there's a library that does it, then there's "a way" to do it. It would save me a significant chunk of time this is the only reason.
              – Laiv
              29 mins ago











            • @Laiv I would invite you to try to write a program in Java without the jdk then. To clarify, I don't mean "impossible". I mean impractical.
              – Neil
              28 mins ago











            • Edited for clarity.
              – Neil
              22 mins ago







            1




            1




            Meaningful quote and I like fully agree with your answer.
            – Billal Begueradj
            30 mins ago




            Meaningful quote and I like fully agree with your answer.
            – Billal Begueradj
            30 mins ago












            There's no other way of getting it done quite contradictory, isn't? If there's a library that does it, then there's "a way" to do it. It would save me a significant chunk of time this is the only reason.
            – Laiv
            29 mins ago





            There's no other way of getting it done quite contradictory, isn't? If there's a library that does it, then there's "a way" to do it. It would save me a significant chunk of time this is the only reason.
            – Laiv
            29 mins ago













            @Laiv I would invite you to try to write a program in Java without the jdk then. To clarify, I don't mean "impossible". I mean impractical.
            – Neil
            28 mins ago





            @Laiv I would invite you to try to write a program in Java without the jdk then. To clarify, I don't mean "impossible". I mean impractical.
            – Neil
            28 mins ago













            Edited for clarity.
            – Neil
            22 mins ago




            Edited for clarity.
            – Neil
            22 mins ago

















             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsoftwareengineering.stackexchange.com%2fquestions%2f380021%2fshould-you-use-a-library-when-you-can-do-the-task-without-it%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What does second last employer means? [closed]

            List of Gilmore Girls characters

            Confectionery