• Complain

Simon Holywell - Functional programming with PHP

Here you can read online Simon Holywell - Functional programming with PHP full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Alexandria, VA, year: 2016, publisher: musketeers, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Simon Holywell Functional programming with PHP
  • Book:
    Functional programming with PHP
  • Author:
  • Publisher:
    musketeers
  • Genre:
  • Year:
    2016
  • City:
    Alexandria, VA
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Functional programming with PHP: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Functional programming with PHP" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

musketeers.me

Simon Holywell: author's other books


Who wrote Functional programming with PHP? Find out the surname, the name of the author of the book and a list of all author's works by series.

Functional programming with PHP — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Functional programming with PHP" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Functional Programming with PHP Simon Holywell October 2016 Functional - photo 1
Functional Programming with PHP
Simon Holywell

October 2016

Functional Programming with PHP
Dedication

For Marion, Damien, and Ariana.

Ngiyakuthanda! Ngiyabonga ntombenhle!

About the Author

Simon Holywell is a Senior Software Engineer at Aurion in Brisbane, Australia (http://aurion.com) and is passionate about web application development and motorcycles. His first public project was written with PHP 3, and since then, he has worked with every version of PHP and dabbled in Python, Scala, C, JavaScript, and more. He is also the author of of SQLStyle.guide and the ssdeep extensions for PHPs PECL, Facebooks HipHop Virtual Machine (HHVM), and MySQL.

Blog: https://www.simonholywell.com
Twitter: @Treffynnon http://twitter.com/Treffynnon

Acknowledgements

Functional programming has become more and more popular in recent years because it promotes code thats safe, concise, and elegant.

Martin Odersky (Computer scientist and Scala programming language, @odersky )

Many very supportive people were involved in the production of this book, and I would like to thank them for their keen insights and guidance. They helped me to take it from an idea to a fully-fledged book.

In particular, I would like to thank Beth Tucker Long who has been instrumental in bringing you this book right from the earliest of stages.

I also appreciate those who helped me formulate ideas and reviewed early draftsespecially Craig Bendell and Jamie Matthews.

To technical reviewers Oscar Merida and Koen van Urk, layout and diagram wrangler Kevin Bruce, Eli White, and Lori Ann Pannier for their contributions.

0.1 Cover Design

I worked through the concept for the front cover of the book and Kevin Bruce interpreted it into the clean design you see. Just what does it mean though?

For sometime now PHP has been associated with an elephant emblem. First designed by Vincent Pontier (a designer from France) it has been used by many to signify the PHP programming language. Some of the more well known uses are as plush toys and as the logo of the long standing PHP Classes site.

Whilst a friend walked Vincent through the possibilities of PHP in late 1998 he doodled with the letters PHP on a piece of paper. Turning the paper sideways he noticed that the letters sort of formed a stylised outline of an elephant. Squint your eyes and you can probably see it too.

He would later create a clay model as a basis for the plush toys and gave them the name elephpant (note the extra P in the middle). For more information on the creation of the elephpants you should see the interview Khayrattee Wasseem conducted with Vincent on his site 7php.com.

To demonstrate this books functional underpinnings the elephant is included inside parenthesis. The opening and closing parenthesis are shorthand for a function.

So in reality the cover image is a functional elephant.

If the existence of a plush toy piqued your interest then you can buy them directly from the original designer. Many conferences, user groups and companies also create their own versions under licence.

It is worth pointing out that this is not an officially recognised emblem of PHP and indeed Postgresql use the pachyderm for their own logo albeit designed from a different angle. There have been numerous discussions about adopting the elephpant with Rasmus Lerdof having liked the idea in the past according to online gossip. It once even featured on the php.net logo download page.


Introduction

I am in much dismay at having got into so amazing a quagmire & botheration[]

Ada Lovelace (Mathematician, 18151852) discussing mutability with Charles Babbage (created first concept of a programmable computer, 17911871)

Over the course of the past twenty years or so, functional programming has seen a slow and steady growth. This has led to many languages adopting functional aspects, including the much-maligned PHP. As computer hardware and language support improves, it is important to begin learning the basics of functional programming. While it is true programming in this style requires a change in thinking, you will find some understanding of it has a positive impact on your object-oriented code as well.

Let us begin our journey through the functional aspects of the PHP language.

1.1 Prerequisites

You must have access to PHP version 5.4 or greater and command line access to the machine in question is incredibly beneficial. When writing, I used a Debian-based machine, and a similar POSIX computer is recommended, although not required.

One of the best things you can do while learning is to install a decent REPL on your machine as it will make it much easier to experiment with code as you follow along. REPL stands for read-eval-print loop, and its basically a programming environment most commonly used on the command line. It allows you to try out algorithms easily without the need for an editor or even files to contain your code. Type code into it, hit return, and your code is executed with the result printed on screen.

There are a number of good REPLs out there, and I have had success with PsySH.

If you do not wish to install a REPL on your machine, you could use the online service 3V4L but beware, of course, you will not have access to install extensions or libraries. This would only become a problem for you later on, however, as in the initial stages, we will be reviewing native language features.

As we progress through more functional programming in PHP, I will suggest useful PHP libraries and extensions. These are either installed via Composer for extensions. If you are not already familiar with these, then it may pay to review them before continuing.

It goes without saying this book is not aimed at beginner PHP developers and some object-oriented experience is assumed. Having said that, of course, this is as gentle of an introduction as possible and represents a beginner guide to functional programming in PHP.

1.2 Requirements
PHP
  • PHP 5.4+ (for some libraries, a later version might be required)
Other Software:
  • Dependency management: Composer
  • Extension/Library: functional-php
  • Library: React/Partial
  • Library: nicmart/Functionals
1.3 For Users of Older PHP Versions

It is certainly possible to write functional code and work through most of this book while using PHP 5.3.2 or greaterthe first edition of this book was in fact written in PHP compatible with 5.3.2. There are a few things you may have to adapt in your code though, to ensure you dont access features that do not exist in the version of PHP you have installed.

Short array syntax will almost undoubtedly be the first syntax difference you will come across and fortunately it is very easy to adapt for usage on older versions of PHP. Short array syntax looks like the following sample:

$short_array = [ , , , , , , , , , ];

Implemented in PHP versions less than 5.4 it would simply be converted to the following code:

$standard_array = array ( , , , , , , , , , );
1.4 Installing

Some of the chapters in this book will require you to install additional software before you can continue with the samples provided. This is reasonably easy although it does warrant some coverage here. Of these additional utilities some will be runtimes, others libraries and extensions.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Functional programming with PHP»

Look at similar books to Functional programming with PHP. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Functional programming with PHP»

Discussion, reviews of the book Functional programming with PHP and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.