News Feed
Sections




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

NetTuts.com:
Functional Programming in PHP
October 04, 2013 @ 10:52:24

On NetTuts.com today they've posted an introduction to functional programming in PHP. Functional programming is a programming style that "treats computation as the evaluation of mathematical functions and avoids state and mutable data. Functional programming emphasizes functions that produce results that depend only on their inputs and not on the program state."

The new hype in programming is all about functional programming paradigms. Functional languages are used more and more in greater and better applications. Scala, Haskel, etc. are thriving and other, more conservative languages like Java started to adopt some of the functional programming paradigms (see closures in Java7 and lazy eval for lists in Java8). However, what only few people know is that PHP is quite versatile when it comes to functional programming. All the main functional programming concepts can be expressed in PHP.

The tutorial introduces some of the basics of functional programming, including terminology and the flow of the average functional application. They list some of the limitations that PHP developers might be used to (like not assigning values to normal variables) and some example code to get you started. There's also unit tests (PHPUnit) included to help you understand what the code is doing as it progresses. They also provide a more practical example - a basic auth and admin system to verify access.This tutorial is definitely not for those just learning PHP, but it's a good look into another, very different, programming style.

0 comments voice your opinion now!
functional programming tutorial introduction

Link: http://net.tutsplus.com/tutorials/php/functional-programming-in-php/

blog comments powered by Disqus

Similar Posts

The Bakery - Rails-Like Validation, Elistic, Textile, and a CakePHP Release

Juan Treminio: An introduction to Pimple and Service Containers

PHPMaster.com: Under the Hood of Yii's Component Architecture, Part 1

NetTuts.com: Zend Framework from Scratch

PHPBuilder.com: Compose a MVC Paradigm for PHP with Symfony


Community Events

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


language series example release php7 framework introduction interview configure performance laravel part2 opinion api community podcast conference application symfony2 voicesoftheelephpant

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