Skip to main content

Story of a code review

To whom it may concern

کل جو بیٹھے Junior کا Code Review کرنے ہم۔
قہر بن کر ہم پہ ٹوٹی وہ بلائے شامِ غم۔

کھول کر دیکھا جو I.D.E پہ اس عفریت کو۔
یعنی بے ہنگم سی Lines of code کے سنگیت کو۔

بھک سے سارا اُڑ گیا Experience مثلِ غبار۔
سر سے Leadership کا زائل ہوگیا سارا خمار۔

Spaghetti Code ہے، بریانی ہے، یا Soup ہے؟
ہم کہیں کھچڑی جسے۔۔۔ اُس کے مطابق OOP ہے۔

View اور Model میں کوئی ربط تک دکھتا نہیں۔
ایسے Java Bean مسٹر بین بھی لکھتا نہیں۔

گاہے گاہے گر Design change ہی مقصود تھا۔
نام Project کا عزیزم کیوں نہ پھر گرگٹ رکھا؟

Task میں لکھا کہیں بھی فائلیں بھرنا نہ تھا۔
کیوں لکھے بے کار Method کال جب کرنا نہ تھا؟

ایک گھنٹہ پی گیا Function جو اک بہروپ تھا۔
ہم Recurrence سمجھے بیٹھے۔ Nested وہ Loop تھا۔

ہر جگہ پر ٹھونسنا Maven کی Nature کفر ہے۔
شرع پروگرامنگ میں ایسا Architecture کفر ہے۔

اک منٹ! یہ کیا کہا میں نے۔۔۔ کہاں ہے کفر ادھر؟
کفر ہی ہوتا مگر ہے Architecture ہی کدھر؟

Role جس کا Guest تھا Access دیا سارا اُسے۔
تھا جسے Encrypt کرنا، Hash کر مارا اُسے۔

جانے کیسے سانس لے گا Live Server زیر بار۔
ایک Package، دو Classes اور سطریں دس ہزار!!!

یہ پتا چلتا ہمیں Function کے پھیلاؤ سے ہے۔
As is چھاپا ضرور Stack Overflow سے ہے۔

صد مشقت سے نتیجہ لایا جب Compiler۔
لال پیلی Warnings کا ڈھیر تھا پیشِ نظر۔

چل رہی ہے Back-ground میں کہیں ماں کی دعا۔
کھانستا، لنگڑاتا، روتا Code آخر Run ہوا۔

ایک بھی Exception ہونے نہ پائے گی فرار۔
چوکیاں ہیں Try-catch اور Finally کی خار دار۔

Catch جب ہوجاتی Exception ہے تو Throw کیوں کریں؟
تو بتا ہمدم کہ اس منطق پہ روئیں یا ہنسیں؟

بالیقیں کہتا ہوں پڑھ لیتی جو Debug Trace کو۔
قلب کا پڑ جاتا دورہ Ada of Lovelace کو۔

یا الہی میری توبہ اب کبھی ڈالوں نظر۔
اس قسم کی مشق سے آئیندہ سو بار الحذر۔

Comments

Popular posts from this blog

A faster, Non-recursive Algorithm to compute all Combinations of a String

Imagine you're me, and you studied Permutations and Combinations in your high school maths and after so many years, you happen to know that to solve a certain problem, you need to apply Combinations. You do your revision and confidently open your favourite IDE to code; after typing some usual lines, you pause and think, then you do the next best thing - search on Internet. You find out a nice recursive solution, which does the job well. Like the following: import java.util.ArrayList; import java.util.Date; public class Combination {    public ArrayList<ArrayList<String>> compute (ArrayList<String> restOfVals) {       if (restOfVals.size () < 2) {          ArrayList<ArrayList<String>> c = new ArrayList<ArrayList<String>> ();          c.add (restOfVals);          return c;       }       else {          ArrayList<ArrayList<String>> newList = new ArrayList<ArrayList<String>> ();          for (String

How to detach from Facebook... properly

Yesterday, I deactivated my Facebook account after using it for 10 years. Of course there had to be a very solid reason; there was, indeed... their privacy policy . If you go through this page, you might consider pulling off as well. Anyways, that's not what this blog post is about. What I learned from yesterday is that the so-called "deactivate" option on Facebook is nothing more than logging out. You can log in again without any additional step and resume from where you last left. Since I really wanted to remove myself from Facebook as much as I can, I investigated ways to actually delete a Facebook account. There's a plethora of blogs on the internet, which will tell you how you can simply remove Facebook account. But almost all of them will either tell you to use "deactivate" and "request delete" options. The problem with that is that Facebook still has a last reusable copy of your data. If you really want to be as safe from its s

A step-by-step guide to query data on Hadoop using Hive

Hadoop empowers us to solve problems that require intense processing and storage on commodity hardware harnessing the power of distributed computing, while ensuring reliability. When it comes to applicability beyond experimental purposes, the industry welcomes Hadoop with warm heart, as it can query their databases in realistic time regardless of the volume of data. In this post, we will try to run some experiments to see how this can be done. Before you start, make sure you have set up a Hadoop cluster . We will use Hive , a data warehouse to query large data sets and a adequate-sized sample data set, along with an imaginary database of a travelling agency on MySQL; the DB  consisting of details about their clients, including Flight bookings, details of bookings and hotel reservations. Their data model is as below: The number of records in the database tables are as: - booking: 2.1M - booking_detail: 2.1M - booking_hotel: 1.48M - city: 2.2K We will write a query that