Influential Books for programmers

I try to read a lot of books. Over the years, my 'taste' for books has been refined and some of my criteria are listed below. Book Impact Scale Length: The 200 - 300 page range is just about right for a technical book. Longer books contain a lot of fluff and repetition. Sometimes I get the … Continue reading Influential Books for programmers

Understanding and using Streams in JavaScript

Introduction What do you think of the following code snippet? Isn't it beautifully succinct and neat? It reads just like English! That's the power of streams. Streams are just like lists but offer more capabilities because they simultaneously abstract data and computation. Streams vs Lists/Arrays? Let's take a scenario from Mathematics, how would you model the infinite set of … Continue reading Understanding and using Streams in JavaScript

How to implement the Y-combinator in JavaScript

This post provides a very simple step-by-step implementation of the Y-combinator in JavaScript. You should be able to implement the Y-combinator in your language of choice after reading this post; as you'll see - it's that easy. What is a combinator? According to wikipedia, A combinator is a particular type of higher-order function that may be used … Continue reading How to implement the Y-combinator in JavaScript

SICP Section 3.3 – 3.5 : Found a bug in memq

1. Is memq broken? memq is an in-built list search function; it finds the first occurrence of a key in a list and returns a new list starting from that key. Now that you know what memq does, lets look at some weird behaviour Building on that foundation leads to the following conundrum memq tests whether the key exists in the … Continue reading SICP Section 3.3 – 3.5 : Found a bug in memq

SICP Review: Sections 3.1 & 3.2

Here are my thoughts on Sections 3.1 and 3.2 of my SICP journey; the deeper I go in the book, the more I appreciate the effort, style and work the authors put into it. Each section builds on earlier sections and it is amazing how it forces you to see software development from a new … Continue reading SICP Review: Sections 3.1 & 3.2

SICP Section 2.5

So four months after I started and more than 90 solved exercises, I can say Alhamdulillaah chapter 2 is done! Section 2.5 was one of the most challenging so far; the exercises revolved around building large easily extensible software systems. And here are the thoughts again :) 1. Coercion The section revealed the importance of coercion in software … Continue reading SICP Section 2.5

SICP Sections 2.3 & 2.4: Thoughts and Ideas

1. Top-Down Design Most of the problems in the SICP book are solved in a top-down way with lower level details deferred until needed. The focus on high level details makes for expressive flexible code since implementation is based on well-defined interfaces and not implementations. Consequently, swapping and improving interfaces is a cinch - the dependency on high … Continue reading SICP Sections 2.3 & 2.4: Thoughts and Ideas

SICP Section 2.2: New ideas and thoughts about programming

Here are 5 points to think about, hopefully they'll trigger an 'aha' moment. 1. Leveraging the 'Closure' concept in programming I am not talking about the 'closure' concept from programming (the one that involves free variables). This refers to the 'closure' concept from mathematics and the power it brings to programming languages. Mathematically, a set is closed under an … Continue reading SICP Section 2.2: New ideas and thoughts about programming

SICP Section 2.1 : Thoughts

Alhamdulillaah I wrapped up this section a few days ago - 13 of the solutions are here (if you are curious enough); the other three need proofs and I wasn't in the 'mood' for too much interval arithmetic. So what did I learn? 1. More Scheme This chapter introduced the concept of cons, car and cdr  for manipulating pairs … Continue reading SICP Section 2.1 : Thoughts

SICP Section 1.3 : Thoughts and Concepts

This section exposed me to the full power and beauty of functional programming. The expressiveness of using functions as values is awesome. For example, a sum of cubes function can use a sum function which itself relies on a reduce function. Think of higher order differentiation in mathematics and you do get the idea. An interesting concept involves … Continue reading SICP Section 1.3 : Thoughts and Concepts

Reading the SICP BOOK

I have been longing to read the Structure and Interpretation of Computer Programs (SICP) for a long time - a lot of great programmers tout it as one of the 'books' to read. In May I completed JS Allonge (a somewhat challenging read but got to understand the Y-combinator Alhamdulillaah) and I felt it was a good time … Continue reading Reading the SICP BOOK