3 ms·
> Functional programing is different. I think the problem with this line of thinking is that some people insist on using functional tactics EVERYWHERE, even wh
by 2h 3y ago
> Functional programing is different.
I think the problem with this line of thinking is that some people insist on using functional tactics EVERYWHERE, even when it doesn't make sense. I get that its ugly to mix functional and imperative code, and maybe some languages dont even allow that. but they should. thats why I like Go, because sometimes a simple for/while loop IS the correct answer.
- xupybd 3y agoYes I think the The Functional Core, Imperative Shell Pattern is a good way to do things. But somethings take a bit of ramping up. Like the option type, it is great and works well with pattern matching. If you don't know why exhaustive pattern matching with union types and options instead of nulls is amazing then it just feels like coding with your hands tied.
- epgui 3y ago> some people insist on using functional tactics EVERYWHERE It’s difficult to relate to this without specific examples (I don’t think I agree with the sentiment on balance, but I could also imagine all kinds of obviously-bad things), but FP really does transcend other programming paradigms. Languages such as Java and C++ code definitely do benefit from FP approaches, even if these languages are perhaps not the best at facilitating the approach.
- chromoblob 3y agoLoops aren't inherently imperative or functional, they can be easily expressed in both imperative and functional paradigms, with or without side effects. Although using map (loops without dependencies between iterations) is more easily parallelizable.
- physPop 3y agoThats exactly why f# is so nice, not forced into functional everywhere