3 ms·
It really comes down to finding the right balance and using your tools effectively. I worked at a place at was super OO heavy, multi-layer inheritance, gang-of-
by frfl 3y ago
It really comes down to finding the right balance and using your tools effectively. I worked at a place at was super OO heavy, multi-layer inheritance, gang-of-4 type OO patterns. And another place that was writing code in a functional manner, little to no classes unless necessary, using FP patterns in the codebase.
Both were codebases were TypeScript. I think I was more effective in the second, FP, codebase than the first. But really it's more about finding the right balance. One of the flaws in either approach is you try to fit a paradigm forcefully: trying to write Java in JS/TS or trying to write Haskell in JS/TS. The TS code will be better if you understand and accept the JS/TS paradigm and apply patterns where they fit elegantly.
- claytongulick 3y agoI agree with this. I don't think it makes sense to be "oop" or "fp". Different problems have characteristics that lend themselves to different techniques. Difficult code based come from purists who value theory over practicality. I have a very strongly enforced "don't be clever" rule for teams I manage. Code should read like a story, good code reduces congnitive load. I've seen some chains of map, reduce, filter, etc... written by FP purists that are difficult to decipher. Good code is a love letter to the next developer.