Friday, December 31, 2010

Don't be in love with programming language

If you are like me, who does programming for living, if you are very passionate about one language and would never ever think of switching to any other language?

Then this blog post if for you.

During my engineering days, i was very passionate about C++ and only C++ (does not mean that, I am any less passionate about C++ today). I wanted to do programming only in C++. I thought I can do anything and everything in C++. But i had no idea there exists a altogether different world outside C++ ecosystem. I was very apprehensive to do programming in any other language.

Then during my final year summer break i read Java after lots of coersion from my friend ovais. And i started appreciating java because of its clean pointer-free syntax. It does not mean i am scared of pointers but that now i can be more focused on problem solving. How elegantly it does memory allocation and garbage collection etc. I started appreciating the high productivity I could get using Java.

Than i joined TRDDC and went on writing java code for more than 2 years. But meanwhile i got interested in distributed computing and machine learning stuff. And while reading machine learning blogs, python piqued my interest. I did a little bit of python on my own and realized the power of dynamic language. But real power of dynamic language dawned to me when i started using ruby and rails.

In a week long bootcamp at Thoughtworks i also touched the basics of C# and realized it is actually very similar to java and i was productive in less than 1 hour. In last one year i have also done some hello world kind of stuff in erlang, clojure.

All in all, learning each language has given me a different perspective to think about the problem i am solving. It introduces me to a altogether different world like ruby ecosystem is full of gems and if you don't like certain gem fork it on github and make changes as per yours wish. .Net world is very organised and Microsoft provides a very rich API set and also they have done a tremendous job in building their visual IDE. Java has largest ecosystem with big communities like apache, eclipse and corporates like oracle, IBM, Google.

Loving one programming language means you will miss the other worlds. Moreover most of these language implement same concepts i.i OOPs. So moving from one to other should be a fun journey of comparison and discovery of little variations of same concept.

Thats why i say Don't be in love with programming language, love concepts ;-)

With this note i close the 2010. Hope to learn more concepts in 2011.


karoge yaad to

karoge yaad to har baat yaad aayegi
gujarte waqt ki har mauj tahar jayegi
karoge yaad to

ye chaand beete jamaano ka aaina hoga
bhatakate abar mein chehara koee bana hoga
udaas raah koee daasta sunayegi
karoge yaad to

barashta bheegta mausam dhua dhua hoga
pighalti shammo pe girta mere gumaa hoga
hatheliyo ki heena yaad kuch dilaayegi
karoge yaad to

gali ke mod pe suna sa koi darwaza
tarashti aankhon se rasta kisi ka dekhgega
nigaah duur talaq ja ke laut aayegi

karoge yaad to har baat yaad aayegi
gujarte waqt ki har mauj tahar jayegi
karoge yaad to

Sunday, December 26, 2010


ye na thee hamaree qismat ke wisaal-e-yaar hota
agar  aur  jeete  rehte   yahee   intezaar  hota

tere  waade par jiye ham  to ye jaan jhoot jana
ke  khushee se  mar na jaate  agar eitabaar hota

koi mere  dil se pooche tere teer-e-neemkash ko
ye KHalish kahaaN se hotee jo jigar ke paar hota

ye kahaaN ki dostee hai ke bane haiN dost naaseh
koee  chaarasaaz  hota,   koee  GHamgusaar  hota

rag-e-sang se Tapakta wo lahoo ki fir na thamta
jise GHam samajh rahe  ho, ye agar sharaar hota

GHam agarche jaaN_gulis hai, pe kahaaN bachaiN ke dil hai
GHam-e-ishq    gar   na   hota,    GHam-e-rozgaar    hota

kahooN kis se maiN ke kya hai, shab-e-GHam buree bala hai
mujhe   kya   bura   tha   marna ?  agar  ek   baar  hota

hue mar ke ham jo ruswa, hue kyoN na GHarq-e-dariya
na  kabhee janaaza  uThata, na  kaheeN  mazaar hota

usse  kauN  dekh  sakta  ki yagaana  hai wo yaktaa
jo dooee ki boo bhee hotee to kaheeN do chaar hota

ye   masaail-e-tasawwuf,  ye  tera bayaaN  'GHalib'!
tujhe ham walee samajhate, jo na baada_KHwaar hota

Saturday, December 25, 2010

Possible reasons why you don't write test

If i have to choose the biggest thing i learnt in 2010, then it would be Test Driven Development. Before i joined ThoughtWorks (we are hiring) i had just heard of it and never realized how important it is to write code and know that it works for X condition for sure. Now it freaks me out that lots of people dont write test .
There could be several reasons for not writing test.

  • It takes too much time.
  • It is not worth it.
  • I am too lazy.
  • I don't know how to do it.
  • I know my code works because i ran it once and it worked
  • I am a superhero, i don't make mistakes.
Unless your answer is last one (in which case i envy you) you should start reading more about testing and TDD.
Best resource to begin with is TDD by Example..

Sunday, December 19, 2010

ghalib ke andaaz

Yeh chamanzaar, yeh jamuna ka kinara, yeh mahal
Yeh munaqqash dar-o-dewaar, yeh mehraab yeh taaq
ek shahenshah ne daulat ka sahara lekar
hum garibon ki mohabbat ka udaya hai mazaak
meri mehboob meri mehboob,
meri mehboob kahin aur mila kar mujhse


First of all, a big big thanks to ubuntu team and ubuntu is an amazing distro and they have single handedly made linux experience so awesome. I was using it for past 2 years and never i had any issue with it. 
But recently Ubuntu released natty narhiwal 11.04 alpha 1 and i upgraded to it on the first day. And it created hell lot of problems. They switched to a new window manager unity which i found to be very flicky and unstable. So i decided to take the pill . This weekend i finally installed a bleeding edge distro .. the distro for geeks and nerds .. yeah you are absolutely right its GENTOO
Its not the first time i have installed gentoo i was a ardent fan of of gentoo in my engg days and probably the only guy who installed a non  GUI-installer based linux.
Working on gentoo gives you a lot more inside info which i really like .. my basic OS installation is ready and now i guess i will need to create a overlay to maintain my favorite ebuilds ... okay time to go figure overlay stuff.

Monday, December 6, 2010

recover git-svn clone after it gets interrupted

I keep running into this problem especially when the repo i am cloning is huge or the network is flicky. Before this i had no idea how to pickup the process from where the network problem happened so i use to delete the repo and re-clone the entire thing from the start. But this is a extremely frustrating and waste of time.

Fortunately, this is not necessary; just go into your partially retrieved git-svn repo and execute git-svn fetch. This continues fetching the svn revisions from where you left off.

# git svn clone git://url/project.git
..... connection breaks :(
#move to project directory
# cd project
# git svn fetch
.. fetch continues from where the connection was lost

This works like butter but if you gets a empty directory after git-svn fetch completes. Don't worry, just rebase hard the project

# git rebase --hard

and you are ready to code next generation features in the project you donwloaded ;-)


Support WikiLeaks

I am truly shaken from the ferver attempts with which American govt has tried to intimidate Wikileaks. They wants to crush transparency and silence the debate on the issues raised by the leaks.

In 2007 the median number of Iraqi civilians deaths due to the invasion estimated by the American public was 9,890. The minimum number credibly reported was over 40,000 and other studies have come up with estimates ranging from 200,00 to 700,000. This excludes the many hundreds of thousands of children who died from malnutrition during the preceding embargo. These, the consequence of silence and secrecy.

“In March 2006, after an afternoon of card playing, sex talk and drinking Iraqi whiskey, Pfc. Green and three other soldiers went to the home of 14-year-old Abeer Qassim al-Janabi near Mahmoudiya, about 20 miles south of Baghdad. Green shot and killed the teen's mother, father and sister, then became the third soldier to rape the girl before shooting her in the face.” (MSNBC).

The recent WikiLeaks points to a consistent policy of allowing mercenaries like Blackwater to murder innocent Iraqi civilians and remain unpunished. It is these and the many stories of innocent Iraqi deaths that should be told all over the world. The lack of information on these events has allowed western society to lose its moral compass on the true human cost of the aftermath of 9/11. The release of these documents should be resulting in war crime charges and a sense of revulsion in every city of the world.

I urge you to support WikiLeaks.