JavaScript is Awesome -New Thunk and Currying Hack!

thunk

Introduction Functional programming in JavaScript, particularly through the use of thunks and cur- rying, offers developers powerful tools for managing function execution and argument handling. Thunks are functions designed to encapsulate computations for deferred execution, making them especially useful in scenarios requiring asynchronous oper- ations, such as those commonly encountered in Redux applications. This capability … Read more

Inheritance Interface Composition: Untangling the Insidious Knot, Now!

interface

Terminology In layman’s terms: Interface is for “can do/can be treated as” type of relationships. Abstract ( as well as concrete ) classes are for “is a” kind of relationship. Look at these examples: Bird, Mosquito and Horse are Animals. They are related. They inherit common methods from Animal like eat(), metabolize() and reproduce(). Maybe … Read more

Dependency Injection Life Cycle Truth: The More Secrets You Know!

dependency injection

Dependency Injection (DI) is a pattern that can help developers decouple the different pieces of their applications. “Dependency Injection” is a 25-dollar term for a 5-cent concept. It means giving an object its instance variables. Really. That’s it. Classes have these things they call methods on. Let’s call those “dependencies.” Most people call them “variables.” Sometimes, … Read more

Polymorphism Unique Deep Dive: Think Single vs Double Dispatch

Polymorphism

Polymorphism Basics Let’s start from polymorphism basics with an example. Let’s have a hierarchy of shapes that are defined with each of the derived types overloading a base virtual Draw() method.  Next, we used a console application to define a list of each of the shapes. And to iterate over each shape in the collection calling the Draw() method … Read more

Unlock OOP: Polymorphism Techniques You Need to Master!

Polymorphism

Polymorphism describes the concept that objects of different types can be accessed through the same interface. Each type can provide its own, independent implementation of this interface. So; is polymorphism just “being able to perform functions of an interface, such as adding, subtracting, etc, on objects of different data types such as integers, floats, etc”? … Read more