Download PDF by Joshua Backfield: Becoming Functional: Steps for Transforming Into a

By Joshua Backfield

ISBN-10: 1449368174

ISBN-13: 9781449368173

When you've got an critical (and most likely object-oriented) programming heritage, this hands-on publication will advisor you thru the alien international of sensible programming. writer Joshua Backfield starts slowly by means of exhibiting you the way to use the main valuable implementation suggestions sooner than taking you additional into functional-style suggestions and practices. In every one bankruptcy, you are going to study a practical thought after which use it to refactor the fictitious XXY company's imperative-style legacy code, writing and checking out the practical code your self. As you move during the ebook, you are going to migrate from Java 7 to Groovy and at last to Scala because the want for greater useful language help steadily raises.

Show description

Read Online or Download Becoming Functional: Steps for Transforming Into a Functional Programmer PDF

Similar object-oriented software design books

Get The Ruby Way, Second Edition: Solutions and Techniques in PDF

Ruby is an agile object-oriented language, borrowing the very best good points from LISP, Smalltalk, Perl, CLU, and different languages. Its acceptance has grown enormously within the 5 years because the first variation of this e-book.   The Ruby manner takes a “how-to” method of Ruby programming with the majority of the fabric including greater than four hundred examples prepared by way of subject.

Frank Buschmann's Pattern-Oriented Software Architecture Volume 4 A Pattern PDF

The eagerly awaited Pattern-Oriented software program structure (POSA) quantity four is set a trend language for dispensed computing. The authors will consultant you thru the simplest practices and introduce you to key components of establishing allotted software program platforms. POSA four connects many stand-alone styles, trend collections and development languages from the present physique of literature present in the POSA sequence.

New PDF release: Java 9 Revealed for early Adoption and Migration

Discover the recent Java nine modules, SDK, JDK, JVM, JShell and extra during this complete booklet that covers what’s new in Java nine and the way to take advantage of those new positive factors. Java nine published is for knowledgeable Java programmers trying to migrate to Java nine.  Author Kishori Sharan starts by way of overlaying tips to strengthen Java purposes utilizing the recent module process brought in Java nine and the way to exploit the JShell device in Java nine for prototyping, compiling and trying out.

Extra resources for Becoming Functional: Steps for Transforming Into a Functional Programmer

Sample text

In our examples, we made our new code functional and then went back and migrated our pre-existing code to the functional style. You should always remember that any time is a good time to make code more functional. We took a little extra time to refactor our copy-and-paste code into a higher-order function that iterated over our list of customers. After that, we refactored the inner workings of our copy-and-paste code into simple, anonymous functions and even used a closure in case our boss ever wants to extend the functionality of the prepending email addresses.

In the simplest explanation, the body references a variable that doesn’t exist in either the body or the parameter list. Your boss’s request to prepend his email onto customer domains seems like a really simple function to write. domain; } }); } But wait—what happens if the president of XXY comes to you and says, “I want my email prepended to the customer domains”? The first idea that comes to you is to copy and paste the function and update it with “president@”. This violates the DRY principle, however, so you should reconsider this approach.

However, sometimes you don’t need to go to that extreme. Let’s look at Example 3-23, in which we’ll refactor our getField method and instead of passing in the test function, we’ll pass in a prefiltered list. That is a good purification, but let’s not use the static DisabledCustomers object we created; instead, we’ll create a new Function1 with which to perform the filter. Upon trying to purify the function, notice that we’re now creating a new Function1 object for every call to getDisabledCustomerNames.

Download PDF sample

Becoming Functional: Steps for Transforming Into a Functional Programmer by Joshua Backfield

by Steven

Rated 4.90 of 5 – based on 43 votes