Your projects are not your real baby, you may need to dispose them

By   | on December 4th, 2014

“This project is my baby, I don’t want to see it perform badly, I will give everything to protect it”, Does this sentence sound familiar to you? You may have heard it from your colleague or may have said it yourself.

In my view, ‘Like my baby’ is a metaphor which is over used and abused by many persons. What you will do when you found a really bad architecture based application whose programmers are just treating it like a baby? They love it, but afraid of losing it also.

Bad architecture happens, not just because someone was incompetent, bad things also happens due to things which were beyond control or unimaginable at the time of conceiving an idea or plan. But few people refused to understand that project may be like your baby, but they are not your real baby.

In real world, when we have a baby with different abilities, we try to help them to grow in different directions, we are supposed to support them in every sphere of life. We want to be with them, always; after all they are our babies.

Almost one year ago, I was discussing some serious flows in one of the application to his lead programmer who was also part of architecture and in fact was only “subject expert” available at time of idea conceiving and execution.
When I point out issues with architecture, he become little defensive and used the metaphor that a child cannot run from his first day. Things will improve with time. I tried to use the opportunity to tell him than if a child is born with bone disease, we cannot prepare him to run to fastest 100 meter run. He was really hurt with my statement. He was behaving like someone has pointed fingers at his own real child.

We need to understand that treating your projects like your real baby is a way to disaster. Projects got some specific objectives. If those objectives are not being met and current architecture does not support any way out, then we may need to discard them. So, we can start fresh. It may be difficult but only viable option for future use.

Love your projects, care for them, but understand that your projects have a purpose. … And this ‘purpose’ is the ultimate reason. Care for it.

2 things you should never do as a programmer

By   | on June 5th, 2014

You will find lots of guides and articles on the internet about what you should do to be a good programmer. A lot has been written on what we should do to excel in any field.

In my view, its not only what we do which make us good in our profession. It mostly depends on what we should not do which make us excel at our work.

In this article I am making short list of two things which any programmer should not do.

1. Stop Reading about new things

If you think you know a lot about programming because you are an expert in one of the so called mother language, then you are making a big mistake. Even languages which were marked as stable and labelled as mother languages like c and c++ are changing a lot. At least new libraries and being added to them. So you should never stop reading about new things. Subscribe to few good magazines or journals, even if you do not have time to read all articles and magazines. You will be at least aware of what is going on around.

2. Coding before architecture

Never start coding before deciding on the architecture of your application. Its a huge mistake many new comers as well as so called experience people do. I can tell you from my experience in projects, its architecture which makes a project success or failure. Starting code before taking decisions and making plan for project execution is like going for ride when you really dont know where to go. Read about design patterns. They are documented solutions for common problems. Try to use them.


What are some limitations of PHP?

By   | on August 12th, 2013

Recently I answered a question on quora. I am reproducing it here again.

In my view question is not complete and does not provide context which has to be evaluated to answer.

So I am writing this answer based on two assumptions.

First of all I am assuming that questioner is evaluating few programming languages and wants to make a decision which language to use or learn?

One of the major feature of PHP is also its biggest limitation. It is loose type and does automatic data type conversion in most of the situations. It does not force you to be good. You can easily write a bad code and it will not give you any warning or notice, but this does not mean that you can not write good code in PHP. So if you ever found a good PHP programmer, praise him/her because he/she is doing good programming without being under a hunter of strict compiler or interpreter.

PHP is more suitable for web development and shell scripts (yes it is quite good at command prompt also). You should not consider this for desktop applications. PHP-GTK is available but still far away from being productive. So one limitation is lack of desktop application development support. You can also not do mobile programming although you can run PHP on an Android device start [PHP for Android]

PHP supports almost all good features and data types but it does not force you to use them (.. and falls back to default behavior) which sometimes can be source of bug introduction in your applications.

As far as leaning is concerned, PHP is easy but I will suggest learning another strong typed language like C or Java along with PHP (at least basic knowledge must be there) if you really wants to go to a good level in programming.

Second assumptions, I am making that questioner wants to gather points to do fight with the PHP guy on the block, in that case I would suggest, Please do not waste your time, No language is without some shortcomings in some specific context.

So choose your language based on your need. PHP is best in some cases and worst in some cases

PHP is growing and is on a fast lane in new features introduction, so we can hope that it will extends its reach to more different verticals in near future.

Drupal vs Zend : which one should be used for application development?

By   | on March 4th, 2013

“You have done that specific site in Zend, don’t you think our application is also suitable for Zend instead of Drupal”, I just got this email from a prospective client.

This question has been asked to me many times. I am a big fan of Drupal as well Zend, so this question always put me in my difficult zone. As I know both, I really can not take a stand against any one of them. Technically speaking, both are capable of handing any kind of project, although both have their pros and cons.

There is proverb, “All roads leads to Rome”. This same anatomy can be used in the tech decisions, if you are adamant about a technology you can do anything in that. Its just a matter of time and money, in short we can say its matter of resources. So I really can not state that a ‘particular’ task in not possible in Drupal or Zend. I can only state how much time a task will take in Drupal vs Zend or vice versa.

Lets try to analyze some of the common benefits of using Drupal and Zend. We will try to see which kind of application is suitable for Drupal or Zend.

Zend is a framework which provides MVC structure and many libraries to work with different components and services. These components and services allows you to build an application with ease. You can keep your concentration on the business logic and requirements of application instead of worrying about underline technical details of functional implementations.

Zend gives you a structure where you can implements many design patterns which you may have read in design pattern books. Using Zend you can directly use those classy patterns (thus takes benefits of them) in your applications without writing low level implementation code.

I am trying to enlist few requirements of  almost all applications and my views on them in regards to Drupal and Zend

Time frame

Turn around time for Zend application is usually higher than Drupal applications. In Drupal you have a running CMS with lots of available modules which  gives you functionality out of the box. So on time frame front Drupal scores really high.

Zend applications has greater control over design aspects as it is programmed from scratch. Drupal on the other hand has a defined structure of elements which needs to used in certain ways. If you want to get rid of those structures, you may loose some benefits of drupal framework. Here Zend scores higher points as compared to Drupal, although a good designer with programmer support or programming knowledge can do wonders with Drupal. CSS manipulation is quite easy with Drupal.

Features Development

On this point, Drupal scores really higher as compared to Zend. Drupal has more than few thousands modules with different kind of functions. It also has concept of Site or Installation profiles where you can get a set bunch of modules for a particular use.

Zend on other hand is only a framework with libraries, it can help you to build applications but it can not gives you out of the box solutions. Zend version 2 has taken a big leap in this direction as module framework has evolved a lot with this release. So we can hope for some great modules in near future (We are also working on some such modules at our company which we will release in near future). There is another aspect of this feature, Drupal while having lots of modules also confuse potential customers or developers. They normally needs to do some hit and trial before they can get a good usable module.


When it comes to branding, Drupal scores less than Zend. Drupal being a CMS does have less respect in eyes of policy makers as compared to one which Zend enjoys. Zend seems to be perfect tailored solution while Drupal comes as something modified/managed solution. This is something which is beyond any technical explanation. So I will keep my views on this point with myself only. Just to state, I did not like such kind of perception building, but you can never argue with policy makers or people who has powers to take decisions.


As time frame is better with Drupal, it is obviously cheaper to build than Zend applications.

Most important factor in Drupal vs Zend decision is the requirement document of the application in hand. For example, application may be quite unique in its requirements, and you may not have any available module for it in Drupal. In this case, you loose time frame benefits.

So final decision should be taken with care with consultation with client.


I have given following reply to my this client

We have worked with both Zend and Drupal for different projects. In some projects we have even used both Zend and Drupal together.

Actually tech decision depends on many factors like budget, cost, clients internal policies and application requirements. Zend is a framework, while Drupal is also a CMS with good framework for a foundation of good application. Different modules also supports us. As I have mentioned in my estimation email, we are also going to get benefits of our earlier work on similar things.

In your application structure, Drupal is perfect choice. Having said that I would like state that your project is also doable in Zend, but in that case we will loose the benefits of ready made modules and our earlier work.

Again, I will repeat ,we can handle both, but economically and time wise Drupal is best choice for you if you do not have issues with its GNU  GPL license.

Why randomization is a difficult algorithm to implement?

By   | on March 4th, 2013

If you are doing programming, You must have used random numbers. They are useful in many situations when you want to give some randomization to your program output like lottery draw, random banners generation, random user display etc.

In PHP rand function is being used to generate random numbers, but is it really random number generator? Take a look at the following code.

< ?php

print rand();


What this function will do? If you are thinking that it will produce 50 random numbers, you just need to run this code. It is very likely that you will get the same number fifty times. Why rand function is not generating random numbers? Lets me introduce another function srand which is short for seed rand or seeding rand.

What is seeding? seeding in random number generation is they key to uniqueness. If you are not feeding a good seed to your random number generator, you are out of luck.

Why it is so difficult to implement random number generation algorithm?As per definition of algorithms, they are set procedures to solve a given problem. they can be repetitive and usually they are consistent in number of steps, in short they have a pattern. Random number on the other hand are supposed to break pattern. Random number generation is actually finding a pattern which should output a result which should break pattern. Thats why it is difficult.

Seeding is important to random number generation. Many algorithms even require more than one seed to do generate better random number.

In computer science, we are normally dealing with pseudorandom random numbers. Liner congruential generator also known as LCG is one of the oldest and best-known pseudorandom number generator algorithms