Want to get advice on how justified the use of libraries in projects?

I participated in just one more or less serious project. The first was a mentor who recommended some libraries for use. Actually, there was an instruction - there were no questions, it was said - done.

Currently I am working on a project alone, there is an application on iOS, I need to implement on Android. Accordingly, iOSnik gives me some tips and so on. So, the point is that his application, although complex, does not use libraries. He wrote everything himself. He advises me to do the same.

When I turn to Google, it turns out that using Volley to work with the network, if the application works from the database, add GreenDao or ORMLite , and when you ask a question about event handling, then in response you hear: "why reinvent the wheel when there is EventBus "!?

I like everything, but maybe it would also be better to take a library (lightweight, by the way), pay for it once and update it sometimes?

Well, or not to bathe and calmly solve problems using libraries?

UPD : In case I can solve the above tasks on my own, the use of libraries is justified. But if I have not had time to master this knowledge? Wouldn't it be better, where you can try to make a bike to gain knowledge, and then consciously take on the libraries?

  • 2
    The main difference between popular open-source libraries and your bikes: the libraries are pretty well tested and debugged, but your bike is not. - Nofate
  • Most android libraries are free. The rest is all said: fast, easy, high quality. You can think of very few reasons (and those will be sucked from the finger for the most part) why you should abandon the library in favor of independent cycling. - pavlofff

3 answers 3

In the modern world, no more or less serious application can do without the use of any libraries. Another question is that it happens that the quality of the library does not suit you (there are no necessary functions, it works incorrectly / inconveniently, etc., it expands poorly). Then you can search for analogues or try to write your own "bicycle". But the “bicycle” will need to be thoroughly tested, maintained as it develops, the transition to a new version of the language, etc. On the other hand, once tied to any library, you will be forced to use it further as the project develops, which sometimes leads to difficult situations. For example, the complexity of customizing some seemingly insignificant details that you did not find at the beginning of the project, and at the end of the project it was urgently needed, and you have to fence a bunch of crutches.

In any case, libraries teach and encourage code reuse, which is an important quality for the programmer and the programs he writes.

Rhetorical retreat: even the trite Java helloworld will use the System.out package, which is not part of the language. What can we say about the collection, work with files, etc. They are part of the standard library of the language, so from a formal point of view, you will not get away from using libraries.

UPD: I think that you should not try to cover everything as you suggest. Suppose that your application must have data encryption, will you write your implementation of RSA? For your camera your jpeg compressor? To store your JDBC data and your database in addition? If there is a quality tool, then why not use it? Using libraries, you reduce the likelihood of errors in your code.

    In commercial development, it is important that the product be released quickly. And bugs can then be finished (yes, you need to release without bugs, but they always crawl through). Therefore, in commercial development, it is better to immediately take ready-tested libraries and make a working prototype.

    And then look, if the library works badly - replace it with another one or fix the library itself. Or if one function is needed from the library, and its weight is tens of megabytes, then it makes sense to rewrite with pens.

    And initially writing everything yourself is expensive. In the modern world everything changes very quickly. A man can not always print faster.

    So, the point is that his application, although complex, does not use libraries. He wrote everything himself. He advises me to do the same.

    Is there a guarantee that he wrote everything himself? maybe he has accumulated code from other libraries? Or if he wrote everything himself, he covered all sorts of "edge effects".

    It seems to me that I like everything, but maybe instead of me, it would also be better to take a library (lightweight, by the way), pay for it once and update it sometimes?

    If finances allow, then why not buy (only desirable with full samples. Without them, I highly recommend it.).

      For Android, everything is exactly the opposite - use libraries as often as possible (if this is, of course, justified). As far as I know, in iOS, libraries are most often distributed without open source code, or, even worse, for a fee. In Java, it's completely the opposite. The vast majority of libraries are open source. They are perfectly optimized, and there are so many of them that you can find a library for almost any task.

      In addition, IMHO, the first rule of (lazy) programmer is to learn how to reuse code (both your own and someone else's)