Why I Started Ditching Dependencies (And Why You Should Too!)

Published 2024-07-18
Software dependencies can be extremely helpful, but do you really need a whole framework for that?

Today we'll be discussing software dependencies, and my approach to them.

The site I showed: blog.transrights.art/

Discord: discord.gg/DBQZk3MEsa

All Comments (21)
  • @SaHaRaSquad
    Many people greatly underestimate the true long-term costs of dependencies. It takes time to learn how to use them, often with incomplete or outdated documentation. It makes every update more fragile and setting up the project is more complex. It potentially makes you vulnerable to supply chain attacks. It makes you dependent on people you don't know to keep everything up to date. It makes troubleshooting harder. There are a few things were using dependencies makes sense (cryptography/security, anything with dates & timezones, Unicode stuff etc) but I know people who import an entire library just to get rid of a 15-line function and that's just frustrating.
  • @Kae____
    I want this to be the new hot trend in the tech world.
  • @JersenMan
    I feel like brainlessly adding dependencies is a very frontend thing to do. Im 99% backend end only add a dependency if i absolutely have to which does only that thing that i need
  • @robrobob
    I built a PHP app 20 years ago before the advent of composer (PHP package manager). All dependencies were manually copied into the project and updated when needed. That project still runs to this day. How? A single compatibility.php file that re-implements deprecated functions that were removed from PHP over the years. That's it. The app has survived 4 major PHP versions and STILL WORKS! The compatibility script isn't even that big, coming in at less than 100 lines of code.
  • @avishjha4030
    Great video! Just as an FYI, once_cell is now part of Rust standard library, so you can reduce your dependencies further by 1 :)
  • I agree. I hate having way too many dependencies so it doesn't become a mess and bloated.
  • So basically you switched from a framework to using a new language with a few extra libraries. This video is not about reducing dependencies. Its about using the correct tool for the job. Edit: not hating, great video but I was expecting something different reading the title.
  • @lordkekz4
    I can see your general point, but for the sake of hosting a (static) website, why would you write any logic at all? Static site generators like hugo or astro do pretty much exactly what is needed. Add a template like blowfish, and you can have a very professional looking website with decent customizability, great SEO and responsive design in less an hour. Of course, without writing the actual content, which doesn't change in speed significantly either way. I think while your setup is cool, the easiest way to go from markdown files to a website are static site generators + your webserver of choice (I like Caddy because of sensible defaults).
  • @ukrustacean
    Yup, this is the way. "Less is more" is my personal golden rule in programming
  • @willi1978
    hobby projects are nice because you can do exacly what you want. in an enterprise field it is usually the other way around. managers decide to select a tool that can do everything, which will come with a lot of dependencies
  • @freeideas
    FINALLY someone says what i have been thinking and arguing and practicing for so many years. Most of the time, your fancy library makes your project MORE complex, not LESS. There are a few things which are tricky and time consuming to write, and they are well-defined enough that you can just drop a library in and write a one-liner against it, but most of the time, doing things the so called "hard way" is actually SIMPLER. Nowadays, people don't use dependencies to get things done; instead the dependencies define how your project works! I feel like I am the last sane person in the assylum, or maybe I am the only insane person in the church. I don't know.
  • @Zullfix
    I once wrote a pretty damn good M3U8 parser tailored for my specific use case in my open source project. After a few months, a user found a very obscure bug in a WIP feature of the parser that wasn't even exposed yet, but what really got me was how they lambasted me in the issue thread for daring to make my own parser instead of using one of the several premade ones on NuGet that haven't been updated for over 7 years and store everything in a Dictionary instead of object properties. I guess my point is that 3rd party dependencies aren't the gospel and its okay, if not more beneficial, to do stuff yourself sometimes.
  • @svuvich
    Agree with the video. I picked Golang for that same reason and for the same kind of project. I wrote my custom static site generator using only the standard library (it even has standard templating language and the default HTTP router is great) with just 1 dependency being SQLite db driver. I also managed to do it entirely in two hours during a train ride. Since then I added go templ as a dependency for JSX-like components, and I'm building local editor server mode to let me edit my site content in the browser with htmx (it isn't linked in the built static version)
  • @Dimkar3000
    this is a good idea for a mini project. The moment you need anything more complex this aproach falls apart. I mean there so many things that may go wrong that a preconfigured server like actix/axum handles under the hood. You believe you don't need it until 1 guy takes down your server in a way that you did not handle. I also don't accept that re-writing half of axum because you only need that half is a mistake you are going to pay when you want to refactor or add any feature in a month and you don't remember how and why you designed your codebase that way. Also never under estimate the knowledge you gained the first time you wrote this project. The second time you write something its easier even if you change a lot of stuff.
  • Yeah dude but this is a blog site… static html and css is fine. No need to have a server to render the html. Do ur thing tho
  • @Zaxomio
    okay ngl I had a bit of a double take that our data store is just a long lived vector, but that's pretty fucking cool.
  • @sightorld
    on one hand i can see how its an interesting way to teach yourself how to optimize things properly (or to love frameworks for not having to ever do that yourself) on the other most of the js frameworks are not shipping whole framework when building (and use tree-shaking for whatever is not used) and unless its a fun personal project it won't be worth the time spent implementing features that are already made for you
  • I can see the primeagen video titled "WHY you should not use dependencies"