• Complain

Ben Weidig - A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles

Here you can read online Ben Weidig - A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2023, publisher: OReilly Media, 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.

Ben Weidig A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles
  • Book:
    A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles
  • Author:
  • Publisher:
    OReilly Media
  • Genre:
  • Year:
    2023
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Java developers usually tackle the complexity of software development through object-oriented programming (OOP). But not every problem is a good match for OOP. The functional programming (FP) paradigm offers you another approach to solving problems, and Java provides easy-to-grasp FP tools such as lambdas and streams. If youre interested in applying FP concepts to your Java code, this book is for you.

Author Ben Weidig highlights different aspects of functional programming and shows you how to incorporate them in your code without going fully functional. Youll learn how, when, and why to use FP concepts such as immutability and pure functions to write more concise, reasonable, and future-proof code. Many developers seek to expand their horizons by using OOP and FP together. Its no longer either-or; its both.

In two parts, this book includes:

  • A Functional Approach: Get a high-level overview of functional programming, including the types already available to Java developers. Then explore different FP concepts and learn how to use them.
  • Real-World Problems, Patterns, and Recipes: Apply what youve learned in part one to the typical real-world problems you might encounter in your daily work.

Ben Weidig: author's other books


Who wrote A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles? Find out the surname, the name of the author of the book and a list of all author's works by series.

A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles — 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 "A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles" 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
A Functional Approach to Java by Ben Weidig Copyright 2023 Benjamin Weidig - photo 1
A Functional Approach to Java

by Ben Weidig

Copyright 2023 Benjamin Weidig. All rights reserved.

Printed in the United States of America.

Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.

OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com .

  • Editors: Rita Fernando and Suzanne McQuade
  • Production Editor: Ashley Stussy
  • Interior Designer: David Futato
  • Cover Designer: Karen Montgomery
  • Illustrator: Kate Dullea
  • September 2022: First Edition
Revision History for the Early Release
  • 2021-08-26: First Release
  • 2021-01-18: Second Release
  • 2021-03-29: Third Release
  • 2022-05-17: Fourth Release

See http://oreilly.com/catalog/errata.csp?isbn=9781098109929 for release details.

The OReilly logo is a registered trademark of OReilly Media, Inc. A Functional Approach to Java, the cover image, and related trade dress are trademarks of OReilly Media, Inc.

The views expressed in this work are those of the author, and do not represent the publishers views. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.

978-1-098-10985-1

Preface

A mind that is stretched by a new experience can never go back to its old dimensions.

Oliver Wendell Holmes Jr.

Developing software can be quite a complex endeavor.As Java developers, we usually try to tame this complexity with object-oriented programming (OOP) and an imperative coding style.But not every problem is a good match for an object-oriented coding style.We end up introducing even more complexity by not solving problems with the best tools and paradigms available to us.The functional programming (FP) paradigm offers another approach to solving problems.

After spending its early life hidden away in academia and niches, functional programming is on the rise again and becoming more mainstream.The ideas and concepts behind it are adopted in almost every multi-paradigm and general-purpose language, allowing us to use some form of functional programming regardless of the context.And its not a surprising trend.

New Hardware Needs a New Way of Thinking

Our hardware is evolving in a new direction.Moores lawcoined in 1965 as the observation of transistor counts doubling every two years, and therefore the performance per core available to usseems to slow down.Thats why modern workloads need new ways to reap all the benefits such new hardware offers: parallelism.

Concurrency Versus Parallelism

Concurrency and parallelism are often confused with each other or seen as the same thing.The Merriam-Webster dictionary even defines them quite similar:

Concurrence

The simultaneous occurrence of events or circumstances.

Parallel

An arrangement or state that permits several operations or tasks to be performed simultaneously rather than consecutively.

But in computer science, the terms express two different concepts.

Concurrency allows multiple threads to make progress simultaneously on the same CPU core.The threads need to be coordinated and interrupted to get their work done.Think of it like a juggler using only one hand (single CPU core) with multiple balls (threads). They can only hold a single ball at any time (doing the work), but which ball changes over time (interrupting and switching to another thread).Even with only two balls, they have to juggle the workload.

Parallelism is about running multiple tasks at literally the same time, like on multiple CPU cores.The juggler now uses both hands (more than one CPU core) to hold two balls at once (doing the work simultaneously).If there are only two balls in total, they can hold both at the same time.

These concepts arent mutually exclusive and are often used together.

Scaling your software horizontally through parallelism isnt an easy task in OOP.Not every problem is a good fit for parallelism.More painters might paint a room faster, but you cant speed up pregnancy by involving more people.If the problem consists of serial or interdependent tasks, concurrency is preferable to parallelism.

But if a problem can be broken down into smaller, non-related sub-problems, parallelism really shines.And the stateless and immutable nature of idiomatic FP provides all the tools necessary to build small, reusable tasks to be easily used in parallel environments.Thats just one of many benefits of a more functional approach to your daily development problems.

Why Java?

There are many programming languages to choose from when you want to start with functional programming.Haskell is a favorite if you prefer a pure functional language with almost no support for an imperative coding style.But you dont have to leave the JVM ecosystem behind to find FP-capable languages.Scala shines in combining OOP and FP paradigms into a concise, high-level language.Another popular choice, Clojure, was designed as a functional language with a dynamic type system at heart.But sometimes, you wont have the luxury of choosing the language for your project or problem, and youll have to play the cards youre dealt, and youll need to use Java.

Even though you can implement most functional principles in Java regardless of deeply integrated language level support, your code wont be as concise and easy to reason with as it would in other languages.And without such support, many developers didnt bother to embrace these principles, even if they could have provided a more productive approach or better overall solution.

In the past, many people thought of Java as a slow-moving behemoth, a too big to become extinct enterprise language, like a more modern version of COBOL or FORTRAN.And in my opinion, thats partially true.The pace didnt pick up until Java 9 and the shortened release timeframes, none of them were ground-breaking.The few and slow changes in the past led to projects and developers not adopting the latest and greatest Java Development Kit (JDK), missing out on many language improvements.Three years later, in 2014, the next version, Java 8, was released.But this time, it introduced one of the most significant changes to Javas future: lambda expressions.

A better foundation for functional programming had finally arrived in arguably the most prominent object-oriented programming language of the world, changing the language and its idioms significantly:

Runnablerunnable=()->System.out.println("hello, functional world!");
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles»

Look at similar books to A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles. 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 «A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles»

Discussion, reviews of the book A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles 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.