2 ms·
HTMX is a massive relief from the client side Javascript mess. "Modern" Javascript frameworks are just terrible for so reasons. If Rust gets a Dependency Injec
by exabrial 3y ago
HTMX is a massive relief from the client side Javascript mess. "Modern" Javascript frameworks are just terrible for so reasons.
If Rust gets a Dependency Injection framework (like CDI) and a Mocking framework (like Mockito), I'm 100% in.
- stmblast 3y agoDefinitely! I remember my first thoughts when moving from Next.js 13 to using a HTML templating engine were "wow, this is much simpler" and "should've done this sooner". It's saved me quite a lot of time in terms of not having to think about props/SSR
- jbjohns 3y agoWhy would Rust need a Dependency Injection framework? It's functional, no? I really hope drifting OO practitioners don't wreck the language putting a bunch of OO stuff that is better done in functional programming.
- pie_flavor 3y agoIt is imperative/procedural, and programming paradigm has nothing to do with DI, which is about automatic generation of certain function parameters.
- jbjohns 3y agoIt's not automatically generated though, it's just specified somewhere else. This is what makes OO projects so hard to read from the outside: you first need to figure out what thing is having an effect on what. In a proper functional style I can go to main and follow everything from there. As someone else said, if you have some kind of interface to "mock" you can just make this a parameter to a function and pass in the "mock" versions for tests and the regular one for the real program (or select from a set of them based on some parameter or something). A framework would just mean I can't just read from main, I'll have to figure out which DI framework is being used, where that is configured and what things effect its decision making. I see why we ended up doing this in OO but I really don't see the benefit anymore in functional programming with the more direct (and no less flexible) approach.
- physicles 3y agoSerious question: what is a dependency injection framework? If I need to pass in a mock/fake for testing, then I define an interface for that dependency and pass it in as a parameter. Takes a couple minutes. Why does this need a framework?