Functional programming promotes this property via its emphasis on avoiding side effects, expression oriented programming and referential transparency. Another mechanism that is employed is of pattern matching. In this two part series, I introduce this simple yet elegant mechanism which facilitate writing of simple yet robust code.
The choice between specialisation and generalisation is prevalent in many aspects of life, and software development is not immune. In the following paragraph I…
Software is read by humans and computers, who have contrasting characteristics. Humans are big picture thinkers and are overwhelmed by information, while machines are tireless and unforgiving, they need precision of communication to operate. It is imperative that software development practices factor in nuances of both these consumers.
While code is a medium of communication between developers, often it is too detailed to facilitate high-bandwidth communication. Models, which capture the essence and ignore the ceremony is an efficient alternative to code. They should be employed for reasoning and reviewing when applicable.
In this post I summarise some key ideas, which…
Occam’s razor is one of the most powerful problem solving principles applicable in life and in software development. It is probably not well known, is often misunderstood and under-utilised.
In this post, I disambiguate it, enumerate multiple formulations and common misinterpretations. I will demonstrate that many principles and practices in software development are applications of Occam’s razor, and list some missed opportunities.
The premise of Occam’s razor is that “entities should not be multiplied without necessity”. It advocates that when presented with competing hypotheses about the same prediction, one should select the solution with the fewest assumptions, and that this…
Of the many powerful and composable abstractions of the functional programming paradigm, applicative functors don’t get the attention they deserve.
Programmers like me who got introduced to the functional style via Streams in Java will have a bigger disconnect compared to abstractions like Functors and Monads. While the streams in Java are functors and monads, they are not applicatives[I will use Applicatives and Applicative Functors interchangeably].
In this post, I will demonstrate the concepts related to Applicative functor via Java code examples and suggest areas where they are relevant/best suited.
One of the primary concepts of functional programming is of…
After successfully adopting the functional programming style at my day job for about 2 years, I believe it warrants wider adoption. In this post, I enumerate the reasons for the same.
Software development is an inherently multiple dimensional problem, It needs to address challenges across these dimensions. Some of them and their facets are listed below.
I will focus on some of these facets, and explain how the adoption of functional is beneficial on them.
I practice Yoga occasionally and perform two contrasting asanas
Let’s consider the design of chairs. They need to bear weight at the seat as well as back post. The directions of the load in case of these two parts are (almost) perpendicular.
A design which considers only one of the two directions is unlikely to produce functional chairs. Most human endeavors similarly involve dealing with multiple dimensions. Software development is no different, in fact, it is more so.
One of the first games I played on a computer was Tetris. It is one of the most popular games ever built. It consists of rotating and moving game pieces as they move down vertically with the aim of creating a horizontal line without gaps.
Now imagine playing the game with pieces instead of the four squared tetrominoes.
Bigger and odd shaped blocks will make the game hard, smaller blocks will make the game too easy. The number of squares ‘4’ seems to be the “sweet spot”.
Decision making often involves sweet spots and software design is no exception. I…
Software Development is a collaborative, creative and demanding human endeavor and it shares traits with other such endeavors. In this post, I compare it with batsmanship of cricket.
Cricket is a beautiful game with complex rules, played over longer durations compared to other games. The qualities required to excel in cricket are similar to those required to excel in developing software systems.
There are ten modes via which a batsman can get dismissed. Software systems can fail or underperform for many reasons too. Some of these dimensions are correctness, reliability, performance, scalability, use-ability, maintainability, and extensibility.
A batsman who can…
I have been coding for over two decades, and have been a fitness enthusiast for a few years now. Developing and maintaining one’s body and that of developing software are both human endeavours and have similar misconceptions, constraints, principles, challenges and gotchas.
I present the metaphor of fitness in an attempt to bring focus on key aspects of software development. It would be an icing on the cake, if it motivates the readers to work on their health.
Before I started my fitness journey I held an opinion that I was fit for my age and minor adjustments to my…