anki icon indicating copy to clipboard operation
anki copied to clipboard

Your dependency graph is crazy!

Open badlydrawnrob opened this issue 9 months ago • 0 comments

Also known as dependency hell I think we should really warn beginners about this!

Stumbling on a portfolio website that seems to be quite simple (see the repo), but had a LOT of dependencies. I have some thoughts:

  1. 923 dependencies is far too many for a portfolio site!
  2. Some books I've read are essentially broken due to outdated dependencies (for tutorial files).
  3. The javascript ecosystem (in terms of dependencies) seems to go stale at warp-speed!

Some bits of the portfolio site are cool, such as his talks section with a slideshow and transcript. But. I'm fairly sure you could handle that in a much simpler way: why not YouTube slides and an Ai Markdown transcript? If absolutely necessary, handle slides with Pandoc? If you want fancy animations, why not Prezi?

  • For some things, such as a blog, all you need is a static website generator. Plain html/css.
  • As a comparison, this single-page-app (SPA) with Elm has zero dependencies (and only 14 packages)
    • For the really pedantic, simply copy those package files into a /library folder. No dependencies!
    • Elm packages are pretty stable, although 5 years without updates is a grandpa for javascript devs.

I'm a big fan of future-proofing, simplicity, and boring technology. Print first CSS might not have all the bells and whistles, but it depends on very little — and even that's too much, as it could be plain CSS or use a simpler compiler.

I'm guilty of it too

Full disclosure, my elm-playground repository has lots of dependencies too ...

Most of these are from tutorials, using npm packages such as json-server. Really useful packages, so long as they're self-contained and easy to update. However, you could've used plain json files and elm reactor if all you're doing is a GET. Sometimes there's no getting around it. Anyway, you get the idea.

Here's an excerpt from an interesting book "Simplicity" all about cutting the fat with dependencies: know what a dependency does, and if you really need it.

Some useful examples

badlydrawnrob avatar Feb 07 '25 15:02 badlydrawnrob