4 ms·
Something that's come to light for me recently and which I'm trying to understand the reasoning for, is bringing OOP patterns like singletons, dependency inject
by _bxg1 6y ago
Something that's come to light for me recently and which I'm trying to understand the reasoning for, is bringing OOP patterns like singletons, dependency injection, visitors, etc. over to a multi-paradigm language like JavaScript. My understanding is that these were all basically clever hacks for working FP and procedural concepts into a strictly OOP language (plain module-level state, closures, and plain functions/pattern-matching, respectively). But you can get the same advantages without jumping through any of those hoops in JS and the like. Are they getting brought over purely as a comfort-blanket to Java/C# devs or is there something I'm missing?
- k__ 6y agoNever understood this either. But when I see how TypeScript looks like JS+C# it feels like OOP people just can't help themselves
- _bxg1 6y agoIt really doesn't have to though. TypeScript can look like C# or it can look like Haskell, or it can be one in some places and the other in other places. This is my favorite property of [JT]S. You can simply use the best tool for the task at hand.
- deleted 6y ago[deleted]