Profile cover photo
Profile photo
Harmeet Singh
155 followers -
Programming is an Art, every good programmer is an Artist !!
Programming is an Art, every good programmer is an Artist !!

155 followers
About
Harmeet's posts

Post has attachment
Scala Desgin Pattern: Memoization, recording function result in memory

Post has attachment
Scala Dessign Patterns: Memoization
Introduction Memoization is mechanism of recording a function results based on its arguments in order to reduce computation in consecutive calls. Agenda: Implement Memoization using Scala. Implement Memoization using Scalaz.   Code: By Scala class Hasher ex...

Post has attachment
Scala Design Pattern: Duck typing, when we cannot implement a common interface between different types.

Post has attachment
Scala Dessign Patterns: Duck Typing
Introduction If it looks like a duck, swims like a duck and quack like a duck then it is probably a duck. It is not the type of object matters but the operations that the objects supports. We can use duck typing for requiring even more methods to be availab...

Post has attachment
Scala Design Pattern using Lazy Evaluation in scala.

Post has attachment
Scala Dessign Patterns: Lazy Evaluation
Introduction Lazy Evaluation makes sure that an expression is evaluated only once when it is actually needed. Agenda: Lazy Evaluation using Scala Code: case class Person (name : String ) class PersonService { def getFromDatabase : List [ Person ] = { printl...

Post has attachment
Scala Design Patterns - Type Class Design Pattern. Go and lean Ad-Hoc Polymorphism in Scala.

Post has attachment
Scala Dessign Patterns: Type Class Pattern
Introduction An important principle of good code design is to avoid repetition and it is known as do not repeat yourself (DRY). Ad Hoc Polymorphism:  Ad Hoc Polymorphism is utilizing a possibly different implementations based on Types.  Agenda Implement Typ...

Post has attachment
Scala Design Pattern, Stackable Tratis

Post has attachment
Scala Dessign Patterns: Stackable Traits
Introduction Provide different implementation for a method of a class later.  Agenda: Stackable Traits using Scala . Code: trait StringWriter { def write(str : String ) : String } class BasicWriter extends StringWriter { override def write(str : String ) = ...
Wait while more posts are being loaded