Tuesday, May 7, 2013

Funny comments



Recently while browsing, I encountered a question at stakoverflow which asks for “What is the best comment in source code you have ever encountered?". It has a long list of funny list. I am just copying few of my favorite.
Exception up = new Exception("Something is really wrong.");
throw up;  //ha ha
// Autogenerated, do not edit. All changes will be undone.
// sometimes I believe compiler ignores all my comments
// I dedicate all this code, all my work, to my wife, Darlene, who will
// have to support me and our three children and the dog once it gets
// released into the public.
// drunk, fix later
// Magic. Do not touch.
#define TRUE FALSE //Happy debugging suckers
// I'm sorry.
return 1; # returns 1
/* This is O(scary), but seems quick enough in practice. */
Catch (Exception e) {
 //who cares?
}
/**
 * Always returns true.
 */
public boolean isAvailable() {
    return false;
}
                /*
 * You may think you know what the following code does.
 * But you dont. Trust me.
 * Fiddle with it, and youll spend many a sleepless
 * night cursing the moment you thought youd be clever
 * enough to "optimize" the code below.
 * Now close this file and go play with something else.
 */
try {

} finally { // should never happen

}
const int TEN=10; // As if the value of 10 will fluctuate...
long long ago; /* in a galaxy far far away */
//This code sucks, you know it and I know it. 
//Move on and call me an idiot later.
// If this comment is removed the program will blow up
double penetration; // ouch
// I don't know why I need this, but it stops the people being upside-down

x = -x;
// I am not sure if we need this, but too scared to delete.
# To understand recursion, see the bottom of this file

At the bottom of the file:
# To understand recursion, see the top of this file
// I am not responsible of this code.
// They made me write it, against my will.
/* Please work */
//private instance variable for storing age
public static int age;
/* You are not meant to understand this */
//I am not sure why this works but it fixes the problem.
// I will give you two of my seventy-two virgins if you can fix this.
// no comments for you
// it was hard to write
// so it should be hard to read
// I have to find a better job
last = first; /* Biblical reference */
int MyFunction()
{
    // There once was a man named Dave
    int Result = 0;

    // Whose code just wouldn't behave
    MyObject *Ptr = new MyObject();

    // He left to go to a meetin'
    Result = Ptr->DoSomething();

    // And left his memory a leakin'
    return Result;
}
} catch (PartInitException pie) {
    // Mmm... pie
// This comment is self explanatory.
try {

}
catch (SQLException ex) {
    // Basically, without saying too much, you're screwed. Royally and totally.
}
catch(Exception ex)
{
    //If you thought you were screwed before, boy have I news for you!!!
}
virgin = 0;     /* you're not a virgin anymore, sweety */
public boolean isDirty() {
    //Why do you always go out and
    return dirty;
}
// TODO: Fix this.  Fix what?
                Repeat
    ...
Until (JesusChristsReturn) ' Not sure
if (/*you*/ $_GET['action']) { //celebrate
// I can't divide with zero, so I have to divide with something very similar
result = number / 0.00000000000001;
//Mr. Compiler, please do not read this.
'NO COMMENT
catch (Ex as Exception)
{
     // oh crap, we should do something.
}
                -- Comment this later
/** Logger */
private Logger logger = Logger.getLogger();
$you = live("free") or die("hard");
if (case1) { // trivial
...
}
else { // we are screwed
 /* fill in later */
}
'CANNOT JUST QUIT!

Monday, May 6, 2013

Monday, April 22, 2013

Office Space and Agile



Your working space is a big factor in your productivity
– Indian saying

For a productive Agile, working space plays a big role. Let me list few of the demands from Agile friendly space should be:

1.       Ergonomic and Aesthetic Appealing: Persons doing work should feel satisfaction from space itself. Working space should also aesthetic appealing to enhance feeling of satisfaction. Working space should have:
a.       ergonomic furniture;
b.      abundant natural light and live plants;
c.       adequate air circulation;
d.      acoustic comfort. Agile work space may become very noise due to open layout and proximity of several persons;
e.      option so that each team member should have freedom to personalize his/her working area. People love personal space;
f.        convenience. People pay for convenience, that’s why residential properties near public transport are costly. Washrooms, coffee, printers, scanners, mail room, and other common services must be easily accessible. The team should not be set off and isolated far away from everything else;
g.       visibility to outsiders. So when they are visiting, can have opportunity to interact with pigs;
h.      bigger screen and docking stations for those carrying laptop;
i.         some play and creative area to do some physical exercise;
j.        large wall clock to keep track of standup and other meetings and appointments.


2.       Promote collaboration: Whole concept of Agile is based on collaboration or I should say – continuous collaboration. To promote collaboration, working space should
a.       be configured in such a fashion that each team member can communicate with other team member without getting up and walking;
b.      not hinder free movements of team members;
c.       have one place in middle where intra and inter team mates can converse in informal manner. For intra team this can be achieved by having meeting table in center of team room. For inter team, various teams can be arranged at periphery of kitchen or washrooms;
d.      have lot of white boards and charts in vicinity of team members desks;
e.      have product backlog/Kanban board in vicinity of team members desks;
f.        have food and drinks near to each team’s working desks apart from kitchen;
g.       have additional feedback tools like a siren to indicate build failure or buzzer to indicate successful execution of automated test suite;
h.      have access to conference rooms without struggling with availability;
i.         have wireless internet to free up from wire clutter;
j.        have ample electrical inlets to plugin laptops, phones, etc;
k.       have a few big paper calendars (monthly views) that can be written on;
l.         have digital camera to document white board. This requirement is highly diminished because of availability of phone camera;
m.    have only team members (pigs) in working space. Others (chickens) may have separate working space;
n.      have supporting staff (like HR personnel, coordinators, etc.) nearby by sufficiently away from team.

3.       Privacy and Private work area: Though humans are social animals but also need privacy and require quite place to do intense work.
a.       Each team member must have quite space for intense work and for private conversations – a phone from spouse. This can be achieved by providing a separate cubicle away from work space or providing separate mini conference room.
b.      Teams also need its own private working area. Teams can be shielded by each other’s using white boards or projection screens.
c.       Place seats of product owners, scrum masters near gate, so any new person entering into workspace will interact with them and rest of team (pigs) live in peace. Let chickens handle the world. This requirement is not in contradiction with 1.g but over ridding to minimize the disturbance.
d.      Each team members must have space/cabinet/drawer to keep his/her personal stuff.

Apart above wish list, working space must be configurable to rearrange it if team felt it so.

To promote collaboration among tem members, with my experience, I certainly recommend having regular potluck (each team member brings up food and share with other). Sharing food has big positive effect on team collaboration.