Safely handling destructive loops

Collections abound everywhere in the real world and loops are very common in programming. A simple loop is shown below: Destructive loops Simple loops can be boring, after all, why not have the collection change during a looping operation for more fun? Won't happen? Believe me it does, have run into such at least twice. An example scenario … Continue reading Safely handling destructive loops

How to add in programming languages

This is a tongue-in-cheek attempt to expose programming language expressiveness. 1. Scheme Characters needed to add n digits: n + 3 Prefix notation allows passing in multiple operands Prefix notation is not popular 2. JavaScript/Python/Ruby/Octave/Matlab Characters needed to add n digits: n + (n - 1) Very simple and generally accepted Infix form requires two operands leading to (n - 1) operators … Continue reading How to add in programming languages

JavaScript’s Function.prototype.bind

The bind function allows you to set the context with which a function will execute. It takes in a 'context' object and returns a new function which has its context set to the passed in object. The variadic method, which exists on all function objects, provides a workaround for the annoying and elusive 'this' context issue in JavaScript. As … Continue reading JavaScript’s Function.prototype.bind

Programming Paradigms: An Introduction

A programming paradigm is a way of programming, a style of solving problems and thinking about the domain. Languages directly or indirectly influence programming style; for example, Haskell is purely functional while Python allows a blend of OOP, functional and imperative programming. Even though most new languages are multi-paradigm, they usually make it easiest to program in a single paradigm; C … Continue reading Programming Paradigms: An Introduction

The Art of Debugging

I recently wasted a lot of time while attempting to use the amazing Dropzonejs image uploader. I left out a function call in an overloaded function and this broke every subsequent call. More annoyingly, I could not pinpoint the cause of the error as Dropzone was failing silently. Close to giving up, I decided to give it … Continue reading The Art of Debugging

Asynchronous Module Definition (AMD)

AMD (No, not the chip maker) stands for Asynchronous Module Definition - a cool new way of loading scripts. AMD attempts to solve some of the limitations associated with the orthodox approach of loading scripts. The usual approach is to load script files based on their dependencies (e.g. files depending on jQuery have to be specified … Continue reading Asynchronous Module Definition (AMD)

For Devs only

I try to do less to achieve more - it is good; it makes me do my job faster and more easily; you should do so too. Automate, use shortcuts, innovate; well the initial investment might take a lot of time but it's something you will be glad you did. You can learn a lot … Continue reading For Devs only

Taking the PAIN out of coding

Over the years, I have learnt some tricks and picked up some lessons while writing code. Most were learnt the hard way, so I decided to share a couple of tips on how to avoid development pitfalls. Meticulous Planning and Design One of the most difficult lessons I learnt in software development was not to … Continue reading Taking the PAIN out of coding

The language series: PHP

I think PHP is disproportionately targeted for rants; it's the language everyone loves to hate. Despite the proliferation of posts that list the 1 trillion things PHP does wrongly, more than 70% of all websites run PHP on their servers. Even more interestingly, 'better' languages like Ruby are below PHP in the TIOBE index ( … Continue reading The language series: PHP

The Language Series : Java

Java! The language I once loved so passionately that I saw other languages as being inferior. Now, I rarely use it - the last time was while writing an Android app early last year. My Java Story I had been learning C++ and finding OOP quite difficult. When the new academic session began, I had to … Continue reading The Language Series : Java

Are developers better than testers?

A lot of people view testers as second-class citizens; probably because QA guys rarely 'create' stuff like devs do (although they sometimes do original work creating test frameworks and platforms). They are more similar to editors who verify the work of authors. However, testers are just as important as developers; without QA the end product … Continue reading Are developers better than testers?

Clean Code, Dirty Code

Phew! It feels like forever since I wrote a blog post; I have been extremely busy - finished an internship and had to travel back to school. Well, I actually have a couple of drafts but didn't get to publishing them. Am I too lazy? Na you sabi... :). I don't know why I seem to … Continue reading Clean Code, Dirty Code

Reflection : Arcane parts of Software Development

I first came across reflection when I needed to develop a PHP framework for my former firm. I started by reading the fuel source code (fuel is a PHP framework) and came across the reflection patterns in the boot strap. I seem to have a lot of first times with PHP. Well I have come … Continue reading Reflection : Arcane parts of Software Development

How it all started

My very first language was FORTRAN; I took a programming course in it in 2006 and was instantly hooked. I didn't have a computer however I worked in a computer centre so I could program whenever I was free. After getting my laptop, I delved into C; however I  was 'advised' to drop C as it wasn't … Continue reading How it all started

Functional Programming & ME

After finishing Rebecca Murphy's jqfundamentals and finding it to be quite an enjoyable and smooth read, I decided to learn JavaScript; I scanned my languages-to-learn list and quickly brought JavaScript to the front ahead of the others: Python/C/C++/C#/Ruby/Bash. One of the motivating factors was the fact that JavaScript supports functional programming; a paradigm I have … Continue reading Functional Programming & ME

I’m beginning to hate PHP?

While working on a new web application, I felt somewhat bored because I was going through my same old cycle all over again – there was nothing challenging or exciting to me. My first thoughts was that I was getting used to PHP but deeper thoughts proved me wrong. It boiled down to two options … Continue reading I’m beginning to hate PHP?