Becoming Functional by Joshua Backfield

By Joshua Backfield

If you could have an relevant (and most likely object-oriented) programming history, this hands-on booklet will advisor you thru the alien international of sensible programming. writer Joshua Backfield starts off slowly by way of exhibiting you the way to use the main important implementation suggestions earlier than taking you additional into functional-style strategies and practices.

In each one bankruptcy, you’ll research a practical thought after which use it to refactor the fictitious XXY company’s imperative-style legacy code, writing and trying out the useful code your self. As you move throughout the ebook, you’ll migrate from Java 7 to Groovy and at last to Scala because the want for larger useful language aid progressively increases.

study why today’s finely tuned purposes paintings higher with sensible code
rework imperative-style styles into sensible code, following easy steps
wake up to hurry with Groovy and Scala via examples
know the way top quality services are handed and back from different functions
Convert current tools into natural services, and loops into recursive methods
switch mutable variables into immutable variables
Get hands-on event with statements and nonstrict evaluations
Use practical programming along object-oriented design

Show description

Read or Download Becoming Functional PDF

Best technology books

Innovation and Visualization: Trajectories, Strategies, and Myths (Consciousness, Literature and the Arts, Volume 1)

Amy Ione's Innovation and Visualization is the 1st intimately account that relates the advance of visible photographs to suggestions in paintings, conversation, medical learn, and technological improve. built-in case reports let Ione to place apart C. P. Snow's "two culture" framework in desire of cross-disciplinary examples that refute the science/humanities dichotomy.

Recent Advances in Textile Composites: Proceedings of the 10th International Conference on Textile Composites

· New examine on nanofibers, preforms, complex braiding, multifunctional composites · helpful layout details and knowledge for all levels of fabric composites improvement · Multiscale research, harm prediction, ballistics checking out, mechanical layout · Civil and armed forces, structural and load-bearing functions -------------------------------------------------------------------------------- This 578-page ebook is an unique and demanding number of over sixty five by no means formerly released investigations within the fast-growing fabrics technological know-how box of fabric composites.

Baukonstruktionslehre: Ein Nachschlagewerk für den Bauschaffenden über Konstruktionssysteme, Bauteile und Bauarten

Nach mehr als 20 Jahren liegt das Nachschlagewerk zur Baukonstruktion von Martin Mittag wieder in einer völlig überarbeiteten und auf den neuesten technischen Wissensstand gebrachten Auflage vor. Zahlreiche detaillierte Zeichnungen geben eine Übersicht über das um-fangreiche Gebiet der Baukonstruktionen.

Additional resources for Becoming Functional

Example text

It also became much easier for us to add new functionality Conclusion | 23 because we no longer had to copy and paste things like our for loops or other pieces that we extracted into our higher-order function getField. You don’t always need 10 functions to cover every possible use case in the future. Of course, if getEnabledCustomerNames were to happen 5 or 10 times, it might make sense to create the function itself and make it a call to be done such that people aren’t dupli‐ cating that code. Many of these abstractions, such as our Function1, are already defined in libraries like Guava.

Address; } }); } Go ahead and see if you can refactor the rest of the functions; when you’re done, check out Example 2-14 and see how they compare. Example 2-14. call(customer)); } } return outList; } } Your boss is excited by how great a job you’re doing, but he now needs a new piece of functionality. He needs to have his email prepended to the domain of each Customer. As with most strange requests, you just kind of stare blankly at him for a moment and then agree to carry it out. com, which is already defined in the Customer object.

This was probably not what the author intended, so he fixes it by using a mutable object containing the reference he wants to change. Let’s see this in action in Example 4-3. Example 4-3. str did. This looks like it’s a fairly standard mutation of an object, but let’s think about this in another light. str has changed over time? We’ll need to debug to find out that func is indeed changing our variable. ” Immutability gives us the confidence that our variables will not be changing and that our objects will be the same no matter to which function we send them.

Download PDF sample

Rated 4.00 of 5 – based on 35 votes