Faster sampling in PostgreSQL

Many times we want to display some random data to the user, for example if you have an e-commerce website apart from the top products or some list of products that a fancy recommendation system generates, we want to display to the user a list of...

Read

It's all Greek to me: Thoughts on code readability and aesthetics

Do you remember the first time you wrote something in a new programming language and you run it, and it worked? Didn't you had this 'OwO, I am a Perl developer now, let's put it on the CV' feeling? Until, someone else come to you and say, 'No, no, no, you can squeeze these 10 lines, into this one-liner'...

Read

Lazy and infinite data structures

Many times we encounter situations where our code depends on a complicated data structure or a data structure that has implicit semantics. For example...

Read

Compensation does not guarantee motivation

Let's start with a story. A few years ago I was working in a start-up, the company had just started, and we were working on the first ever product. There were hundreds of bugs and performance issues, the server was crashing every few minutes...

Read

Giving praise

Just some thoughts on giving praise. One of the biggest mistakes that you can make as a manager/team-lead/head-of-whatever is to give praise only to a few of the people who worked on a project...

Read

Ruby: Provide ways to iterate over collections

Sometimes we have classes that represent collections, for example a class `Group` can...

Read

Implementing feature toggles for a React App using Webpack

Feature switches/toggles are an important technique that can help us deploy code in various environments under different conditions without blocking other developers in the team (or other teams) from releasing their features...

Read

Pseudomandatory parameters in es6 functions

In many programming languages, the parameters of a function are by default mandatory and the developer has to explicitly define that a parameter is optional. In Javascript, every parameter is...

Read

Backpressure for smoother user experience in low-end devices

If you are building applications that consume real-time data you may have faced a situation where the component or service that consumes the data cannot keep up with the volume or speed of the produced data. The **producer** module of the system is emitting data faster than...

Read

Hide depedency to a data structure

Many times we encounter situations where our code depends on a complicated data structure or a data structure that has implicit semantics. For example...

Read

Remove argument-order dependency and provide defaults

Argument order in function signature is a common source of bugs and frustration. Imagine you have the following Vehicle class, its constructor accepts values to instantiate an object...

Read

Null object pattern

Many times functions accept object references that can be null, and we tend to add if statements to treat the special case where null is passed to a function, and either provide a default response or...

Read