Author: Rituraj Khare

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

Recursion and Tail Recursion in Scala

Reading Time: 4 minutes Introduction: Recursion is quite common in the programming world. If you don’t know recursion, it means, solving a problem by breaking it into smaller sub-problems until you solve it trivially. You can easily spot recursion if you see a method calling itself with a smaller subset of input. Recursion and immutability are corner zone of functional programming. As we have seen earlier, while using loops, Continue Reading

How to use Exception Handling Mechanism

Reading Time: 4 minutes Introduction: One of the fundamental and important aspects of programming is Exception Handling. A program needs an environment to handle the potential errors and abnormal conditions. Programming does not end with writing code that executes and creates a result, as we also have to handle errors in a user-friendly manner. There are several types of errors that could occur when we run a program. Some Continue Reading