Source Code Indent Styles

 

Professional programmers really take care of readabilty and appearance of their source code. Source code Indentation is the thing which we’ve been following from high school programming classes to distinguish the blocks in your source code. If you read programs written by different people you can see the way they used braces and Intended their source code

Kernighan & Ritchie’s (K&R) style and Eric Allman’s Allman style are the most popular among programmers. I was accidently came to this topic when I was reading Object Oriented Design & Patterns by Cay Horstmann

K&R Style

[sourcecode language='cpp']
int main(int argc, char *argv[])
{

while (x == y) {
something();
somethingelse();
if (some_error)
do_correct();
else
continue_as_usual();
}
finalthing();

}
[/sourcecode]

Allman’s Style

[sourcecode language='cpp']
while(x == y)
{
something();
somethingelse();
}
finalthing();
[/sourcecode]


You can see lot more indent styles from Wikipedia. I’m following Allmans’s style as I found it’s more readble. We can easily identify start and end of blocks easily.
Update: Updated post title – @ 3:53 PM IST

 

3 Advices from Jagathy Sreekumar

 

He might be one of the best actors, king of comedy, the actor I admire and respect a lot. It’s nobody else but Jagathy Sreekumar.

Last Saturday I was there at Asianet Film Awards 2009 ceremony at Chandrasekharan Nair stadium Trivandrum. Jagathy won the popular actor award  and during his speech he shared 3 notable quotes from his mom, who passed away last year. Those were

1. You have to give everything to your wife

2. Don’t give anything to your mother.

3. Kill your father.

He explained this in a nice way.

Your wife depends you and if she asks you something and get it for her as you’re a perfect husband,

Don’t give a chance for your mom to ask you something as she’s your only mother and greatness of her role in your life. Give everything possible and keep her happy in her entire life.

You have to kill or make a better fame, money,status and whatever you can possible to do better than your father.

He started this as advices to Vineeth Sreenivasn who won the best new comer award. Vineeth’s father Sreenivasan is another good actor, comedian, script writer and director. I believe this was true inspiration for Vineeth and rest of us.

 

My thoughts on The Slumdog Millionaire

 

Slumdog Millionaire is a nice movie. I’d appreciate Danny Boyle for his tremendous effort to make the film. Even it’s an English Movie, it contains all essence of an Indian Movie (not the essence of shit that Jamal had in his childhood).

If you believe or not, it’s the story of Millions of Slumdogs in India. I never heard such a guy came to reality show and won prize but it’s an interesting concept. Life in India not what we sees in Metros like Bangalore, Chennai, Mumbai.. you’ve to travel a bit far from metros or go and see slums. I never came from slum, in my short life experience I’ve met many people like this. I’ve seen and heard lot of related news. I’m not a person who truly explored to the poor India. From what I’ve been seeing for these years and experience I could say something. I’ve seen many people who’s struggling to make their day-to-day life. I saw people who dream to have breakfast-lunch-dinner everyday. All these are dreams for them.

Few months ago, I went to Bangalore as part of my examination and I had a small shopping at Brigade Road in a cool evening. When I was waiting for a friend of mine, I could see approx 10 year girl begging for money to a foreign lady. So tourist asked her back instead of giving money “you need ice cream? you need food? chocolates” she tried lot of different options but the girl resisted and started asking for coins (or notes) again.  I’ve seen many children who are not genetically faulted but faulted by a strong racket to present them as true beggars. Indian govt. has lot of good initiatives to protect the orphan children. But still it’s hard to get them out of this racket. Few years ago I believe, Manorama and other dailies in Malalayalam had done a good investigation in this matter and stories we heard was really shocking. We can understand, it’s not because of poverty(it’s once reason in fact),  All these are controlled by a strong big racket they can’t simply escape from this.

In north (sometimes in south) India you can see lot of riots in the name of Religion and cast. Even many governments silently supports these fucking riots(The recent Anti-Christian Attacks in Orissa). As Pakistan president Yusuf Raza Gilani said, poverty is the root for the terrorism. It’s true, people want to make their lives better. Then they will be dreaming more from their limitation which is smartly utilized by the terrorist and anti-socials against the countries. Now Indian govt. asking Pakistan to hand over the terrorists behind Mumbai attacks. Is it really possible for Pakistani’s to do this without support from anti-social Indians? In the movie Count of Monte Cristo, Napoleon Bonaparte says “People are either Kings or pawns”. These people are pawn who’s smartly used against the country external forces. They don’t know the seriousness of what they’re doing.

I know the topic is deviating from Slumdog millionaire. Amitabh Bachan criticized that, the film shows  a poor face of India. Dear Amitabh Ji, you’ve to admit that it’s a fact and it’s India.  If you see the Movie Swades, you can see the same situation. Villages without electricity, children selling glass of water for small 25 paisa (I’m not remembering the exact amount), parents who denies to send their daughters to school, the congested living of slums, prostitutes, smuggling, weapons, riots all these we can see in India. AND almost all citizens including politicians are aware about this. Rich remains rich poor remains poor. That’s the principle running the lives of many.

But there are no limitation for us to dream more, we want have good life, work for our country, make money to improve our lives, say no to terrorism. Dream, choose the right path, execute it and you will be the King , not a pawn. One day you will be a millionaire. Slumdog millionaire(if you insist to call yourself). The film is incomplete but still it gives lot of inspiration for the youngsters in India.