• NewDawnOwl
    link
    fedilink
    arrow-up
    4
    ·
    5 hours ago

    It’s kinda ironic how one of the takes from that can be “this is why programmers should continue reinventing the wheel”

    It’s a bit more nuanced.

    1. Software Engineering is about tradeoffs, since it’s a form of engineering
    2. There is more than one topic to address here from a best practices standpoint
    3. There is more than one way to use package managers, and it’s up to you to implement a correct solution for the use case.
    Software Engineering is about tradeoffs, since it’s a form of engineering

    You and your team need to choose where the tradeoff between re-implementing functionalities and re-writing existing things that you have control need to be made. Do you really need to use Left-Pad, or can you write a function and leave it in a JS library for your software to call? Do you have the time to dedicate to reviewing the dependencies and how they function? Is that available for your target language? Is it worth it to use a different language if you don’t get the source code of your libraries?

    There are several other factors to consider these are just some examples.

    There is more than one topic to address here from a best practices standpoint

    In this instance, it’s largely two ideas from the Pragmatic Programmer :

    • DRY : Don’t repeat yourself/don’t reinvent the wheel (NB : the original idea is to refactor code so you’re not copy pasting edge cases all over the place, but similar ideas fit into this perspective)
    • Cargo cult programming : Know what your software is doing.

    Yes, you should not repeat yourself. But also, you should know what it is the dependencies you have are doing and not just blindly trust them. Someone, at some point, should be responsable for vetting the security and reliability of the packages you are choosing to make use of in your software. There is a bedrock level where you need to trust that at least the language or compiler or equivalent is going to work correctly, but the most recent package that you are using that is on version 0.0.1 that is going to make the backbone of your business might need some vetting. Perhaps choose to re-implement that one so you are using something more dependable that isn’t going to be at risk due to external factors.

    There is more than one way to use package managers, and it’s up to you to implement a correct solution for the use case.

    Certain package managers allow you to host your own package store on a network. You can use this functionality to secure a certain version, and ensure that your systems will depend on a vetted, secure version of that library. This way, if a package gets compromised or changed to not include your necessities, you can still continue to function without being affected.

    If you, the reader, found this useful, I am currently looking for work.