this post was submitted on 26 Dec 2023
36 points (67.6% liked)
Programming
17354 readers
339 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Depends on the wheel.
I mostly work in Go when I have a choice, and it's got a lot in the standard library. (The Go standard library doesn't count as a dependency... or at least not an optional one.) When I write web (as in JS-in-the-browser) stuff, I don't use any JS dependencies aside from browser built-ins.
Also, I don't mean to imply I don't use dependencies at all. But having dependencies that aren't pretty much absolutely necessary is the kind of thing that ought to make one hate oneself a little more. Just a little self-flagellation for each dependency can't hurt either. (Just to be clear, I don't mean this literally.)
As an example, not long ago, I wrote a web-based virtual tabletop application (the kind of software you'd use to play Dungeons and Dragons remotely) in Go. Aside from the Go standard library, it's got exactly three Go dependencies: a Sqlite3 driver, a library for minifying HTML/CSS/JS, and a transitive dependency of the minifier for parsing HTML/CSS/JS. The JS has zero dependencies other than browser built-ins.
The "wheels" I could arguably be said to have "reinvented" just off the top of my head:
Now, I could pull in Handlebar and RequireJS and React and jQuery and Underscore and Gorilla and have a build system that depends on NPM and Bower and maybe has a Makefile to coordinate it all. But I really don't see the benefit. Especially compared to the drawbacks.
And by not pulling in libraries for these features I'm saving:
More reading relevant to avoiding dependencies and frameworks:
I'd even go further and say that if you are using a "high level" language that requires you to re-invent the wheel for simple things (for example JS not having built in functions to shuffle an array or, clamp an number to a range) are indications of poor language design that have lead to the prevalence of all the bloated JS frameworks like jQuery. Obviously I don't think every language should have a Python-tier standard library, but I'd really like to not have to download half a language from every site I visit because every site uses jQuery for a lot of things that come standard in better languages.
Second what you've written regarding Go framework providing what you need for a lot of things. Recently I've managed to reduce a binary size of my app by over 6 MB (16%) and make the thumbnailer it uses over 50% faster by removing dependency on a library that utilized ffmpeg bindings, because it was bloated with AWS SDK dependency and just using the standard library.