Code Reviews

Written by Manas Jul 06


Code Review Cartoon

Code Review Cartoon

For those who don’t know, code reviews, as the name suggests, is going over the code you have written before you incorporate it into your product. Oh – I should have mentioned – you don’t review your own code – you get someone to review it for you. The primary purpose is to find bugs.

Though many folks look at code reviews as just another process overhead (we all write perfect code, don’t we ;), I find code reviews very intellectually satisfying.

So, when someone reviews your code, you roughly follow the following steps:

1. Ask someone to review your code
2. Get review comments
3. If no comments, either you wrote great code, or (greater chances) the reviewer did not review it very thoroughly. Consider going to step 1. If really sure, Goto step 6.
4. Discuss comments, make changes as necessary
5. Goto step 1.
6. Done!

If you are a new developer, or writing a big chunk of code, chances are that you’ll loop through this multiple times before your reviewer is completely satisfied.

As a new developer, at times people tend to take review comments personally – it’s natural. It is important to understand that code review comments are to be taken personally only if you get the same comment more than once. Code review comments are one of the best ways you can refine your coding skills. If you admire someone’s coding skills, ask them to review your code. Don’t be overly defensive – as I mentioned before – code review comments are not personal. Learn from them – and be a better developer! If you’re lucky, your reviewer will also look at the class structure instead of just the individual statements. You’ll improve upon you design skills too. And of course, you’ll introduce fewer bugs into your product.

On the other side, doing code reviews for someone is also an enriching exercise. Things when performing a code review -

1. Find bugs. Make it a fun exercise. You’ll find a bug if you look hard enough. It just has to be there :)
2. Learn from the patterns your fellow developers are using – especially true when reviewing code of experienced developers.
3. Understand components that you don’t work with on a day to day basis.

Personally, I find code reviews fun and exciting. And luckily, I have a great set of folks who do great code reviews, and give out great code to review.

Hope you enjoy it like I do!

Solving the world’s energy problems

Written by Manas Aug 25

I know the title sounds boring, but just listen up, and tell me what you think.

We’ll build the WWWoE – World Wide Web of Energy. The WWWoE would be a worldwide network of energy transfer. This is how it would work:

1. Anyone would be able to connect to the WWWoE through a service provider.
2. You’d be able to consume energy, as well as supply energy to the WWWoE. You get paid for the energy you supply, while you have to pay for the electricity you consume.
3. Electricity generated by any mode can be supplied to WWWoE. It could be solar energy, wind, or a nuclear power plant.
4. The network stretches across continents.

 

Lets look at the reasons why this will be successful:

1. Highly distributed - You use solar power from the other side of the globe at night, or when it is cloudy
2. Highly distributed – If the neighbourhood power plant shuts down, you still get electricity
3. Highly distributed - regions with surplus energy can sell it off to make money
4. Scalable – Anyone ranging from an individual to a government can participate – every solar panel / windmill / generator / power plant counts
5. Economically attractive – Opens up a clean new way for folks owning farmland to produce electricity and sell it off
6. Guarantee of Service – Country A cannot put country B into darkness because the system is so distributed.

In short, we’re looking at an analogy of the internet. One big issue I can think of is energy losses while tranferring it from one continent to another. How is the superconductor research coming along?

Inventions Required

Written by Manas Apr 23

Has everything that could be invented been invented? Definitely not. There are so many things (or the lack of them) that bother me:

1. I hate batteries

Everything uses batteries – the laptop, the cell phone, the mouse, the electric shaver, the iPod, the wall clock, the remote, the UPS, the camera, cordless earphones… and something is always running out of battery. All the time. Not like batteries are good for the environment. We need a replacement. Now!

2. I hate battery chargers too

Why the heck do all chargers end up in a different shape at the end? No standard followed. 15 brand of cell phones have 15 different end connectors. Why do I need to own 7 different kind of chargers for different kind of devices? There should be one charger for all devices I own.

3. I wear glasses. So I can’t wear sunglasses?

Right. Photo-chromatic lenses make me look like I’m blind or something. And I’m not patient enough to maintain contact lenses. So I cannot wear swanky Ray Bans. Why don’t those swanky Ray Bans come with vision correction too?

Have more things that bother you? Feel free to comment!

Working with Microsoft

Written by Manas Feb 02

I was talking to my little niece today, and asked her how was she spending her vacations.

Little Niece: “I’m taking a computer basics course and also Bharatnatyam classes”.

Obviously not interested in Bharatnatyam, I asked her what is it that she was learning in the computer class.

Little Niece: “Windows, Paint and all”.

Aha! Windows, Paint and all! Thats my Microsoft! 

Me: “You know, I work with Microsoft”

Little Niece: “Hmmm.. Microsoft? So what? Even I work with Microsoft Word!”

That shut me up.

Crazy about movies

Written by Manas Jan 04

 

Movie Collage

Not knowing with what to do with the (however little) time I have in between my work and sleep, and being too tired to indulge in something that would involve more physical or cerebral activity (for example, soldering a new circuit or reading the latest Jhumpa Lahiri), I’ve chosen the most perfect of all lazy hobbies – watching movies.

The more I watch them, the more I feel that there is so much in the world to see, read, and to experience. You can look at the tiny bylanes of Tehran where you can buy freshly baked Naans in Children of Heaven,  or experience the concentration camps in La Vita e Bella or Schindler’s list. You can admire a pretty but introverted girl in Amelie, or watch boxers struggle in Million Dollar Baby or Cinderella Man. You develop a crush on Arwen (wiki) in The Lord of the Rings, or on Holly in Breakfast at Tiffany’s but then you cannot expect to ever see them in real life.

Sometimes while watching a movie, just like a good book, I don’t want it to end – and sometimes I pray for the ending to be a happy one. I wonder what the characters in the movies do after the movie ends – do they live life with the same zeal, or do they become more laid back, now that we’re not watching them anymore?

I wonder.

Watching (nice) movies feeds my lust for creativity, and is a great way to end a tiring, crazy day at work.

A Busy Day

Written by Manas Sep 18

Yesterday was a helluva busy day! I was just seeing my sent email, and was amazed to see what I’ll show you. These are the timestamps of all the emails that I sent yesterday. If you examine carefully, you can make out from what time till what time I slept, and what time I went home from office :)

Wed 11:55 PM
Wed 11:40 PM
Wed 11:37 PM
Wed 11:31 PM
Wed 11:10 PM
Wed 10:58 PM
Wed 10:54 PM
Wed 10:37 PM
Wed 10:26 PM
Wed 10:08 PM
Wed 9:51 PM
Wed 9:38 PM
Wed 9:34 PM
Wed 9:32 PM
Wed 7:52 PM
Wed 7:05 PM
Wed 6:49 PM
Wed 6:48 PM
Wed 5:55 PM
Wed 5:09 PM
Wed 4:48 PM
Wed 3:56 PM
Wed 3:11 PM
Wed 3:01 PM
Wed 2:49 PM
Wed 2:49 PM
Wed 2:34 PM
Wed 2:27 PM
Wed 2:25 PM
Wed 2:22 PM
Wed 1:54 PM
Wed 1:26 PM
Wed 1:15 PM
Wed 1:09 PM
Wed 12:37 PM
Wed 11:04 AM
Wed 10:53 AM
Wed 10:52 AM
Wed 10:32 AM
Wed 10:32 AM
Wed 10:25 AM
Wed 10:18 AM
Wed 8:21 AM
Wed 1:28 AM
Wed 1:26 AM
Wed 1:18 AM
Wed 1:16 AM
Wed 1:16 AM
Wed 1:15 AM
Wed 1:11 AM
Wed 1:06 AM
Wed 1:04 AM
Wed 12:53 AM
Wed 12:51 AM
Wed 12:48 AM
Wed 12:46 AM
Wed 12:41 AM
Wed 12:35 AM
Wed 12:32 AM
Wed 12:31 AM
Wed 12:28 AM
Wed 12:22 AM
Wed 12:21 AM

No wonder I don’t blog anymore!

Fresh Apple

Written by Manas Aug 09

Think about an Apple.

No – not the brand. I mean the fruit.

Think about a red, shiny, fresh apple, plucked from a green tree. Doesn’t it look good? This apple is a bundle of sweetness – full of that magical juice that will fill your mouth once your teeth bite into its dark flawless red skin.

Now think what happens when this apple is attacked by ants.

The color of the skin changes from the pretty dark red to muddy brown, the pearly white core following suit. There are narrow paths carved all around the surface, and the ants devour any portion of the apple they seem to like, leaving a trail of destruction behind. They gather in hordes covering the once pretty surface of the apple with their black insect bodies. The apple is no more fit for your consumption, and you feel disgusted picking up the same apple you imagined enjoying every bite of a little while ago.

I’m on a flight just now, and I looked out of the window. I saw the land cris-crossed with roads, houses, and towns made by us on our planet.

It somehow reminded me of what ants do to the apple.

Fall of the PCO

Written by Manas Jul 08

STD-ISD-PCO. A small shop painted in bright yellow, with a couple of booths inside, where fans seldom worked, a table with a few displays and receipt printers. Throw in a couple of telephone instruments and a friendly operator and you have a PCO.

I still remember when the idea of PCOs came in – that was around 15 years back. They were an instant hit. By the way – do you know what does PCO mean? It stands for Public Call Office. ISD is International Subscriber Dialling and STD is Subscriber Trunk Dialling. Legacy terms, eh?

Anyways, those were the days when not having a telephone at your home was the default behavior, and neighbours or landlords calling you to receive a phone call was the norm. In fact, it was a given thing – one could always share their neighbours phone number with others and mark it as PP – I dunno what this PP meant.

When you had to make calls, it was a walk to the PCO around the corner, and wait for your turn – oh – I forgot the importance of timing. Calls after 9′o clock at night were half rate and after 11′o clock were quarter rate. By the way – peak hour call rates were as high as Rs 1.80 per 6 seconds (for distances > 500 km)! Sounds like a dream right? Talk about monopoly!

Anyway, the mobile phone came, the Telecom revolution happened, and everyone got a cell phone. Visits to the PCO became rarer. PCO owners switched to selling recharge coupons for mobile phones. Good riddance!

A childhood memory – episode 4

Written by Manas May 24

This one is about my reading table.

My dad actually got it made for me when I was around 6/7 years old. It was proper wooden, and when it was time to choose the top, my dad took me with him to the workshop where it was being built. I chose a light brown top, which I thought looked very impressive. This was in Lucknow, and I still remember that the place we went to was called Aliganj. There were chilly pakodas (bhajji) offered to us at the workshop, but I was not allowed to eat them because they were chilly pakodas, and I was just a little boy :)

When we got back home, my mom asked me how the table was shaping up. I told her that it was huge – it was enough for 5 people to study together, and the top looked like the foam on top of coffee. I was right about the top part – but no – no about the size. The table was meant for one person, the tiny me had imagined it to be very big :)

Interestingly, that reading table is still good, and is still the reading table of our house :). I never really studied on it, I have never studied on a table-chair, always on  the bed. When I was small, I used to use the space under it to set up my tent – indoor camping :P, or for setting up a small shop where I’d sell stuff stolen from the kitchen to my only customer – my mom :). When I was in class X/XI, I wrote all the physics formulas on the top with a permanent marker so that I could revise them just by glancing at my table :). Then when I had my first crush, I replaced the formulas with her name.

That reading table still sits proudly in my room at home (real home), and I long to see it again.

Here is a picture of it, taken when I used to stay at home (6 years back).

I ♥ MS

Written by Manas May 20

Don’t worry, I love you guys too!