Saturday, April 26, 2014

On Children : Kahlil Gibran

Your children are not your children.
They are the sons and daughters of Life's longing for itself.
They come through you but not from you,
And though they are with you, yet they belong not to you.
You may give them your love but not your thoughts.
For they have their own thoughts.
You may house their bodies but not their souls,
For their souls dwell in the house of tomorrow, which you cannot visit, not even in your dreams.
You may strive to be like them, but seek not to make them like you.
For life goes not backward nor tarries with yesterday.
You are the bows from which your children as living arrows are sent forth.
The archer sees the mark upon the path of the infinite, and He bends you with His might that His arrows may go swift and far.
Let your bending in the archer's hand be for gladness;
For even as he loves the arrow that flies, so He loves also the bow that is stable.

-- Khalil Gibran
  • Friday, April 25, 2014

    Generics Java vs. C#


    If you ever move from C# to Java for some strange reason, here is my warnings to you; Generics in C# is much nicer and cleaner. In other hand Java, not so much. It is very confusing to Java programmers and more confusing to C# guys. Here is a very good article comparing generics in both Java and C#.

    Comparing Java and C# Generics - Jonathan Pryor's web log

    Friday, April 18, 2014

    Bad Code: Don’t abuse the “if”

    Couple of things I don’t like with this code,
    • “if” does 2 things, it adds a car to the collection and checks the status.
    • I like if condition flow from left to right than right to left, it feels more natural language.
    Keep “if” side effect free, don’t do any logic other than checking. Less code is not always clear code.

    Wednesday, April 16, 2014

    Bad Code: Don’t abuse instances

    Here we are creating a car object to create another car object, we could have used a static method for this.
    This bad code is not only inefficient but quirky and cumbersome. it makes you wonder about the original authors intention. A good code should make its intentions clear by using right amount of clear comments and good names.