Hello everyone,
We need libraries because we can reuse code.
Hello everyone,
We need libraries because we can reuse code.
We need libraries simply to make things less time consuming. Being able to reference and locate code that fits the criteria of that which you are trying to accomplish, can make life a lot easier.
We need libraries because as programmers, we should re-use existing code when we can, so that we donāt waste our time writing code that another programmer has already written. It saves time using libraries.
Java Script Libraries are useful because you can use code that has already been written and then shared. These libraries can be called from a server and executed on your program so it makes everything clean. The hardest job is to find the library that you want having to choose from so many options.
A library is a JavaScript file that contains a bunch of functions, and those functions accomplish some useful task on your webpage. The reason we need them is to save time and not having to rewrite code again when someone has done it already. It allows us to focus more time on the important aspects of our program.
Why do we need libraries?
Libraries allow programmers to reuse proven and established code, rather than having to write everything from scratch.
We can save a lot of time using libraries, because libraries contain code that has already been written and proved and we can just use them without coming up with own code.
@ivan Hi, are you able to take code for a library and edit it? For example, if you wanted the slide show to fade from one picture to the next instead of flashing, can you edit the underlying code to accomplish this?
so we don't have to waste time and write code if its already available elsewhere
Greetings @Tesla,
To answer your question, usually Libraries are used as out of the box tools. Most of the libraries provide enough configuration for you to put in so that it meets your exact needs. As developers, it is not a good practise to edit libraries and then use it.
When it comes to your example of slide show fading, Iām sure there must be configuration (CSS based) that allow you to make that.
Hope this clears it out.
Happy Learning!
Thanks @Malik, I see a lot of websites use the same templets and design I assume they are using libraries. Is there a way to create costume websites other than writing the code yourself?
In order not to waste our time in writing a code that another programmer has already written it.
As programmers, we should re-use existing code when we can, so that we donāt waste our time writing code that another programmer has already written.
In JavaScript, the way we do that is by using a library . A library is a JavaScript file that contains a bunch of functions, and those functions accomplish some useful task for your webpage.
How do we know what functions we can use? We could look at the JavaScript file, if itās short, or better, we could look at the documentation . Most libraries have documentation with a list of available functions or a real-world example.