currently in my place of work I'm headbutting with some coworkers from other teams (but same repo), since they are in a line of thinking where they prefer this:
const connectionList = Object.values(connections).flat();
const connection = connectionList.find(
conn => conn.in === Number(connectionId),
);
Rather than just using a helper library like lodash (that's already integrated into our codebase):
const connection = find(connections, { id: Number(connectionId) })
some of their arguments are:
- JS is forever. Flavors and libraries come and go. The closer your project stays to the native spec the less tech debt you are bringing yourself multiple years out. So while it may seem easier in the present moment you have to always consider what happens if this third party library goes away 3 years from now and we are stuck maintaining it in our codebases for the next 10-20 years? Is the value prop high enough to take on that potential risk?
- We source our engineers based on their JS abilities so it is very reasonable for us to assume anyone walking in the door can read vanilla JS their first day, so we are reducing onboarding time. Any 3rd party libraries we green light (including common ones like React, Lodash, Styled Components, etc) we take on a higher employee acquisition cost to get developers who have not worked with those specific libraries up and running, so there needs to be some deep consideration about limiting which ones we are willing to take that hit in order to depend on them.
- We have a head count of 300 and growing, and everyone has opinions on which helper libraries are best. Wrangling the external libraries each person likes using becomes a bottle neck on enterprise level code. So as we are on our journey to get there it is good practice to start reducing those dependancies now, vs having to go back and clean them from a code base 10x the size we have now.
In my eyes the less code the less likely to have bugs and also since the code is simpler is easier to read is easier for a dev to process it, so I am wondering if I am in the wrong in here or what would you consider the best?