Author: Shivangi Gupta

Back2Basics: Exception Handling – #3

In our previous blog Exception Handling – #2, we talked about how we can handle exception using Either. In this blog, we will explore further about Either, how we can elegantly handle exceptions using Either while working with Collections. We use collections when we want to perform some operations on elements. But what if something goes wrong while performing the transformation, do you have any Continue Reading

Back2Basics: Exception Handling – #2

In our previous blog, we have seen how we can handle exceptions using try/catch and Try block.  In this blog, we will explore how we can handle exceptions using Either. Either, just like a Try, is also a container type which can have one value either Left or Right at a time. We can also use Option to handle exceptions but if an exception occurs returning Continue Reading

Back2Basics: Exception Handling – #1

While building an application, it is common that something might go wrong. What if there is an attempt to divide a number by 0 or fetching the data from the database which does not exist, or reading a file which can’t be located? We need to handle such situations to make sure our application does not go down. Every language provides ways to handle such Continue Reading

Back2Basics: The Magic of Implicit – #2

In our previous blog, The Magic of Implicit, we have talked about how implicit values are being used. In this blog, we will explore Type Conversion with implicit and implicit classes. Let’s start with a simple example, scala> val i: Int = 2.3 <console>:11: error: type mismatch; found : Double(2.3) required: Int val i: Int = 2.3 Here we were trying to assign a double type value Continue Reading

Back2Basics: Demystifying Variance

In this blog, we will explore types of variances in Scala. In-variance Co-variance Contra-variance First, let’s talk about Types in Scala. scala> import java.util.ArrayList scala> var ref1: Any = “Hi” ref1: Any = Hi scala> var ref2: String = “Hi” ref2: String = Hi scala> ref1 = ref2 ref1: Any = Hi In the above example, ref1 is of type Any and ref2 is of Continue Reading

Back2Basics: The Magic of Implicits

Implicit System is one of Scala’s language greatest feature with the help of which we can write concise code. The implicit system in Scala allows the compiler to adjust code using a well-defined lookup mechanism. In this post, we will try to understand how Scala’s implicit work magically. Scala provides an implicit keyword that can be used in two ways: method or variable definitions, and method parameter lists. Continue Reading

Back2Basics: Type Erasure in Scala

Scala has a really strong type system. Scala’s static type system is listed as one of its strong points. But even though Scala’s type system is theoretically very strong, in practice some type-related features are weakened by the restrictions and limitations of its runtime environment, i.e. Type Erasure. So, what is type erasure? Type erasure refers to the runtime encoding of parameterized classes in Scala. Continue Reading

Git Cheat Sheet: Basics

In this blog, I have listed some of the basic commands like installing and configuring the Git. How Git works is not the focus of this post. I have piled up some commands for performing basic operations in git. 1) Install Git sudo apt-get update sudo apt-get install git 2) Configuring username and email of git git config –global user.email “shivangi.gupta@knoldus.in” git config –global user.name Continue Reading

Unveiling The Mystery Of Serverless

In this blog, we will explore about Serverless and why it is trending so much? Serverless, is itself a self-explanatory word, means there are no servers. But, is it really true? No, it is not. Serverless does not mean the absence of servers. There are servers actually, it’s just that we don’t have to manage them. All the infrastructure is provided by companies like AWS, Google, Azure Continue Reading

Exploring JEST: Java HTTP REST Client

Elasticsearch is a real-time distributed and open source full-text search and analytics engine. To integrate Elasticsearch to our application, we need to use an API. Elasticsearch gives us two ways, REST APIs, and Native clients. It’s easy to get confused about all the different ways to connect to Elasticsearch and why one of them should be preferred over the other. Available Elasticsearch clients are: Node Continue Reading

Introduction to GraphQL – A Query Language for APIs

GraphQL is an API standard that provides a more efficient, powerful and flexible alternative to REST. It was created by Facebook in 2012 and was open-sourced in 2015 and is now maintained by a large community of companies and individuals from all over the world. GraphQL is just a specification, meaning it’s just a set of rules defined in a document. GraphQL is a query language designed Continue Reading

Scala Best Practices

The central drive behind Scala is to make life easier and more productive for the developer — and that includes me. Scala does this with three principal techniques: It cuts down on boilerplate, so programmers can concentrate on the logic of their problems. It adds expressiveness, by tightly fusing object-oriented and functional programming concepts in one language. And it protects existing investments by running on Continue Reading

Scala Best Practices : Pure Functions

We grew up in a world of imperative programming that’s why we are more addictive to writing code in imperative style. Everything is mutable around us. Mutability is not that bad. But shared mutability is devil’s work. The moment we bring shared mutability all kinds of problem creep in. Functional Style has a way to handle this. Functional programming is a way of writing software Continue Reading

%d bloggers like this: