• I Cast Fist@programming.dev
    link
    fedilink
    arrow-up
    22
    arrow-down
    1
    ·
    21 hours ago

    Software hasn’t been working too well lately, has it?

    It hasn’t for a number of decades, if we’re being honest. The difference is that the stakes nowadays are much, much, much higher than, say, in 1999

    About ten years ago, two small revolutions happened in our industry, whilst the rest of the world paid little attention. They were cloud computing, and open source libraries. (…) tools like NPM hit the scene in 2014, it really felt like a gamechanger. You could just add a line to your package.json, hit npm install and - whoosh - now you could reuse code written by any stranger on the internet.

    Python’s pip and RubyGems have been around for many years prior, fyi.

    Open source was great because you had a small number of passionate, unpaid developers, building code that everyone else depended on. (…) But the cost was that everyone stopped knowing the details.

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

    • ScoffingLizard@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      5
      ·
      17 hours ago

      I heard: “The cost of open source is that everyone stopped knowing the details, therefore everyone should use shady blobs made by big tech instead.”

    • NewDawnOwl@lemmy.world
      link
      fedilink
      arrow-up
      10
      ·
      20 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.

    • MachineFab812@discuss.tchncs.de
      link
      fedilink
      arrow-up
      10
      ·
      21 hours ago

      “Reinventing the wheel” is part of how programming is taught. Not every “wheel” on NPM is free of un-foreseen consequence either; Not even looking at the borrowed wheel, let alone understanding it, should never have been rewarded.

    • arty@feddit.org
      link
      fedilink
      English
      arrow-up
      5
      arrow-down
      1
      ·
      21 hours ago

      Python’s pip and RubyGems have been around for many years prior, fyi.

      And PHP’s PEAR, and Perl’s CPAN