I know the answer (it's 42)

A blog on coding, .NET, .NET Compact Framework and life in general....

November, 2006

  • I know the answer (it's 42)



    We all know that Hungarian notation is bad. That has been debated a thousand times and closed upon. It has been proven that having type information as the variable name can lead to trouble. Some nice examples are here and here.

    However, though most developers agree with the issues with type information in the variable name, there is some lack of clarity on the other aspects of variable naming. Like the m_ prefix. Many developers believe that it's ok to use m_ for non-public variables, especially because it can be easy to get confused between local and instance variables. Some even prefer just an underscore prefix.

    The .NET Fx guidelines and MS internal coding guidelines clearly calls out against it and so does tools like FxCop and StyleCop. The reason is simple; it looks ugly and has other repercussions. For example if one uses m_ for instance variables, then he might want to call out static variables with s_ and global variables (yea C# is exempt) with g_. So one falls into the same trap while changing a static to an instance variable or vice-versa.

    Moreover, these prefixes are simply not needed. The guidelines suggested way of using a this. prefix works much better, as you clearly use the this pointer indicating that the reference is to an instance variable. Topics like these turn into religious war during code-reviews or reviews of team wide coding guidelines. I personally believe that things like prefixes has no place in todays world of coding…

  • I know the answer (it's 42)

    The first Zune in India


    Actually that should be one of the first zunes in India, but hey what the ....

    Our dear AmitChat the resident gadget maniac got himself a Zune (nah, not the Brown one). This is sure to be one of the first Zune's to come into India. He got it from Redmond and costed about $260.

    That's me holding it with its smaller bro in the other hand ;). As they say bigger the better (I'm referring to the screen size :)

  • I know the answer (it's 42)

    IE 7 menu bar


    I'm using IE 7 for some time and lovin it.

    I had believed that IE has done away with the menu. Whatever functionality I needed were available through the Tools and Page split buttons in the toolbar and I always printed using Ctrl+P so I never felt the need of the Menu. However, I just found out some time back from Amit that when you hit the alt button the menu magically appears and then magically disappears!!!

    I have no idea what made the IE team come up with such a weird non-discoverable feature! Its so non-standard design. I understand the need of minimal UI and that WinForm enumerates the Alt key as System.Windows.Form.Keys.Menu but would've never figured out the association :)

    Update: Windows Explorer also behaves the same way. I have been using Vista for the last 9 months, but couldn't figure that out either. I'm actually feeling foolish for not being able to find out. Oh, hold on, doesn't making users feel foolish make a UI qualify as a bad UI :)

  • I know the answer (it's 42)



    When I visited USA for the first time I was surprised by the size of the servings. Specially the sizes of drinks (Starbucks starting from Tall :) ). I remember asking for a large Coke in a Panda Express outlet and was handed over a bucket of coke. In contrast here in India you get miniature size drinks, like the one I'm holding. It's a cup (??) of Chai

  • I know the answer (it's 42)

    Scheme of things


    Programming in Static OO languages for a long time numbs the brain. These languages are designed to be simple and efficient. These criteria not necessary create beautiful languages. In the world of C++, C# our imagination get severely restricted.

    Take for example the expression x + |y|. In scheme you can code this as

    (define (addAbs x y)
      ((if (> y 0) + -) x y))
    (addAbs 4 -5)

    The if expression is very interesting. It actually compares y with 0 and returns a operator (+ or -). Its simply beautiful :) 

  • I know the answer (it's 42)

    Program performed illegal operation. Let's call the police


    One of our Colleague's young kids were working on a computer when it popped up a message "Program has performed illegal operation and will be shut down". He got urgent call from his 9 year old daughter "Dad, does this mean that the police will come?".

    So next time you ignore a UX guideline think thrice.

     And yes this is a true story and I didn't cook it up.

  • I know the answer (it's 42)

    Indian Rope Trick


    Even though Wikipedia expresses doubts over the validity of the great Indian rope trick I saw a variant of it in MS India. I call it the great indian ladder trick.

Page 1 of 1 (7 items)