When Should I Use Libraries vs. Coding From Scratch in Frontend Development?

0
0
Asked By CuriousCoder92 On

Hey, I'm new to frontend development and I'm trying to figure out the best approach between writing my own code and using existing libraries. For example, if I want to implement a fade-in effect, should I do it myself using CSS or JS, or would it be better to use a library like AOS? And for creating a slider, is it advisable to code it myself or should I go with something like Swiper.js?

5 Answers

Answered By FrontEndFreak99 On

Honestly, both approaches have their downsides. Relying too much on libraries can lead to a messy codebase with heavy dependencies that might slow down your site. On the flip side, avoiding libraries might waste your time when someone else has already solved the problem in a more efficient way. I usually opt for libraries unless a unique requirement makes a custom solution necessary.

Answered By DevDude88 On

It's completely fine to use libraries, especially for tasks like animations or sliders. They can save you a lot of hassle and usually handle tricky aspects well. For something simple like a fade-in, you might want to code it yourself for practice, but for more complex features, libraries are definitely the way to go.

Answered By WebWizard45 On

Definitely consider using libraries when they meet your needs. Sure, you might feel tempted to code everything yourself to learn, but libraries alleviate the burden of reinventing the wheel, especially for features that require extensive testing across different devices. Just remember to choose wisely since some libraries can bloat your project.

Answered By TechieTina23 On

I think it often comes down to efficiency versus learning. Using libraries can speed up your development process significantly, especially when you're working on something that needs to function correctly. But if you want to learn and really understand the underlying mechanics, coding some things from scratch can be very beneficial.

Answered By CodeCraftsman77 On

If your main goal is to create a functional application, just use the library. If the library doesn’t do exactly what you need, you can always try another one or even roll your own solution if necessary.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.