FUNCTIONAL PROGRAMMING IN C++14
Main Article Content
Article Sidebar
Abstract
Although all programmers familiar with the C++ computer programming language will unanimously agree that the language is a multi-paradigm language, not many are aware that it sufficiently supports writing programs in the functional style or logic style.
One of the tragic consequences of lack of this knowledge is that there are few computer programming lecturers in our universities who can teach functional programming. A typical programming lecturer (familiar with C++) assumes that to teach functional programming, one must learn a language specifically designed for functional programming (such as ML and Haskell) and very few are ever eager to learn a new language from scratch. This may explain why most of our universities don’t have functional programming in their curriculum or if it is there, then it is an elective course that is rarely if ever taught.
In this paper, I highlight C++ language’s support for the functional programming style. I explore some functional programming concepts and illustrate how each can be accomplished in C++. It is my hope that this paper will bring back this beautiful paradigm into our universities’ curricula. I also hope that those who use the other paradigms of C++ for example in software development will realize that they can also write most of the code using the functional style.
Article Details
COPYRIGHT AGREEMENT AND AUTHORSHIP RESPONSIBILITY
 All paper submissions must carry the following duly signed by all the authors:
“I certify that I have participated sufficiently in the conception and design of this work and the analysis of the data (wherever applicable), as well as the writing of the manuscript, to take public responsibility for it. I believe the manuscript represents valid work. I have reviewed the final version of the manuscript and approve it for publication. Neither has the manuscript nor one with substantially similar content under my authorship been published nor is being considered for publication elsewhere, except as described in an attachment. Furthermore I attest that I shall produce the data upon which the manuscript is based for examination by the editors or their assignees, if requested.â€