Studio-Scala

Code Combat II : The Code Battle For The Vanguard Continues…

Reading Time: 4 minutes “If you can dream it, you can do it. ”  -Walt Disney For some coding is a job. For some, it is an exercise. But for us folks here at Knoldus, it’s a Passion. So in order to bring a twist in the daily work schedule, Knoldus held an overnight Hackathon competition within the organization on 18th May 2018 which presented an opportunity for every Knolder(employees Continue Reading

map(), flatMap() on Futures & Options in scala

Reading Time: 5 minutes In this blog, we would be looking at how map() and flatMap() operations work with Option and Future of scala, literally speaking both Futures and Options are very effective features of scala, A Future lets us have a value from some task on a differnt thread and Option provides us a hand from null of java as using null in scala is seen a very bad approach in Continue Reading

Scala Extractors

Case Class Inheritance

Reading Time: 3 minutes Hello friends, as discussed in the previous blog we know what are case classes and what boilerplate code do they generate. Now in this blog, we will be discussing case class inheritance, how it can be achieved as the case to case inheritance is prohibited due to the equals and hashcode method case classes generate. We will also be telling the bad side of case classes. scala> Continue Reading

The Law of Demeter

Reading Time: 3 minutes You’ll often get to hear from good programmers about having “loosely coupled” classes. What do they mean by saying that? Let’s understand this first before jumping onto the Law of Demeter. Loosely Coupled  In object-oriented design, the amount of coupling refers to how much the design of one class depends on the design of another class. In other words, how often do changes in class

Do you think your code is Perfect? Well, Think again.

Reading Time: 8 minutes “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” – Martin Fowler “I can code.” I always say to myself. But do others think the same? Is my code good enough for people to understand? Do other people think “Damn I wish I could write such code.?” –  that’s the main question I always had in Continue Reading

MongoDB vs RDBMS and it’s Advantages

Reading Time: 5 minutes In this blog, I will introduce you with the MongoDB and will draw a comparison with RDBMS and highlight its advantages over the later. MongoDB is a No SQL database.  It is an open-source, cross-platform, document-oriented database written in C++. MongoDB is developed by the company named 10gen. They define MongoDB as: “Mongo DB is scalable, open source, high performance, document-oriented database.” Why MongoDB? In this section, we will Continue Reading

monads

Back2Basics: Exception Handling – #3

Reading Time: 2 minutes 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

What is Uniform Access Principle?

Reading Time: 2 minutes Uniform Access Principle is a programming concept which was first introduced by Bertrand Meyer which stated that All services offered by a module should be available through a uniform notation, which does not betray whether they are implemented through storage or through computation. The principle simply means that the notation used to access a feature of a class shouldn’t differ depending on whether it’s an attribute or a Continue Reading

Scala Extractors

Case Class In Scala

Reading Time: 3 minutes Case Class is one of the great tool introduced by Scala in the functional programming world. case class Book(id: Int, title: String, isbn: Long) Let’s explore what’s hidden behind the above class. Case class is similar to a class but it provides a lot of boilerplate code for developers to use. By default, they are immutable i.e. once declared cannot be changed. If we compile Continue Reading

monads

Back2Basics: Understanding Partial Function – #2

Reading Time: 3 minutes In previous blog Understanding Partial Functions – #1, we have talked about what is partial function and how they are different from regular functions. In this blog, we will explore more about the partial function. We have talked about how we can define partial functions having one argument. But what to do if we have to pass more than one argument. Let’s try defining divide Continue Reading

Clean Code – Robert C. Martin’s Way

Reading Time: 7 minutes Writing good code in accordance with all the best practices is often overrated. But is it really? Writing good and clean code is just like good habits which will come with time and practice. We always give excuses to continue with our patent non-efficient bad code. Reasons like no time for best practices, meeting the deadlines, angry boss, tired of the project etc. Most of Continue Reading

Table Driven Approach For Testing

Reading Time: 3 minutes Most of us would have been in a situation where multiple test cases are same but the input data isn’t, Or even when input data is same and is used for multiple test cases. So In cases like these we can use Table driven approach, it is a way of testing that allows you to write minimal test code with increased readability.

Knoldus-Spark-AI-Summit-2018

A quick recap of SPARK + AI SUMMIT 2018

Reading Time: 3 minutes Spark + AI Summit was the world’s largest big data event focused entirely on Apache Spark assembling 4,000 people(best engineers, scientists, analysts, and executives) from over 40 countries attending to share their knowledge and receive expert training on this open-source powerhouse. If you didn’t make it, don’t worry; We’ve got you covered! Vikas Hazrati and Ram Indukuri from Knoldus Inc. attended the Spark+AI Summit 2018, Continue Reading