4 ms·
Wow. So many aspects that I've attempted (and failed) to communicate to OOP devs in a clear, understandable presentation format. I've been working with Angular
by EvanPlaice 11y ago
Wow. So many aspects that I've attempted (and failed) to communicate to OOP devs in a clear, understandable presentation format.
I've been working with Angular2 a lot lately and it's has been painfully obvious how much effort they've put in to make the framework appeal to devs with an OOP mindset.
God object? Yep, they use a directed acyclic graph for to manage dirty checking. Global state management via singletons? See services. Factory pattern? See providers. Static typing with type coercion, interfaces, and class based inheritance? See Typescript. Etc...
They have effectively reimplemented every single common design pattern used in OOP, in Javascript. A language that fundamentally doesn't require OOP patterns to provide the same degree of flexibility and functionality.
It gets really 'weird' when they encounter aspects that can't effectively be defined using OOP alone, such as async data binding. Instead they use functional programming patterns such as observables/promises.
Personally, I prefer to write NG2 code in ES6. Types in Javascript are nothing more than window dressing to make the transition less painful for OOP devs and enable better autocompletion support in IDEs.
In practice, type checking during runtime will have to be disabled because it causes a significant negative impact on performance.
TBH. It feels kinda 'dirty'. Like I'm some OOP addict (ie C# dev in the past) who is dabbling with old habits.