Why Programmers Should Automate More May 2017

Last week, I created a small script to aid my workflow which left me wondering why I didn’t make it earlier. It adds an option in Finder’s context menu to start a static web server in any folder which makes it easier to preview static websites. Technically, it’s equivalent to firing up the terminal, cding to the directory, and using one of the many options to create a static server. The convenience of doing in one step which took three is minor, but automating the process is also advantageous in secondary ways. The crucial benefit is removing the tedious chunk—even if a small one—of my work. I can take pride in how my real work won’t include time to get a static server running.

Everyone’s daily work is filled with similar tedious chunks insomuch that it’s hard to distinguish the real work. Time spent in checking reports buried down a web of links; in collating data from several sources; in syncing files via email. In programming? In creating a build with five manual steps; in setting up workflow that requires several applications to be up and running. Time spent in these trivial tasks eats into the real work; worse, creates an impression that real work is getting done.

Read more

Things Programmers Should Never Say : "Who wrote this awful code!" Feb 2017

Code Gets Better Some codebases are crappy — actually, quite a lot of them are — but it’s distinguishably common to hear sharp criticism of code written even by decent engineering teams. Often this takes the form of complaining how the existing codebase is riddled with things-not-done-the-right-way. It’s typical when a small team of hackers grows to a bigger company and hires more programmers. From an idealistic viewpoint, it’s warranted one.

Read more

Imperfect 'Best' Practices Oct 2015

Six years ago, I was taught my first lesson of C++. Soon after learning about loops, came a subsidiary lesson about the goto statement. The teacher made it clear that using goto was a horrible practice because of unconditional-jumps mess it creates and should always be avoided. A bit of googling followed and I ended up with a well known essay of E. Djikstra’s ‘Goto is considered harmful’ and I committed myself to never use the statement even if it meant creating a frivolous flag variable.

Read more

Debugging Stuck PHP-FPM Process With Strace Sep 2015

For most of the times, debugging is easy – a silly logical error or an oversight, quick to correct and move on but some problems are hard – because you don’t know where it is wrong. The bigger the involved stack is, the higher are your chances of getting stuck at them. In such cases, tools like strace can be of great aid as they can help you give a hint about where things are getting screwed up.

Read more

Blog Little Things Jul 2015

John Carmack once speculated that StackOverflow might have added billions in productivity.

Read more

Creating Side-scroller Game in HTML5 and Javascript Apr 2015

Recently I completed my first game, Penguin Walk, with help of free art in Javascript and it gave me empirical experience of a known-fact surrounding game development – “The hardest thing about developing a game is finishing it.” Although, the game is dead simple and code runs in only few hundreds of lines, it took a lot of effort to finish it. The reason? I believe the hard thing related to game development, is that you are attempting to build something complex out of very simple elements (pixels).

Read more

Hackers Are the Real 10x Engineers Jan 2015

The notion of 10x programmer was first mentioned by John Brooks (of, Brook’s law fame) in his essay No Silver Bullet, according to which, ‘there is as much as a tenfold difference between an ordinary designer (programmer) and a great one’. The idea has been widely debated, sometimes refuted and many times defended which is unsurprising for it is impossible to accurately measure a programmer’s productivity.

Read more

Why Should You Use Tmux? Aug 2014

Terminals are an essential place frequented by developers in their daily use. In contrast to GUIs, command line gives you more folds of power and transparency when you dealing with a complicated tool like git, or when you need to pull off some networking stats using netstat. In this blog post, I’ll explain why tmux is a great productivity enhancer when working with command line.

Read more

Building a Whistle Detector Using WebAudio API Jul 2014

There are lots of things to get excited about HTML5 and the one which caught my curiosity was HTML5 Audio / Video API. I was overwhelmed with ideas of practical applications like face detect login or inline dictation but I chose to start with something small - a whistle detector. Although, not wholly accurate it works quite well with very a good accuracy. I used M. Nilsson’s research paper, “Human Whistle Detection and Frequency Estimation” to implement this. It took me a while to get understand exactly what the paper narrates with its mathematical notations but luckily my wandered at the right place to get the right idea.

Read more

Stop using Captchas that Can be Broken with Two Lines of Code May 2014

The de-facto bot prevention technique sprawls everywhere on the web but I am surprised how people overestimate the difficulty of breaking a captcha. Here are some of them which I encountered.

Read more