Kind Leadership: Influence over Authority

One of the most underrated parts of working at any job is interacting with people. It is amazing how much humans achieve via collaboration and also how fast relationships can degenerate. The following paragraphs cover real-life experiences and propose a model for kind influence - especially for senior team members. I am right and you … Continue reading Kind Leadership: Influence over Authority

Guaranteeing software behaviour

My foremost goal while building software is to build stable self-healing systems with deterministic behaviour. I want to ensure my code continues to work even when unexpected events occur. In the event of unknown unknowns, the expectation is a graceful degradation in the worst case. This requirement is even more important when implementing high-risk projects. … Continue reading Guaranteeing software behaviour

5 things I learnt from solving 100+ hackerrank algorithms

Sometime last year I started to solve hackerrank problems at my pace and here is my progress after about 108 days ago. Funnily, I used to think there was no need to practice interview questions unless you were looking for a job or interviewing job applicants. This earlier perception might be wrong; I now think engineers should … Continue reading 5 things I learnt from solving 100+ hackerrank algorithms

Adventures with XOR

I recently ran into a code puzzle; the question asked for the finding the unique element in a list of integers given that every integer appears twice except the single special element. My first solution You could use an array to hash elements to buckets (sort of like counting sort) and then flip their values … Continue reading Adventures with XOR

Reading is not enough

I used to read a lot in the past without practicing what I learnt; that exposed me to a variety of ideas and empowered me to discuss a lot of things. Over time, I found out that I mostly didn't 'know' what I thought I knew.  Yeah I know it sounds somehow but it's really true. True understanding … Continue reading Reading is not enough

Working with Integers in JavaScript

One of the ways JavaScript differs from most programming languages is the absence of integer types. Every numeric value is a Number which is based off the IEEE754 floating point representation. You can still have 'integer' values and it is technically possible to approximate this behaviour using UInt*Array types but that's a discussion for another day. This … Continue reading Working with Integers in JavaScript

Why you should not use isNaN in JavaScript

I was on a video streaming site recently and moved the play point to the far right. It was amusing to see the hover details show NaN:NaN - ahah, some mathematical operation had NaN-ed and the code didn't cater for that. If you have read Why JavaScript ‘seems’ to get addition wrong; you would have seen … Continue reading Why you should not use isNaN in JavaScript

Why computer science matters for software developers

I used to think computer science never mattered because I rarely used algorithms and never saw the value of algorithm-based interviews (I still don't ;) ). The few folks I asked also concurred so I felt I was right. September 2016 My team got reorged and our goal was to build and deliver a brand … Continue reading Why computer science matters for software developers

What every programmer should know about types I

What is a type? Type: (noun) a category of people or things having common characteristics. A type represents the range of values of a particular type. Let's take an example from the mathematical concept of sets in number theory. The set of integers can be seen as a type - only values such as 1, 2, 3 are integers; … Continue reading What every programmer should know about types I

Why JavaScript has two zeros: -0 and +0

Do you know there are two valid zero representations in JavaScript? In pure mathematics, zero means nothing and its sign doesn't matter. +0 = -0 = 0. Computers can't represent value well enough and mostly use the IEEE 754 standard. Most languages have two zeros! The IEEE 754 standard for floating point numbers allows for … Continue reading Why JavaScript has two zeros: -0 and +0

Understanding JavaScript Property Descriptors 2

If this is your first time here, you should read the first post in this series. Then come back to this to continue. Continuing with the dive into property descriptors, this post goes deeply into the properties, what they mean and how they can be used. 1. Modifying existing properties The defineProperty method allows users to create and modify … Continue reading Understanding JavaScript Property Descriptors 2

Book Review:Build your own AngularJS

As part of my continuous learning; I started reading Tero Parviainen's 'Build your own AngularJS' about 6 months ago. After 6 months and 127 commits, I am grateful I completed the book. While I didn't take notes while reading, some ideas stood out. Thus, this post describes some of the concepts I have picked up from the book. The Good 1. Get … Continue reading Book Review:Build your own AngularJS

Understanding Bit masks

Bit masks enable the simultaneous storage and retrieval of multiple values using one variable. This is done by using flags with special properties (numbers that are the powers of 2). It becomes trivial to symbolize membership by checking if the bit at a position is 1 or 0. How it works Masking employs the bitwise OR … Continue reading Understanding Bit masks

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

Learning ES2015 : let, const and var

Lions at the zoo Zoos allow for safely viewing dangerous wild animals like lions. Lions are caged in their enclosures and can't escape its boundaries (if they did, it'd be chaos eh?). Handlers, however, can get into cages and interact with them. Like cages, you can think of variable scoping rules as establishing the boundaries and walls in … Continue reading Learning ES2015 : let, const and var

Learning ES2015 : Getting Started

ES6 (also ES2015) is the rave of the moment. Finally JavaScript is getting a makeover after nearly 6 years. The enhancements allow for more powerful and expressive JavaScript, ease the building of complex applications and iron out some quirky behaviour. The var hoisting problem? let resolves that. IIFEs? The function context syntax eliminates the need for that. There's … Continue reading Learning ES2015 : Getting Started

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

Why JavaScript ‘seems’ to get addition wrong

Introduction JavaScript is a dynamic weakly-typed language so it's possible to have expressions like this: This post explains how JavaScript evaluates such complex 'mix-n-matches' and at the end of this, you should know why foo is NaN. First, a screenshot showing more funny behaviour: A brief Maths Refresher Associativity The result of the mathematical operation is always same regardless of … Continue reading Why JavaScript ‘seems’ to get addition wrong

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