4 ms·
Angular is the EE of JS FX’s (inelegant and bloated), always surprised when some devs choose it over Vue, React or Svelte.
by mythz 5y ago
Angular is the EE of JS FX’s (inelegant and bloated), always surprised when some devs choose it over Vue, React or Svelte.
- throw_m239339 5y ago> Angular is the EE of JS FX’s (inelegant and bloated), always surprised when some devs choose it over Vue, React or Svelte. Cargo culting. There is absolutely no need for a IoC container with Javascript or any other dynamic language for the matter. It only ever made sense for compiled language in order to allow reconfiguration without recompilation. I say that as someone who heavily used AngularJS in the past. Angular X always seemed to me like a project looking for a problem and not the other way around, trying to justify its existence with complexity and bloat.
- Oddskar 5y agoI’ll bite. Say you have a singleton service class that needs to be accessed throughout your SPA; where would you instantiate and keep this?
- mythz 5y agoTypically you'd just export: export const singleton = new Singleton() and import it like any other symbol, e.g: import { singleton } from './providers'
- pfooti 5y agoWhat happens when that singleton has dependencies? And they have dependencies? Not unrealistic once you have a config block that sets stuff like language direction ltr/rtl or API endpoint at runtime based on test/prod env. Not saying that these are impossible, but at some point you either end up reinventing dependency injection, or you end up with all the problems that cause people to invent dependency injection.
- mythz 5y ago> What happens when that singleton has dependencies? And they have dependencies? Everyone exports/imports their deps the same way as everything else. > Not unrealistic once you have a config block that sets stuff like language direction ltr/rtl or API endpoint at runtime based on test/prod env. Having different environment config is standard feature in most JS FX Apps, if it changes at runtime it's maintained as App state with any changes typically propagated reactively. I've yet to run into any issue that I needed an IOC for in a client JS App (despite always using them for backend C# Servers) but they're unnecessary in JS, our Angular templates are the only ones that use them, all other premier JS FX's happily get by without them.
- Oddskar 5y agoSo in other words you have TERRIBLE separation of concern. This was my point exactly.
- mythz 5y agoLol, you have more freedom to logically structure your code base when you’re not beholden to forced EE abstractions. and to repay the unwanted commentary you have a bloated, overly abstracted tech-debt ridden liability that’s perfectly suited for Angular, congratz.
- SomeCollegeBro 5y agoWe use Angular for our large realtime process control application in place of a lower-level UI (like Qt). Having all of the tools you mentioned above has given us an organized codebase with components that we've been able to successfully reuse across the application itself and across different products. Having to work around "the Angular way" can be annoying sometimes, but to be honest at the same time it's nice to not have to make decisions that Angular has already made for you (routing, modules, etc)
- deleted 5y ago[deleted]
- rc_hackernews 5y agoI think it's the familiarity factor. It's pretty close to the way you'd work with C#/Java. If you were coming from that type of background, it's an easier transition. A plus, and also a minus, of Angular is that it's pretty "self-contained". There's first party tools built-in, that are maintained by Angular. You also don't have to endlessly tweak Webpack which is also a plus. That self-containment has also led to a less vibrant ecosystem in my opinion. There's more React "stuff" out there than for Angular. Also, if you're the "mythz" I think you are, just want to say I'm a big fan of ServiceStack and you do great work on it. Just wish I could work somewhere that uses it instead of primarily working with it on my personal projects. Given how the .NET community "works" though, I fear that might not happen. Conversation for another thread though. Kudos again.
- mythz 5y agoYep it me, thx for the kind words :)