MTA Logic

image

Morning. Everything is covered with ice about a quarter inch thick. Platforms essentially became skating rinks. Metro-North workers heroically clean platform…  on New Haven-bound side, which will not be used for the next few hours while passengers on New York side are risking falls.

Ads

Descriptive comments

When you write code, you need to comment it so that when you or somebody else comes back to this code few years/months/days/hours from now, they will be able to figure out what the code does. Here is the comment I saw one of my interns write:

// This function divides Numerator by Denominator

Really? I thought numerators and denominators are usually multiplied!

The price of being polite.

Few weeks ago I stopped by a Barnes & Noble store to see what I can use my gift cards on. I stop at the Nook counter (which in most stores you bump into as soon as you open the door) to look at one of the functioning units (they finally replaced the pieces of paper they used to have before). I have been thinking of buying an electronic reader for a while, and Nook is the leading candidate.
As I stand there getting ready to interrogate a sales associate, some older guy comes up behind me. I figure I better let the guy go first, given that I am planning to go over all features of the Nook. The first thing the guy asks is whether or not they have Nooks in stock. Sales associate answers that they will not have them in stock until February 1st, which is what I have heard many times. “However”, continues the associate, “we have one unit at the registers because somebody ordered two units but kept only one”. As my jaw is dropping to the floor, the older guy walks over to the registers and buys the unit.

No, they did not have any more of “returned” units.

Yes, next time I will NOT let the guy ahead of me.

And also, next time I’ll have to break the guys legs so he cannot make it to the register.

PS: For those w/o sense of humor – my statement of intent of breaking the guy’s legs and not letting somebody ahead of me is a joke.