Initial Idea one: Functional programming

Functional programming


This post will cover the core concept of functional programming. Functions are fundamental to code organization and exist in all higher-order programming languages. Functional programming means using functions with the best effect to create software that is clean and easy to maintain. Functional programming is a collection of coding approaches described as the programming paradigm. Functional programming offers benefits in certain cases and is used in many languages ​​and frameworks and is visible in current software trends. It is a useful and powerful tool that should be part of any developer toolkit.(Hartmann, 2018)

 

Pure functions

A pure function is one whose results depend only on input parameters. The beauty of pure function lies in architectural simplicity. Because a pure function is reduced to only the arguments and return value. Its operation does not initiate any side effects. It has no external influence except for the value it returns. (Hartmann, 2018)








First-class functions

Beyond a pure function, we have first-class functions, these are functions that are treated as 'the thing in itself. First-class functions can be described as data. This means that a first-class function can be assigned to a variable. For example, when you write '' let myFunc = Function () {} "you are using the function as data.(Hartmann, 2018)

 


 

 




Higher-order functions

Higher order functions are a function that accepts another function as an argument or returns another function. A higher-order function is a function that operates upon functions. (Tyson, 2021)  The benefits of using higher-order functions include the simplicity of the code, allowing the programmer to easily understand the code at a high level, and writing the code becomes less time-consuming as the process of debugging the code becomes easier and faster.








The usefulness coming out of using functional programming concept is the ability to write more readable, faster and lessen the number of errors in code. Which will contribute to the better work of the whole program.






Reference

Hartmann, M, & Shevchenko, 2018, Professional Scala : Combine Object-Oriented and Functional Programming to Build High-performance Applications, Packt Publishing, Limited, Birmingham. Available from: ProQuest Ebook Central, [4 November 2022].

Tyson, M. (2021). What is functional programming? A practical guide. InfoWorld.Com, Retrieved from https://www.proquest.com/trade-journals/what-is-functional-programming-practical-guide/docview/2507805883/se-2, [4 November 2022].




Comments

Post a Comment

Popular posts from this blog

Software and Hardware skills