• Complain

Aley - Pro Functional PHP Programming Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity

Here you can read online Aley - Pro Functional PHP Programming Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Berkeley;CA;New York, year: 2018;2017, publisher: Apress, genre: Home and family. 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.

Aley Pro Functional PHP Programming Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity
  • Book:
    Pro Functional PHP Programming Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity
  • Author:
  • Publisher:
    Apress
  • Genre:
  • Year:
    2018;2017
  • City:
    Berkeley;CA;New York
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Pro Functional PHP Programming Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Pro Functional PHP Programming Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Aley: author's other books


Who wrote Pro Functional PHP Programming Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity? Find out the surname, the name of the author of the book and a list of all author's works by series.

Pro Functional PHP Programming Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity — 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 "Pro Functional PHP Programming Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity" 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
Part I
Functional Programming in PHP 7
Rob Aley 2017
Rob Aley Pro Functional PHP Programming
1. Introduction
Rob Aley 1
(1)
Oxford, UK
Functional programming isnt something that is often associated with PHP. Yet for quite a while PHP has had all the features necessary to create software using the functional paradigm. In this book, youll take a look at what functional programming is, how to do it in PHP, and the different ways in which you can use it to improve your PHP software.
Who Is This Book For?
This book isnt an introduction to PHP itself; it assumes you have some basic (or, indeed, advanced) experience in PHP scripting. You dont need to be an expert to follow along; Ill cover all the key concepts in PHP youll need to know to be able to implement functional designs in your code and point you in the direction of resources such as web sites and other books that you can use to learn or investigate any related concepts that I dont cover directly.
Absolute PHP beginners aside, this book is suitable for all programmers. Whether you have a pressing need to learn functional programming (perhaps youve taken over a functional PHP code base) or you are just interested in finding out what the buzz around functional programming is all about, there is something in this book for you. Theres even likely to be something for those skeptical about creating software using the functional programming paradigm. I think that most programmers will find useful lessons and code patterns to take away from the functional programming style that will enhance their object-oriented or procedural programming work. If all else fails, knowledge of functional programming looks good on your rsum!
What Is Functional Programming ?
Functional programming is a declarative programming paradigm that abstracts code into pure, immutable, side-effect-free functions, allowing the programmer to compose such functions together to make programs that are easy to reason about.
That is my definition of functional programming. Ask five other functional programmers to define functional programming and youll get four more answers (two just copied the same answer from Wikipedia). Theres no standard definition; different people and different programming languages implement functional programming elements differently. These differences are partly because of the practicalities of the language in question and sometimes because of the target platforms, data, and usage scenarios, but often they come down to what I call programming religion: a fixed, sometimes irrational, but often deeply held belief of how a particular paradigm should be . Even within the small community of PHP functional programmers, you wont find an exact consensus. In PHP, functional programming is not a core concept, but even in languages where it is (e.g., Lisp, Scala, etc.), there are many related understandings of what constitutes true functional programming. While that may sound problematic, youll still know it when you see it, and when it gets woolly around the edges, you can choose to define it in any way you see fit!
PHP isnt a pure functional programming language, but you can still use it for functional programming (which is good; otherwise this book wouldnt be very long). A few elements of what some purists consider to be essential functional programming concepts are harder to implement with PHPs standard syntax, so its perhaps slightly more accurate to say that you can program in a functional programming style in PHP.
Lets now look a little more in depth at what functional programming actually is in practice. Functional programming is a declarative style of programming, which means you specify what you want it to do rather than how you want to do it. Its a higher level of abstraction than you may be used to with OO or procedural programming. However, you almost certainly use declarative programming on a day-to-day basis when using SQL, HTML, regular expressions, and similar languages. Consider the SQL snippet shown in Listing .
SELECT forename,
Surname
FROM users
WHERE username = 'rob'
AND password = 'password1';
Listing 1-1.
declarative.sql
This is telling your database server what you want it to do (select the real name based on super-secret security credentials), but you dont tell it how to do it. You dont tell it the following:
  • Where to look on disk for the data
  • How to parse or search the data for matching records
  • How to determine whether a record matches your criteria
  • How to extract the relevant fields from the record
And so on. You simply tell it what you want it to achieve for you.
Now obviously, at some point, you need to tell the computer how to do something. With the SQL example in Listing , you do that by getting some rather clever people to write database management software (DBMS) for you. In functional programming, youll tend to need to write the implementation code yourself, but to make it a manageable task, you break that down into the smallest possible chunks and then use a hierarchical chain of declarative function calls to tell the computer what to do with that code. If you use the Composer dependency management system, you will already be using a similar paradigm: there are many libraries of code available that abstract away the tasks that you need to do; you simply compose a list of libraries together to do what you want. In functional programming, you do exactly the same; you take functions that do something (like the libraries Composer provides) and compose them together into a program.
Having a program that is essentially a list of what you want to achieve sounds very good on paper, and indeed it makes it easy to understand and reason about your program. To make the idea a little more concrete, lets take a look at a small functional-style program (Listing ).
Rob Aley 2017
Rob Aley Pro Functional PHP Programming
2. Functional Programming: Key Concepts
Rob Aley 1
(1)
Oxford, UK
In this chapter, youll look at the key concepts, building blocks, and vocabulary that youll need to understand before getting started on some actual functional programming. Although you are already likely to be using functions and closures in your everyday programming, its worth taking the time to read the following sections that describe them from first principles as some of the details that you take for granted when using them in object-oriented or plain procedural programming can trip you up when applying them in the functional paradigm. As functional programming is rooted in math, youll also take a look some language that you may be unfamiliar with and see it in terms that are easy to understand for a regular programmer.
The concepts presented in this chapter, taken individually, may paint a confusing picture about what functional programming is and what benefits it can bring. For instance, Ill talk about immutability, which is essentially the inability to change a value. That seems like a drawback at first rather than a benefit, but when you draw all of these concepts together over the next couple of chapters, you will see that immutability plays a key part in the flexible recipe-like nature of functional programming and is one of the factors that allows you to easily reason about your functional code.
So, for now, try to focus on understanding the individual concepts as presented and dont worry too much about how they all fit together. Learning functional programming is much like writing functional programming codelots of small independent functions/ideas composed into an over-arching scheme that eventually does something!
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Pro Functional PHP Programming Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity»

Look at similar books to Pro Functional PHP Programming Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity. 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 «Pro Functional PHP Programming Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity»

Discussion, reviews of the book Pro Functional PHP Programming Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity 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.