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

Executing MapReduce Applications on Hadoop (Single-node Cluster) - Part 1

Okay. You just set up Hadoop on a single node on a VM and now wondering what comes next. Of course, you’ll run something on it, and what could be better than your own piece of code? But before we move to that, let’s first try to run an existing program to make sure things are well set on our Hadoop cluster. Power up your Ubuntu with Hadoop on it and on Terminal (Ctrl+Alt+T) run the following command: $ start-all.sh Provide the password whenever asked and when all the jobs have started, execute the following command to make sure all the jobs are running: $ jps Note: The “jps” utility is available only in Oracle JDK, not Open JDK. See, there are reasons it was recommended in the first place. You should be able to see the following services: NameNode SecondaryNameNode DataNode JobTracker TaskTracker Jps We'll take a minute to very briefly define these services first. NameNode : a component of HDFS (Hadoop File System) that manages all the f...

5 things to do when you cannot trace a bug

Programming today, is more about fixing existing code than writing new. In most of the cases, bugs are easy to trace, especially when you are using a modern IDEs like Eclipse or Visual Studio. However, it is very likely that you get trapped in situations like a specific button not doing anything, application crashing randomly,  or a record not updating for a specific ID. Here are some tips you may find lifesavers if you get jammed too often when debugging your code: Catching random errors Remember, there are no random errors unless you are calling a random function. The code is always consistent, if a function calculates compound interest of an amount over a certain period of time -- within an allowed range -- correctly, it will never do it wrong as long as the parameter values are in range. So, the code is consistent. Data, however, may not be. Here is an example: public boolean saveRecordInDB (int id, String name, float height, float weight) { // Do something } Test: ...

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 t...