3 ms·
Dependencies are part of the same calculations that normal programming follows. Easy to program vs Easy to maintain vs Easy to understand vs Easy to scale vs E
by MrStonedOne 6y ago
Dependencies are part of the same calculations that normal programming follows.
Easy to program vs Easy to maintain vs Easy to understand vs Easy to scale vs Easy for the cpu to do.
Dependencies are easy to program, you include them.
Dependencies are hard to maintain, in that you can't expand or change their behavior.
Dependencies can be either hard or easy to understand (compared to your own code).
Dependencies are hard to scale, something you coded yourself can avoid validating inputs that have already been validated, or otherwise be smarter about how it does things to avoid overhead.
(one example would be a system for parsing info from a large amount of data, most dependencies will make you either store it all in one place on disk or memory, where a custom solution can more easily stream it to avoid memory or disk overhead. (take a ftp server that wants to calculate and store 5 hashes for each of the files uploaded, it can either have 5 libraries each read the file after upload, or it can load the entire file back into memory after upload or it could just stream the info to 5 custom rolled hashing systems that handle calculating the data as its being uploaded and written without needing to re-read it from disk after upload. one will be faster and scale better.))
So half the articles about dependencies on hacker news can be broken down to one message:
Don't use a dependency when rolling it yourself is better for your use case.
The other half are about conveying why and when rolling it yourself can give you benefits for your use case.