v0.3.0-SNAPSHOT
Juan Antonio Breña Moral (40) Chapter Lead, Deejay & Mindstorms/STEAM teacher. Twitter | Github | Linkedin |
|
Purpose: "Riding dragons with innovation & fun" | |
Quote: "Pressure makes diamonds." - George S. Patton Jr. |
“Production is the best place on the Internet.”
I wish the audience could:
Is Java, a functional language?
In computer science, functional programming is a programming paradigm style of building the structure and elements of computer programs—that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data.
Function composition is a mechanism to combine simple functions to build more complicated ones.
The ability to easily compose functions encourages factoring (breaking apart) functions for maintainability and code reuse.
Type-driven development is a programming style where you write types first and use them to guide the definition of functions in your program.
A strong type system can not only prevent errors, but also guide you and provide feedback in your design process.
Using functional programming language changes the way you write code. You start thinking about the (data) types that represent the data your code works with.
Values:
Effects:
In mathematics, the cardinality of a set is a measure of the "number of elements of the set".
"The hidden performance costs of instantiating Throwables", Norman Maurer
We need to minimize the usage of @ControllerAdvice to avoid a GOTO pattern
In Java 8, the language was released with some Types to increase the expressiveness, like Optional to model optionality in the value returned by a method.
Following the same idea, how to model the Exceptionality? Unfortunately, the language doesn't provide any solution in the line of Optional.
Using VAVR, you can add 3 new alternatives:
The Try type represents a computation that may either result in an exception, or return a successfully computed value.
Either represents a value of two possible types. By convention, the Left signifies a failure case result and the Right signifies a success.
Skills:
Do you want to reach the Level 3?
Thanks