focuses on results, not the process by using expressions and declarations rather than execution of statements.Pure functions do not modify variables, but they can return new ones. This leads to no side effects since for the same inputs we would expect the same outputs. It doesn't use shared state or mutable variables. In functional programming, instead of building new objects, we build new functions.įunctional programming is programming using pure functions. You have a set number of functions you can use to add, modify and have objects interact with each other. In OOP we try to build objects that represent, as closely as we can, the real world. I know what a function is we all do, and we use them all the time, even in OOP. Functional Programmingįirst, I had to get familiar with the concept of functional programming. I understand this will be more of a challenge than if I wanted to learn Java next (especially given my C# experience) but hopefully, the effort will pay off. However, by deciding to learn a new programming paradigm, I will diversify my skills much more and learn a totally new approach to solving problems. If I wanted to learn another OOP language, it would mainly consist of learning new syntax. Secondly, and more important to me, it's adding some new tools.
So, again, why Haskell? Functional programming has been gaining in popularity over the last couple of years, with languages like Java and Python even adopting some of the concepts from functional programming.