News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Script-Tutorials.com:
Functional Programming - How to Write Functional Code in PHP
May 09, 2013 @ 11:04:26

On the Script-Tutorial.com site today there's a new post looking at functional programming in PHP - some of the concepts involved and example code showing how to make it work.

Functional programming can be defined in simple terms as a programming paradigm that do not change the state of a program instead it uses pure functions. A pure function is a function that has the ability to accept a value and return another value without changing the input supplied to it. It is characterized by its ability to support functions that are of high order. [...] A programming paradigm that is functional has the following attributes: do not alter the states which make parallelism easier, deals mostly with a function which is the smallest unit hence enhances readability of code, has deterministic functions that enable stability of a program.

He talks some about anonymous/lambda functions (closures) and their role in PHP's implementation of functional programming. He also talks some about partial functions, currying, higher order functions and recursion. He finishes off the article with a look at some of the advantages this method of development can bring as well as some of the disadvantages that come with things like recursion and the learning curve of the method.

0 comments voice your opinion now!
functional programming tutorial introduction concepts examples

Link: http://www.script-tutorials.com/functional-programming-php

blog comments powered by Disqus

Similar Posts

NetTuts.com: How to Create a PyroCMS Theme

Sameer Borate's Blog: Functional programming with Underscore.php

Marcelo Gornstein's Blog: Advanced telephony applications with PHP and PAGI using call flow nodes

SitePoint PHP Blog: Responsive Images Using Picturefill and PHP

PHPMaster.com: Mapping with Geocoder PHP and Leaflet.js


Community Events





Don't see your event here?
Let us know!


release framework language series list laravel project developer code podcast introduction community bugfix interview api application library threedevsandamaybe configure wordpress

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework