4 ms·
I love the way the author explained it. And surely there are places where functional programming helps eg. linear processing of data, analysis, processing. Howe
by tomaszs 6y ago
I love the way the author explained it. And surely there are places where functional programming helps eg. linear processing of data, analysis, processing. However in my field, frontend, there is more focus on interactions between very short factory lines. So functional programming does not shine, and often just leads to increased complexity and risk of mistakes.
- revskill 6y agoThen you can try React Hook
- munk-a 6y agoWriting in a purely functional style isn't suited for any real world problems, functional programming remains a tool to be used like any other. However functional style programming comes with some seriously valuable effects that make it quite strong in the right situations. Front-end code tends to do a whole lot of mapping and filtering and being able to define stateless functions to execute these jobs can seriously reduce the amount of bugs you're likely going to accumulate over time. I love programming in a variety of paradigms and settings and I'd suggest you take a bit of a closer look at what you can get out of statelessness and higher order functions in particular. Assuming you're working in a pure JS variant and not a strongly typed FE language (like Elm or TypeScript) my absolute favorite quality (strict typing) isn't available, but there are a lot of tools that can be quite helpful.
- tomaszs 6y agoSure. FP is helpful a little bit with some atomic operations, and processing data from data sources. However applying it to the whole project as the primary paradigm causes a lot of trouble. Purity comes with some serious drawbacks like desynchronising state risk, additional performance cost, risk of adding unnecessary complexity, code duplication and wrong code organisation. Especially if it is considered as a competitor to object oriented programming. Unfortunately it is considered that way, and it is really a serious problem today. People try to do stuff with FP that should be done with OOP and run into serious problems. OOP and FP paradigms work good together, but FP is often overused.