Тёмный
No video :(

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

Destiny Hailstorm
Подписаться 1,3 тыс.
Просмотров 41 тыс.
50% 1

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.transrigh...
Discord: / discord

Опубликовано:

 

5 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 261   
@besknighter
@besknighter Месяц назад
Here before Primagen reacts to it
@DestinyHailstorm
@DestinyHailstorm Месяц назад
I don't know what I'd do XD
@antonpieper
@antonpieper Месяц назад
Would be cool ngl
@heckerhecker8246
@heckerhecker8246 Месяц назад
here before someone says here before someone says here....
@gljames24
@gljames24 Месяц назад
​@@heckerhecker8246 Same, same...
@Shbhm0711
@Shbhm0711 Месяц назад
😂
@bandr-dev
@bandr-dev Месяц назад
15:29 MINUTES? this is going to be like a 4 hour prime video
@HyperCodec
@HyperCodec Месяц назад
Only prime manages to consistently drag out a reaction
@T1Oracle
@T1Oracle Месяц назад
@@HyperCodec Be nice, he has ADHD.
@perz1val
@perz1val 28 дней назад
​@@HyperCodec But he does actually respond and share his opinions, not just "haha, yeah, next vid" like everyone else
@robrobob
@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.
@blancfilms
@blancfilms Месяц назад
So you're not using Node, React and Tailwind?! Ewww! /s
@enkiimuto1041
@enkiimuto1041 Месяц назад
Go has a motto: A little copy paste is better than a little dependency
@SXsoft99
@SXsoft99 29 дней назад
​@@blancfilmsYou can use tailwind without react
@blancfilms
@blancfilms 29 дней назад
@@SXsoft99 Yes but you're not a real developer if you dont use React /s
@eckard9597
@eckard9597 28 дней назад
@@blancfilms What about Next?
@SaHaRaSquad
@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.
@DestinyHailstorm
@DestinyHailstorm Месяц назад
It really is frustrating to deal with. This kind of mindset lead us to have like 2-4 competing phone number validators in a production code base I worked on. Like, we can just do it ourselves and drop the broken packages!
@souleymaneba9272
@souleymaneba9272 Месяц назад
These dependency lovers are known as "library guys". Before writing a line of code they import a bunch of libraries.
@adrianspikes6454
@adrianspikes6454 Месяц назад
😂 bro u can't n shud t compare a language to a framework 🤦🤨 makes no sense and this coming from a JS hater!! That's like me comparing .Net to React or Angular where in .Net everything is spoon fed to the Dev's while React n Angular, Vite, Vue Next etc are all perfect examples of open-source gone wrong. Hated MS but then the others just became it so they all trash...even Rust 🤷
@NukeCloudstalker
@NukeCloudstalker Месяц назад
Worked at a place where a guy "with more experience" wanted me to use a library for a single datetime thing.. that I had already implemented myself... The library was even left behind - there were no future updates, and no further benefit to the project whatsoever. All to replace a few lines of code with "something simpler". Thankfully I don't work there anymore, or even with frontend for that matter. Absolute shitshow with people that think their idiocy is "best practices" and sign of competence. Derisive, I know, but this was my first job years ago, and he had YEARS of experience on me, could not formulate a reasonable case for using this library and yet insisted (blocked the PR). It led to actual issues dealing with the library itself, and he was in many other cases like this too. Run for the hills when people cannot argue their case from first principles and are not happy to do so if you ask for elaboration (if people ask you to do something, without being able to qualify what concrete problem you're solving). It's always a shitshow with those people, a ticking bomb waiting to explode.
@okie9025
@okie9025 9 дней назад
@@NukeCloudstalker why did you reimplement the wheel for something as mundane as datetime handling? Honestly that company is better off without you
@avishjha4030
@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 :)
@DestinyHailstorm
@DestinyHailstorm Месяц назад
Removing it removed exactly 1 dependency. I'll take it XD
@cocacodes
@cocacodes Месяц назад
Currently the Lazy types are still nightly since they have some discussion around type system funkiness around them but hopefully that'll be sorted out soon
@m4rch3n1ng
@m4rch3n1ng Месяц назад
@@cocacodes since rust 1.80 (which is stable since like a week) both LazyCell and LazyLock (which is probably what you want in this case) have been stabilized
@JersenMan
@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
@DestinyHailstorm
@DestinyHailstorm Месяц назад
It is something I see more commonly with more frontend oriented engineers, however I see this happen with the dependencies themselves as well. This in part is choosing the wrong tools for the job, but is also just the dependencies themselves needlessly depending on things.
@RickGladwin
@RickGladwin Месяц назад
And a dependency in the backend better do *exactly* what I need it to. The skepticism with which I read those docs… This app is important to me. I’m not just going to invite a bunch of other developers I don’t know into the project (which is what we’re doing when we import a dependency) without vetting first.
@dweblinveltz5035
@dweblinveltz5035 Месяц назад
I see it plenty with backend engineers using JS, especially if JS wasn't their first language. I tell you, I am constantly screaming everywhere I go like a madman, "Don't install MomentJs." ... or lodash just to use _.forEach...
@turolretar
@turolretar Месяц назад
If you brainlessly add dependencies on the frontend your clients will definitely suffer, so I don’t get that logic.
Месяц назад
Nah don't worry, I've worked with lots of backend deva who do the same thing. Personally I have a shortlist of two or three libraries I use all the time, but for the most part I like to just write and reuse my own libraries.
@willi1978
@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
@DestinyHailstorm
@DestinyHailstorm Месяц назад
These things can happen in enterprise, but it requires more work. I personally was able to drive our choice of tooling at the company I previously worked at. I couldn't get anyone to rebuild the whole stack, but what we were building next I always put forward my input and had managers that trusted my experience. I know this isn't the experience everywhere though, and is more likely to happen when the software is the product, not for the product.
@ukrustacean
@ukrustacean Месяц назад
Yup, this is the way. "Less is more" is my personal golden rule in programming
@Randych
@Randych Месяц назад
Why do you use rust then
@diadetediotedio6918
@diadetediotedio6918 Месяц назад
@@Randych Rust does not contradict this notion.
@pewpshidda1619
@pewpshidda1619 Месяц назад
@@Randych can you explain how you think rust doesnt follow that
@Randych
@Randych Месяц назад
@@pewpshidda1619 after using bobr kurwa, crab is anything but concise and straightforward
@turolretar
@turolretar Месяц назад
I think we are going to have to start explaining less of what is more of what. Because on the surface those words don’t make sense but sound deep
@rileyhawksworth8362
@rileyhawksworth8362 Месяц назад
I agree. I hate having way too many dependencies so it doesn't become a mess and bloated.
@samuelstein3412
@samuelstein3412 Месяц назад
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.
@DestinyHailstorm
@DestinyHailstorm Месяц назад
My argument ended up falling a bit more towards "use the right tool", but I feel the idea I wanted to show was that you don't need big and bold dependencies to do the job in the first place. The "right tool" could be argued for axum for instance as it will do the job, but it has a lot I really don't need and that costs me as a developer. It could be argued with that logic it isn't the right tool here to begin with, but that's harder to tell someone who likes and biases towards a tool.
@Novacification
@Novacification 9 часов назад
I agree. The site was very simple, so using Angular was way overkill. It's fine to use Angular for it - I doubt the site performance was negatively impacted from having those dependencies - but if the goal is to cut down on those, then dropping Angular was the obvious first step. Angular could package all of the dependencies in a single package if they wanted though, so the number of dependencies feels like a poor metric. And obviously, if for some reason the site has to run without Javascript then finding another language is a requirement. A good reminder that you don't always have to grab the same hammer from your toolbox but perhaps a bit contrived as an example of dependency bloat.
@ficolas2
@ficolas2 25 дней назад
Im gonna call the fact that prime will react to this, will mention htmx a couple times before the halfway mark, and when the video mentions htmx, prime will say "hmtx mentioned, pre watch"
@freeideas
@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.
@DestinyHailstorm
@DestinyHailstorm Месяц назад
This! It made my project really easy in this case. It doesn't need a bucket of magic to do basic stuff. I just want to slap some HTML together!
@nielsdeschaap
@nielsdeschaap Месяц назад
You are completely right when it comes to projects where you and you alone decide the scope. But a lot of software engineering (if not most) is not like that, you have to deal with varying budgets, priorities and complexity. People who recommend more complex tools that take more work to get to a solid foundation do this with this in mind. I can recall multiple times where the first version of an application I made with just used the bare minimum to get things done worked awesome, but eventually things change and you will have to add a features that you did not account for.
@turolretar
@turolretar Месяц назад
Listen do you want to be out of a job or not. We need libraries
@freeideas
@freeideas Месяц назад
@@turolretar Oh yeah... I didn't realize it until now. We need those libraries to keep our billable hours up! We can get paid by the hour to make the libraries, and then get paid again for the extra time it takes to USE those libraries! OK. I get it now. Thank you.
@lordkekz4
@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).
@marl3x
@marl3x Месяц назад
Agree, he initially chose the wrong tool for the job and came to the wrong conclusion because of it.
@Kae____
@Kae____ Месяц назад
I want this to be the new hot trend in the tech world.
@b_dawg_17
@b_dawg_17 Месяц назад
I think it will be tbh. All the "hot new trends" tend to be great for a few specific enterprise level applications. But our mistake is thinking that that's what makes is good for our millions of small projects. The main idea that I hope is not lost: Use the right tool for the job. It's not about minimalism. It's not about convenience. It's about picking a tool that fits the use case. Some saying about square holes and round pegs or something, idk.
@RoamingAdhocrat
@RoamingAdhocrat Месяц назад
dependency elision
@deadchannel8431
@deadchannel8431 Месяц назад
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
@ficolas2
@ficolas2 25 дней назад
This is true, he could always do the markdown->http, with a tool instead of in the server
@Dimkar3000
@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.
@atiedebee1020
@atiedebee1020 Месяц назад
This sounds like hard cope.
@Dimkar3000
@Dimkar3000 Месяц назад
@@atiedebee1020 not really, just some advice. This some advice from someone who is soing backend professionally for a while. Of course he is right, for a personal project this is ok but after a while maintaining this will be a pain.
@atiedebee1020
@atiedebee1020 Месяц назад
@@Dimkar3000 i guess it highly depends on what you're developing. I've personally developed a loathing towards dependencies because of how often they get thrown around as the answer to a lot of problems.
@Dimkar3000
@Dimkar3000 Месяц назад
@@atiedebee1020 I agree, some people take it too far, where they would take a dependency for a 3 line function. The oposite can be the same problem. I guess I am saying, never be afraid to use a library for something essential, I am pretty sure the actix/axum teams have done a lot of work in order to make there runtimes really good. You don't have to re invent the wheel but its ok if you want to do it for education or for fun.
@XnetRoidPL
@XnetRoidPL Месяц назад
I feel like comparing NPM to Cargo is pretty crude, Rust is much newer, documentation is way better and dependencies are in general, smaller and better maintained. Many large libraries are split into smaller crates (parallel compilation) so you *can* pick and choose what you use. Despite my short experience I also have to agree with the more complex projects, it's much easier to discover an existing solution in a full-package than to add your own patch every time you need something new.
@ivesennightfall6779
@ivesennightfall6779 Месяц назад
can you articulate why you couldn't just use nginx + a static site generator? I've been hearing a lot about hugo lately also for static pages, remember that nginx and apache support simple macros that can be used for headers and footers, probably more as well if you look into it. Of course, if you're more comfortable with this then that's enough of a reason in itself.
@DestinyHailstorm
@DestinyHailstorm Месяц назад
I don't want to put myself into a box. I know I have ideas for things like comments in the future and know I will need tooling such as this to do it. I actually run an Nginx server, but it acts as a proxy server and routes it to my various hosts, which are all active servers. So it's also just how my servers are setup to work and I find it really easy to work with :)
@davidskidmore3442
@davidskidmore3442 Месяц назад
@DestinyHailstorm It's almost like people have forgotten about server-side includes or what CGI was designed for. Running nginx to proxy to a static fileserver is just as bad as all that express and Angular to do basic webserver tasks. nginx could do everything you're doing with this Rust app with maybe 1 plugin... and you're already running nginx.
@computerfan1079
@computerfan1079 Месяц назад
​@@DestinyHailstormyou probably don't I have comments on a static website using Giscus. You could also make your main website with HTML and embed a tiny amount of Javascript/HTMX that communicates with a server that only deals with comments. That way it is a lot simpler, because you don't have to reinvent a static site generator
@aixtom979
@aixtom979 26 дней назад
Reminds me of the time a consultant wrote something where 80% of the compiled program size was the pulled in dependencies for Log4J, when the thing did only log messages in about 2-3 places in total, where the destination of that log then had to be configured in an *additional* XML file for Log4J to work during deployment... So I deleted that lines, replaced it with a STDOUT/STDERR message dependent on the result (since all processing of that was already handled by the job-scheduler script anyway) , and removed the Log4J dependency. (Funny enough, that was about ~8 month before the Log4J security issue came up in 2022...)
@svuvich
@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)
@turun_ambartanen
@turun_ambartanen Месяц назад
You should tell my browser to cache static assets from your site. Reloading the front page fetches like a megabyte of images from your server every. single. time.
@DestinyHailstorm
@DestinyHailstorm Месяц назад
Whoops! Fixed it!
@datboi1861
@datboi1861 Месяц назад
Inspiration acquired. Efficiency arc started. Thank you, comrade.
@DestinyHailstorm
@DestinyHailstorm Месяц назад
I'm doing my part!
@Zullfix
@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.
@rGunti
@rGunti Месяц назад
You also gain a lot more experience from building your own things.
@Zullfix
@Zullfix Месяц назад
@@rGunti Indeed. Writing the M3U8 parser taught me a lot about non-backtracking parsing, and I proceeded to use that knowledge in another project just 2 months later.
@xcoder1122
@xcoder1122 24 дня назад
I've been a software developer for over two decades now, and a hobby programmer for over a decade before that, and I've never understood how people can seriously think it's a good idea to add a dependency to a library that itself has dependencies on 8 other libraries, some of which have dependencies of their own, just to use a single function of that library, which is 80 lines of code and could have been written by any moderately skilled programmer in less than an hour. There are so many things that could break here in the future, aside from the fact that installing your application on a system causes the system to install 20+ other packages just to satisfy dependencies that your code does not even use, they are just dependencies of dependencies of a small piece of code that your code does use, basically bloating up the system for no benefit at all.
@christofferluplau1153
@christofferluplau1153 Месяц назад
you can use cargo watch to hot reload :)
@DestinyHailstorm
@DestinyHailstorm Месяц назад
Thanks for bringing it to my attention! I might not use it, but its good to know it is there.
@codingwithjamal
@codingwithjamal Месяц назад
i was going to comment this 👍🏾
@lordxan1
@lordxan1 Месяц назад
The main reason why it works in rust is that it has ecosystem/mindset focuse on one library that can do it all, and if you want to drop some features you can do it via features flags. On the other hand in npm you don't have feature flags so you have to split it via packages aka deps to minimase size of the bundle
@lordxan1
@lordxan1 Месяц назад
For example if you use more mature framework that has tree shake by default like Vue or Nuxt you can get almost all the features for exactly the same number of direct deps as in a rust project
@ARKGAMING
@ARKGAMING Месяц назад
"Node has a disaster" 😂
@tryoxiss
@tryoxiss Месяц назад
Yup! Nice to keep things simple, its crazy how many dependencies are added to many projects that are not needed.
@solinvictus--x
@solinvictus--x Месяц назад
Back in the days, adding a dependency was a huge matter that would need serious consideration. I have worked on several projects, where we have had to do major refactors, due to some insane dependency trees, for what, isolated, are minor things, but which, collectively, has been driving the design towards accommodation of these various apis, not towards what is the best long term. Then there is the security aspect of it all, which can also turn out to become a major liability, down the line. This is just one of many things, brought forward by modern web development, that is completely bonkers
@paultapping9510
@paultapping9510 Месяц назад
when I first started coding 20 tears ago cross-site scripting was a tool for attack, now I come back and it's the recommended way of managing dependencies. The polyfil attack solidified my mistrust of cdns and I want to minimise deps in all my projects going forward. Why cdn google fonts in a project that uses 2 font-faces, one of which is installed on most systems for e.g.
@Jason9637
@Jason9637 Месяц назад
You can avoid all those attacks by using the integrity attribute with your script tags (or similar features for other languages)
@paultapping9510
@paultapping9510 Месяц назад
@@Jason9637 My (limited and willing to be schooled) understanding is that that makes sure you have the same file that the cdn says it's served you, but doesn't guarentee the file itself isn't malicious. Let's say a major cdn gets infiltrated, and several major deps are compromised, is there currently any widely used safeguard against that or is it all based on trust?
@Jason9637
@Jason9637 Месяц назад
@@paultapping9510 If they do get infiltrated, you'll have to trust that news of the attack comes out before you deploy. But signatures prevent cdns from changing the files without your approval
@Starwort
@Starwort Месяц назад
​​@@paultapping9510integrity ensures that the browser receives the version of the file *the webpage you're currently rendering* expects, not what the CDN says. It's the SHA sum of the resource embedded into the webpage EDIT: technically this doesn't guarantee that the file isn't malicious but it does guarantee you're getting the same resources as the site was developed for, so no direct supply chain attacks there
@sightorld
@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
@dies200
@dies200 24 дня назад
While i do agree with the idea of questioning if you really need a dependency: Serving static content or at least url parsing, should be handed off to a good library. There are so many vulnerabilities you can build with simple url parsing.
@DF-ss5ep
@DF-ss5ep Месяц назад
Rust is probably good if you want to write it once and forget, since it is less likely to have memory bugs, crashes, etc. I wouldn't use it if I wanted to add functionality to it the future, though.
@oglothenerd
@oglothenerd Месяц назад
Oh shoot! You are the person creating that one voxel game I saw devlogs for a little while ago!
@DestinyHailstorm
@DestinyHailstorm Месяц назад
@@oglothenerd Yep! XD
@oglothenerd
@oglothenerd Месяц назад
@@DestinyHailstorm I love your work! Will it be open source? I actually just got banned from ever interacting with the ReIndev project.
@DestinyHailstorm
@DestinyHailstorm Месяц назад
I currently don't have plans for open sourcing it.
@oglothenerd
@oglothenerd Месяц назад
@@DestinyHailstorm Okay. :(
@mrkostya008
@mrkostya008 Месяц назад
Pretty sure using Angular for a blog wasn't the best idea to start with.
@rGunti
@rGunti Месяц назад
It's easy to fall into this trap when you're using it to earn your bread and butter (like me). The mental load of *creating* the project is a lot lower. But all hell breaks loose once it comes to long term maintenance.
@affluent3364
@affluent3364 Месяц назад
The reality of being a dev is that whatever you make will depend on something, if not a random node package, a cloud provider, if not that, something. I get wanting to slim your project down but beware, switching to rust, while raw doggin OS threads and ditching tokio/async: Is a great way to make your code extremely unmaintainable! Great for a small project though :)
@taquanminhlong
@taquanminhlong Месяц назад
Well, at least cargo has "feature flag" to prevent using unnecessary depedencies
@DestinyHailstorm
@DestinyHailstorm Месяц назад
The problem is this still happens even with feature flags. It helps the problem sure, but there are still very large and sprawling dependency chains on dependencies.
@AdamLeis
@AdamLeis Месяц назад
I totally feel this. I've just recently been trying to slim and trim my site, but also get something out the door quickly. I kept flip-flopping. I ended up staying with Astro (trying it out - cool tool but lots of extras), but I'll definitely be looking for my own super-slim, low-dependency, boring maintenance because it just works version.
@DestinyHailstorm
@DestinyHailstorm Месяц назад
I have honestly started to just think about building something that takes the principles I have in mind, and making it just 1 dependency with feature flags for all the different parts. I feel like there is a way to get that super slim, low dependency, boring maintenance kind of kit, but have it work pretty cleanly together in a uniform way. *Hmm*
@jacoboneill3735
@jacoboneill3735 Месяц назад
Unix principle but for dependencies. I like it
@diadetediotedio6918
@diadetediotedio6918 Месяц назад
You understand that the unix phillosophy has more potential to lead to more reliance in dependencies than not, right?
@jacoboneill3735
@jacoboneill3735 Месяц назад
@@diadetediotedio6918 I was more referencing the choice in his dependencies doing the one thing he needs rather than an overarching dependency with 20-40 sub dependencies in it where he won’t use 80% of the functionality.
@diadetediotedio6918
@diadetediotedio6918 Месяц назад
​@@jacoboneill3735 Oh, sure, this is true indeed. But it also means that you will end up with if you are building determinate types of software, which is something he goes against in the beginning of the video.
@Zaxomio
@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.
@DestinyHailstorm
@DestinyHailstorm Месяц назад
It ain't need to be complicated! XD
@DisneyDynamicks
@DisneyDynamicks Месяц назад
Fantastic video!!! Great editing, content, and I loved the end!!!! Please do more!!! ❤❤❤
@DestinyHailstorm
@DestinyHailstorm Месяц назад
More is on the way!
@porky1118
@porky1118 24 дня назад
But pretty good video to show how easy you can create a website in Rust. I think, I didn't find all these dependencies when I wrote my website. I think I only used maud of these. Maybe I can improve my website with this.
@hectormejia499
@hectormejia499 29 дней назад
100% agree, but I find it funny how often times Rust projects are second to JS when it comes to heavy dependencies
@acborgia1344
@acborgia1344 Месяц назад
Dependencies are great, people much better than me have implemented specific very useful algorithms and tools and I can just use them for what I need Having to code all the functionalities I need myself would take months or even years, and end up being not as good as these libraries Otherwise framework wise I'd say don't use Angular, it's bloated, slow and unintuitive. Go for React, or Vue for smaller projects, use Material UI and any regular website will be 100x faster to make. For your specific use case though, it's understandable you'd want something lighter, but lighter doesn't mean simpler to use
@DestinyHailstorm
@DestinyHailstorm Месяц назад
Dependencies are good in some cases, and I showed great examples of dependencies I picked to solve problems I had. You shouldn't be afraid to write code and get your hands dirty though. Of course be reasonable and know what you can do, but you'd be surprised how quickly you can move when you don't have to deal with your dependencies :)
@ar_xiv
@ar_xiv Месяц назад
this basic mindset has been obvious to me my whole coding career and it freaks me out how it doesn't seem obvious to everyone else
@DestinyHailstorm
@DestinyHailstorm Месяц назад
@@ar_xiv I think part of this comes from the environment you learn to develop from. Personally, having started mainly in games, I feel this biases towards my ideas as they are almost requirements later on. No matter how shiny a dependency is, if it threatens the CPU too much it's getting the can.
@kayyum698
@kayyum698 Месяц назад
Thanks for raising this issue, it took lots of efforts to add and use dependencies and there nature is forever changing.
@josefaguilar2955
@josefaguilar2955 Месяц назад
Something like Angular or React is better off for large scale Enterprise level projects where many devs are working in the codebase. The cognitive costs can shared with a team, so once one problem is solved, its easy to share the aolution with other repos using the same framework. It's generally not recommended to use for personal projects unless you plan to learn the framework or grow the project, even then you want to reduce friction in development early on.
@weeb3277
@weeb3277 Месяц назад
it's not just the bloat that is the problem there are always bugs
@specy_
@specy_ Месяц назад
I think a better choice would have been using sveltekit, you'd have finished the project in 5 hours with 200 lines of code, with no JavaScript on the client, hot module reload, 5 seconds build time, and completely static build that you can host statically
@DestinyHailstorm
@DestinyHailstorm Месяц назад
My end goal isn't a static site. I plan on adding much more. A static site generator does not fit my near future needs.
@specy_
@specy_ Месяц назад
@@DestinyHailstorm that still allows you to add non static content, you have the choice to make things dynamic or static, interactive or non interactive, with JavaScript or without, you have full freedom, if you have never seen sveltekit I highly suggest you to try it, it's incredibly lightweight too
@RootsterAnon
@RootsterAnon Месяц назад
`cargo-watch` and `just`. use cargo-watch to watch files and restart once file has saved and just for making callable scripts like package.json is a must in every project, not just Rust. Awesome video!
@RootsterAnon
@RootsterAnon Месяц назад
for Go developers is Air and just... love and kisses
@tomatbebo
@tomatbebo Месяц назад
Unless I am missing something your data and templates seem to be static so you could SSG this. Then you only need to serve static files which you can do with a CDN or some static file server like nginx. The only dependency would be whatever you need to generate the static files + your provider or static file server of choice. No need for tiny_http even
@HyperCodec
@HyperCodec Месяц назад
Btw the Lazy types are in stable std now after a recent update, you probably didn’t need once_cell or lazy_static
@Henrique-up4su
@Henrique-up4su Месяц назад
Instructions unclear. Created another flavor of linux to run my projects.
@beanieteamie7435
@beanieteamie7435 Месяц назад
Here before primagen 💯
@rezwhap
@rezwhap Месяц назад
When you add a dependency, you import functionality, but you also transitively import complexity and (future) bugs. Choose wisely!
@TeamDman
@TeamDman Месяц назад
Really great video! Makes me want to revisit my own site's design
@valhalla_dev
@valhalla_dev Месяц назад
Yeah this one earned you a subscription. Fantastic video
@DestinyHailstorm
@DestinyHailstorm Месяц назад
Guess I'll have to make some more stuff XD
@LeilaPasha-ky1rx
@LeilaPasha-ky1rx Месяц назад
Hopefully we get a tutorial for how to setup something at least similar to your project?
@DestinyHailstorm
@DestinyHailstorm 27 дней назад
That could be an interesting video idea. I think I would want to stream line it though, as there are some rough edges that should really be handled, and some oddly large dependencies in the mix. Perhaps I'll make a crate that wraps together a nice set of small dependencies and have some extra functionality to tie the loose ends.
@Scouarn
@Scouarn Месяц назад
I do the same for my website except I don't bother with actual programming and I use pandoc which does the markdown with highlighting and latex formulas. My entire "backend" is a few html templates and 20 lines of makefile to rebuild the pages. Pandoc itself has a lot of dependencies but the server doesn't need to rebuild so only a basic http server is required. In my opinion rust is overkill for something that will run once a month for a second.
@DestinyHailstorm
@DestinyHailstorm Месяц назад
I plan on expanding this idea as my videos go on. This site will end up being dynamic, and will need some actual infrastructure. Baking some pages and putting it behind something else to host it isn't the end idea, I want stuff to be more dynamic and show some cool ideas :)
@enkiimuto1041
@enkiimuto1041 Месяц назад
That is one thing that made me leave PHP. For you to work on anything slightly more than minimal, like in the javascript world, you're recommended dozens over dozens of things you don't need to. You don't need a huge framework + a templating language on the language that can be used as templating to do what you want. But if you are learning, and then you run into a problem, people will ask you why you're not using them instead of helping you.
@DestinyHailstorm
@DestinyHailstorm Месяц назад
I don't know why so many people basically say fix your problem by replacing it with (Insert Thing), its honestly pretty frustrating as a developer and makes it just not fun to work on things anymore.
@porky1118
@porky1118 24 дня назад
The variant where many dependencies were used was written in JS. And the variant with a low number of dependencies uses Rust. Sounds like the title should rather be "Why I Started Using Rust Instead Of JS (And Why You Should Too!)". I'm using Rust for years now and I never had issues with using too many, unneccessary or overly complex libraries in Rust.
@DestinyHailstorm
@DestinyHailstorm 24 дня назад
In my short time working with Rust, I can tell you already I have run into it. It made my compile times worse, and it sucked to work with. While it isn't as big of an issue in the Rust ecosystem, it still applies to it. I would argue that even if Rust is better than JS in this respect, it still is worse than many other ecosystems, and as developers we should be looking to change our habits if we want sustainable software.
@user-qr4jf4tv2x
@user-qr4jf4tv2x 4 дня назад
the biggest reason to ditch dependencies for me are vulnerabilities
@capybara-expert
@capybara-expert Месяц назад
I can see the primeagen video titled "WHY you should not use dependencies"
@asdasfdfgewqgrgyjh
@asdasfdfgewqgrgyjh Месяц назад
More content like this my man!
@JanVerny
@JanVerny Месяц назад
Broadly speaking it's easy to understand why having less dependencies is better than having thousands of them. This is all very understandable. But assuming you can only produce X lines of code in day, almost anyone can also see why those lines would be better spent not reinventing the wheel. As long as dependencies allow me to ship features faster, I will always prefer adding a dependency over doing a bunch of redundant completely wasteful work.
@dandogamer
@dandogamer Месяц назад
I have trust issues with hot reloading where its not worked in the past so i always end up refreshing the page anyway 😅😂
@DestinyHailstorm
@DestinyHailstorm Месяц назад
*Felt*
@ottergauze
@ottergauze Месяц назад
It'd be cool to see if it'd be possible to add an RSS feed to the site without another dependency, but frankly if there's something out there that does the job well and doesn't depend on 30 other things I think one more wouldn't hurt, but now I'm starting to sound like an addict.
@DestinyHailstorm
@DestinyHailstorm 27 дней назад
I did a bit of thinking, it might be possible to add an RSS feed without another dependency. You'd just be generating it by smashing strings together though, so its not exactly guaranteed to generate valid data or anything. It would definitely work though. I'll think about it some more and maybe add support to my site just for fun.
@Arbmosal
@Arbmosal Месяц назад
to be honest, nuget is a bit of a disaster, too :/
@DestinyHailstorm
@DestinyHailstorm Месяц назад
It is, I just thought it was funny to pick on one of them XD Nuget has been the cause of many hours of needless debugging for me, granted same with NPM XD
@diadetediotedio6918
@diadetediotedio6918 Месяц назад
I find nuget to bring a lot less dependencies than with others.
@RmAndrei93
@RmAndrei93 Месяц назад
Pretty sure you need a dependancy for markdown , however you can have that on golang
@DestinyHailstorm
@DestinyHailstorm Месяц назад
Yes, this is one of the dependencies I use. It's called comraq, and I use syntect for syntax highlighting of code blocks. While it may be included in GoLang's standard library, this is not standard across the rest of the industry, and my focus here is more so on the principle, than exact tooling and libraries. I happen to enjoy Rust, and strive for safe and maintainable software, so it's why I chose Rust and the dependencies I did.
@KrakonosovoBabka
@KrakonosovoBabka 9 дней назад
Man I still use static html for my personal web xd. Also it is funny how these new programmers think 95 dependencies is not too much. I mostly use c and I usually use what is already in system, or sometimes 1 dependency for networking, or some wrappers.
@chuchumba4211
@chuchumba4211 Месяц назад
You could do this site in a few minutes on Astro in a more comfortable environment and without extra code.
@langnostic5157
@langnostic5157 Месяц назад
Why not Hugo or Astro to solve this "problem". I agree, JS dependency tree in a simple app is crazy. But a lot of Rust crates now-a-days have large dependency trees.
@DestinyHailstorm
@DestinyHailstorm Месяц назад
I didn't go into this in the detail I wanted to, but I mentioned a little bit about the amount of direct dependencies all of axum has (33+ IIRC), when combined I had 94 total dependencies that made it to build. Transitive dependencies are a real reason to not use a dependency!
@guelakais1438
@guelakais1438 Месяц назад
Is it possible to share the code from the video? I just wanted to rebuild it to see how it all works. Unfortunately, there are still a few loose ends in my code that I can't quite figure out yet. For example, I can't find `templating::render_home()`.
@DestinyHailstorm
@DestinyHailstorm Месяц назад
I'm looking into making it publicly available. For now, please join my Discord and I can provide you some snippets and explanations, hopefully I can make this easier in the future.
@hiibolt
@hiibolt Месяц назад
you just put me on comrak so hard omg ily
@AZEMBadlen
@AZEMBadlen Месяц назад
I feel like you are asking a wrong question. "Should I add a dependency?" no, you should create a feature or an application that does what you need it to do. If you feel like there is a viable tool for a job, use it, if not write it. It's that simple. Nothing more, nothing less.
@griffitaj
@griffitaj Месяц назад
Nearly 100 dependencies for a simple personal site, that takes 5s to build?
@ransomecode
@ransomecode Месяц назад
I mean if treeshaking gets rid of the unused parts of the dependencies, does it even matter?
@DestinyHailstorm
@DestinyHailstorm Месяц назад
Yes, it does matter, especially because of the deep relation a lot of dependencies end up having. Sure, you might "shake off" some pieces, but that doesn't change you still have hundreds of transitive dependencies you need to keep track of and manage.
@DragoniteSpam
@DragoniteSpam Месяц назад
Rust has Cargo, C# has NuGet, and Node has a disaster
@HumanityAsCode
@HumanityAsCode Месяц назад
I recently did something similar with my blog. I rewrote it as a Web Assembly app in C# that is hosted on Github Pages. There are markdown files for each blog post and a JSON file that lists them all and their metadata. Any logic happens in the frontend with C#
@DragoniteSpam
@DragoniteSpam Месяц назад
I find it interesting that CS/SE classes the world over make a big deal about keeping code lean and minimizing the number of things that can go wrong with it, and yet this is such a rampant problem out in The Real World™. It reminds me of an old joke: "Noob programmers keep it simple stupid, intermediate programmers write general solutions that elegantly cover all possible use cases, and veteran programmers keep it simple stupid"
@DestinyHailstorm
@DestinyHailstorm Месяц назад
I think I finally hit the point of K.I.S.S. again. I'm tired of fancy, make it god damn work and maintainable XD
@DragoniteSpam
@DragoniteSpam Месяц назад
@@DestinyHailstorm To play devil's advocate, it feels cathartic when you try something fancy and it just works. To play the devil's devil's advocate, most of the time when you do that you've already wasted hours/days/weeks that you could have spent on other things lmao
@HenriqueErzinger
@HenriqueErzinger Месяц назад
It’s great that you did it, but this project was never a good fit for something like a fular from the start, and that’s the point.
@principleshipcoleoid8095
@principleshipcoleoid8095 Месяц назад
I like Bevy tho. It is fun
@sunkittsui7957
@sunkittsui7957 Месяц назад
Very well made good video
@DestinyHailstorm
@DestinyHailstorm Месяц назад
Thanka :)
@guguludugulu
@guguludugulu Месяц назад
I agree with the point but i feel like you chose a flawed way to illustrate it since the job could much better be done in a static site generator. Maybe I'm missing something though
@DestinyHailstorm
@DestinyHailstorm Месяц назад
This video doesn't fully tell you the scope and ideas of the project I have in mind. Yes, that would be a better solution, but I already know and have plans to go far beyond that. I hope as I put out more videos I can show this :)
@soanvig
@soanvig Месяц назад
Dude, im building my site using simple program i wrote in shell scripting language, and serve it as static files. I see you have static page as well. Why having a server if you can have something even simpler?
@BigStupidTech
@BigStupidTech Месяц назад
How does this only have 10k views??
@nzeu725
@nzeu725 Месяц назад
I just code without depencies with only pure C cause I like it (except the standard libs of course)
@mac.ignacio
@mac.ignacio Месяц назад
React needs 10 dependencies before it can be useful. Even the router is a dependency.
@jameshickman5401
@jameshickman5401 Месяц назад
So you used a bloated JS framework for a PHP job?
@NFvidoJagg2
@NFvidoJagg2 Месяц назад
One question I always ask myself is, can this be done with the vanilla tools set
@codingwithsphere
@codingwithsphere Месяц назад
Great video
@Woef718
@Woef718 Месяц назад
Absolutely true
@vief6822
@vief6822 Месяц назад
All Linux packages depend on the Linux Kernel to run. Dependencies are bloat. Ship your own OS with every Package.
@DestinyHailstorm
@DestinyHailstorm Месяц назад
Sounds like Docker ngl.
@cupofkoa
@cupofkoa Месяц назад
Talking of dependencies - Go would have been even lighter compared to Rust, using just the standard library. I know Go is boring and stupid easy compared to Rust, but it fits the bill for most web server stuff, leaving Rust to deal with systems programming.
@DestinyHailstorm
@DestinyHailstorm Месяц назад
I haven't tried out Go yet, I might need to give it a look in the near future. At the moment I've focused on using Rust since I have absolutely loved its compiler.
@VLUURIE
@VLUURIE Месяц назад
greate video!
@jacopocomparin
@jacopocomparin Месяц назад
I do think the problem is not with dependency themselfs, dependencies are the bread and butter in business settings when things need being done yesterday for today and there's no time caring for bloat; the problem is with overbloated and overcomplicated frameworks that solve problems only big corpos have: like Angular. It's the exact same problem with things like kubernetes. it solves the core problem briliiantly and, if you think about it, clean way. But its' benefits are only visible if you have 20 people working with it; meaning that they're basically useless and only cause problems and waste of time for small developers.
@aivisabele
@aivisabele Месяц назад
You did initially choose the wrong tools for your job.
@gabeowser9881
@gabeowser9881 Месяц назад
0:40 🤨
@defenastrator
@defenastrator Месяц назад
Sorry you have too meny dependencies here things you should eliminate included the rust compiler. You'd be amazed how much easier & faster you can solve things by abandoning the idea you need to write software at all. An Apache server & server side templates can solve a wide variety of problems. It's these front end boozos retinventing the wheel or worse the time sharing operating system in because we have to do the backend & frontend in either python if they are data-scientists or Javascript if they are web devs. Reject Modernity Return to monke
@lucagreggio2278
@lucagreggio2278 Месяц назад
Wating for prime, I know it will be here soon
@airkami
@airkami Месяц назад
I literally just commented on this concept before
@airkami
@airkami Месяц назад
Hours ago really Good minds
Далее
I Spent 18 Months Using Rust And Regret It
38:36
Просмотров 338 тыс.
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Triple Protein Sandwich
00:32
Просмотров 4,2 млн
ПРИКОЛЫ НАД БРАТОМ #shorts
00:23
Просмотров 562 тыс.
НЕДОВОЛЬНА УСЛУГОЙ #shorts
00:27
Просмотров 19 тыс.
3d printed demon core vs real
00:24
Просмотров 6 млн
USE COMPOSITION trust me.
10:00
Просмотров 96 тыс.
Use Java For Everything
38:35
Просмотров 350 тыс.
Errors as Values are the Future
7:19
Просмотров 39 тыс.
Why Facebook Doesn't Use Git
31:01
Просмотров 262 тыс.
Linus Torvalds on why desktop Linux sucks
11:07
Просмотров 1,3 млн
Why Are Open Source Alternatives So Bad?
13:06
Просмотров 626 тыс.
why do header files even exist?
10:53
Просмотров 399 тыс.
The cloud is over-engineered and overpriced (no music)
14:39
How A Steam Bug Deleted Someone’s Entire PC
11:49
Просмотров 979 тыс.
Triple Protein Sandwich
00:32
Просмотров 4,2 млн