Functional Programming

Understanding Functional Programming

Reading Time: 4 minutes This blog describes all about Functional Programming. With this blog any novice will be able to understand benefits of using functional programming and will able to apply it in their code base to increase performance. So lets begin with introduction of functional programming. Introduction Functional programming is a type of paradigm or pattern which is defined in computer science and here we do everything with Continue Reading

Java 11 features

Reading Time: 3 minutes Oracle released Java 11 in September 2018, only 6 months after its predecessor, version 10, and java 11 Oracle JDK would no longer be free for commercial use. In this blog, we’ll explore new features of Java 11:- Open JDK After java 10 there’s no free long-term support (LTS) from Oracle. Thankfully, Oracle continues to provide Open JDK releases, which we can download and use without charge. Continue Reading

JOOQ overview, setup and code generation

Reading Time: 2 minutes Introduction JOOQ is an acronym for Java Object oriented query. It is framework which is built on top of a functional programming, which helps increase in the readability of the code. The library generates Java classes based on the database tables and various constraints. Which let us create type safe queries through API. In this tutorial we are going to set up the SpringBoot and Continue Reading

future to IO

Why use Cats IO instead of Scala Futures?

Reading Time: 2 minutes This article focuses on using Cats-Effects IO. Cats effects can be applied to other IO libraries as well such as Monix. We are discussing Future to IO conversion in this blog. Main benefits of using IO: IO is pure, immutable and referentially transparent. It makes it easy to control the execution of the effects. It’s currently the most common solution to reflect the pure and impure Continue Reading

Scala | Call by Value and Call by Name

Reading Time: 2 minutes In this blog we discuss about different ways of passing arguments in function call in scala. Call-by-Value By default scala use call-by-value for passing arguments to a function.Here is a function adder that uses the call-by-value strategy. The Call-by-value function evaluate the passed-in expression value before calling the function, so that same value accessed every time.Above all call by-value strategy has the advantage that it evaluates Continue Reading

Updates in Rust 2021 edition

Reading Time: 2 minutes The new edition of Rust is here. The edition 2021 of Rust have many interesting changes in it. Let us have a look at some of the changes in edition 2021. Additions to the prelude The TryInto, TryFrom and FromIterator traits are now part of the prelude. This might make calls to trait methods ambiguous which could make some code fail to compile. However, adding a trait to the prelude can break Continue Reading

What is Lambda Expression in java? How to Use it?

Reading Time: 3 minutes Lambda Expressions get add-in Java 8. Java lambda expressions are Java’s first step into functional programming. Its main objective is to increase the expressive power of the language. The syntax of a basic lambda expression is: The expression use as the code body for the abstract method within the paired functional interface. lambda expressions exist outside of any object’s scope. This means they are callable anywhere in Continue Reading

scala futures

Simple Guidance For You In Case Class And Pattern Matching

Reading Time: 2 minutes Case classes are like regular classes that have default apply() method which handle object construction. There is no  need to use a new keyword to create an object. Case class provides purely functional code with immutable objects. Case classes are a representation of a data structure with the necessary methods. It support pattern matching. Syntax of case class:- Example:-  When you create a case class Continue Reading

An approach to SOLID Principles – Object Oriented vs Functional Programming

Reading Time: 6 minutes SOLID PRINCIPLES Before starting to know about what exactly the solid principles are ? We have to know about what exactly the meaning of the principle. Principles are something which give a name of a concept so that you can talk and reason about that concept. They help us to know that our code is in good or bad state . Principles can help you Continue Reading

Cats Effect : Pure Functional way to code in Scala

Reading Time: 2 minutes Follow 5 Simple Rules with Cats Program written using Cats Effect provides incredibly strong guarantees and powerful functionality, performance, safety, and composability, provided you follow each of the following rules: Wrap all side-effects in delay, async, blocking, or interruptible (pro tip: try to keep the size of your delay blocks small; two delays with a flatMap is much better than one big delay) Use bracket or Resource for anything which must be closed Never hard-block a thread outside of blocking or interruptible Use IOApp instead of writing your own def main Continue Reading

How to Tackle Error in Rust Programming

Reading Time: 3 minutes An Error is basically an unexpected behaviour that may lead a program to produce undesired output or terminate abruptly. Error handling is the process of handling the possibility of failure. In Rust, errors can be classified into two major categories. Recoverable UnRecoverable Recoverable Error Recoverable errors are those that do not cause the program to terminate abruptly. Such as a file not found error . Continue Reading

Referential Transparency in Java Programming

Reading Time: 4 minutes what is functional programming ? It is a declarative style of programming rather than imperative. The basic objective of this programming is to make code more concise, less complex, more predictable, and easy to test. Functional programming deals with certain key concepts such as pure function immutable, state, assignment-less programming etc. Imperative Vs Declarative Programming In the imperative style of coding, we define what to Continue Reading

Higher Order Functions in Scala

Reading Time: 3 minutes Introduction: Some functions are called higher-ordered functions as they accept functions as parameters. You can also have a higher-order function as one that returns the functions. So basically, if there is a function that deals with a function, is kind of a meta-level, we call it higher order. Why do we use higher order functions..?? Because we want to be able to reuse our code Continue Reading