2013年2月26日星期二

PHPMaster.com: Functional Programming and PHP


On PHPMaster.com today there's a new tutorial written up by Shameer C looking at functional programming with PHP - some of the basic concepts of it and how much is possible in the language.



Many programmer like to talk about functional programming, but if you ask them if they've ever done it, most of their replies will be "No". The reason is quite simple: we are taught to think in an imperative manner when we first start learning to program, in terms of flow charts and steps to be followed in the program. So in this article I'll explain some important concepts to functional programming and how to write functional code in PHP.


He starts by defining some of the basic fundamental concepts of functional programming including recursion, referential transparency, higher order functions and lambda functions. He includes a bit of code along the way, showing things a bit more practically.

没有评论:

发表评论