Home
Code Thoughts
Cancel

What is Microbenchmarking

Introduction Optimisation of code is an endless struggle. It is often even hard to produce meaningful metrics using jvm as it is an adaptive virtual machine. The article is a brief introduction ...

Sorting Lists of Objects in Scala

Introduction One of the most common ADT that a developer uses in their day-to-day coding is List. And one of the most common operations a developer performs on a list is to order it or sort it wit...

Repeated Method Parameters in Scala

Similar to Java, Scala also supports variable arguments or repeated method parameters. The concept is really useful in situations when you don’t know how many parameters you need to pass to a metho...

Lazy Evaluation in Scala

As per Wikipedia, “Lazy Evaluation is an evaluation strategy which delays the evaluation of an expression until its value is needed.” And today most of the modern programming languages support Lazy...

Closures in Scala

Before we begin discussing closures in Scala, let us have a quick look at a function. The function literal bill below accepts only one input parameter: netBill. However, the function calculates the...

Partial Functions in Scala

As the name suggests, partial functions are only partial implementations. They do not cover every possible scenario of incoming parameters. A partial function caters to only a subset of possible da...

Currying in Scala

Currying is named after Haskell Curry, an American mathematician. He is known for his work in combinatory logic. Currying is a means of transforming a function that takes more than one argument in...

Partially Applied Functions in Scala

Scala, like many other functional languages, allows developers to apply functions partially. What this means is that, when applying a function, a developer does not pass in all the arguments define...

Tail Recursion in Scala

Introduction Recursion is quite common in the programming world. As you probably know, it’s the process of solving a problem by breaking it down into smaller subproblems. You can easily spot recurs...

Designing Resilient Microservices

Resilience is an essential consideration while designing microservices. A microservice should embrace failure, whenever it happens. A microservice should be designed for all known failures. A few o...