A very funny Laloo Prasad Yadav Joke


Once PVNR (PV Narasimha Rao), L.K.Advani and Laloo Prasad Yadav were
travelling in an autorickshaw. They met with an accident and all three of
them died.

Yama Raja was waiting for this moment at the doorstep of death.

He asks PVNR and Advani to go to HEAVEN.

But, for Laloo, Yama had already decided that he should be sent to HELL.
Laloo is not at all happy with this decision.

He asks Yama as to why this discrimination is being made. All the three of them had served the public. Similarly, all took bribes, all misused public positions, etc.

Then why the differential treatment?

He felt that there should be a formal test or an objective evaluation before a decision is made; and should not be just based on opinion or pre-conceived notions.

Yama agrees to this and asks all the three of them to appear for an English test.

PVNR is asked to spell " INDIA " and he does it correctly.
Advani is asked to spell " ENGLAND " and he too passes.
It is Laloo's turn and he is asked to spell " CZECHOSLOVAKIA ".

Laloo protests that he doesn't know English.

He says this is not fair and that he was given a tough question and thus forced to fail with false intent.

Yama then agrees to conduct a written test in Hindi (to give another chance assuming that Laloo should at least feel that Hindi would provide an equal platform for all three).

PVNR is asked to write "KUTTA BOLA BHOW BHOW". He writes it easily and passes.
Advani is asked to write "BILLY BOLI MYAUN MYAUN". He too passes.
Laloo is asked to write "BANDAR BOLA GURRRRRR....."
Tough one. He fails again.

Laloo is extremely unhappy.

Having been a student of history (which the other two weren't),he now requested for all the 3 to be subjected to a test in history.

Yama says OK but this would be the last chance and that he would not take any more tests.

PVNR is asked: "When did India get Independence ?". He replied "1947" and passed.
Advani is asked "How many people died during the independence struggle?".
He gets nervous. Yama asked him to choose from 3 options: 100,000 or 200,000 or 300,000.
Advani catches it and says 200,000 and passes.

It's Laloo's turn now.
'
'
'
'
'
'
''
'
'
'
''
'
'
'
'
'
'
'
'
'
'
'

'
Yama asks him to give the Name and Address of each of the 200,000 who died in the struggle.
Laloo accepts defeat and agrees to go to HELL.

Moral of the story: IF YOUR MANAGEMENT HAS DECIDED TO SCREW YOU, THERE IS NO ESCAPE........ So be Prepared!!

0 comments  

Why Coding Standards

Simple: maintainability. If, 6 months down the line, your customer isn't too happy with the product and wants an enhancement in the application you have created, you should be able to do it without introducing new bugs. There are a lot of other good reasons, but this is the one which concerns us more than anything else.


Not following any standard is like going with a temporary solution (which might lead to a permanent problem) and, as you will see, it takes less effort to keep in mind a few simple measures than to do haphazard coding.


All you have to do is study good standards once and keep them in the back of your head. Trust me; it's worth it.


Contents



1. Naming - What is meant by meaningful names
2. Casing - When to use PascalCase and when camelCase
4. Generics - Proper usage
5. Delegates - Proper usage
6. Miscellaneous - Some short tidbits
7. Common Pitfalls - Mistakes we should watch out for
8. References - Where to get more information


Naming



"The beginning of wisdom is to call things by their right names" - Chinese Proverb


"Meaningful" is the keyword in naming. By meaningful names, I mean concise names that accurately describe the variable, method or object. Let's see how this would be in C#:



Namespaces - Names should be meaningful and complete. Indicate your company or name, product and then your utility. Do not abbreviate.



//Good

namespace CompanyName.ProductName.Utility

//Bad

namespace CN.PROD.UTIL


Classes - Class names should always be a noun and, again, should be meaningful. Avoid verbs



//Good

class Image
{
   ...
}
class Filters
{
   ...
}

//Bad

class Act
{
   ...
}
class Enhance
{
   ...
}


Methods - Always use a verb-noun pair, unless the method operates on its containing class, in which case, use just a verb.



//Good

public void InitializePath();
public void GetPath();
public void ShowChanges();
public void System.Windows.Forms.Form.Show();

//Bad

public void Path();
public void Changes();


Methods with return values - The name should reflect the return value.



//Good

public int GetImageWidth(Bitmap image);

//Bad

public int GetDimensions(Bitmap image);


Variables - Do not abbreviate variable names. Variable names should again be descriptive and meaningful.



//Good

int customerCount = 0;
int index = 0;
string temp = "";

//Bad

int cc = 0;
int i = 0;
string t = "";


Private member variables - Prefix class member variables with m_.



public class Image
{
   private int m_initialWidth;
   private string m_filename;
   ...
}


Interfaces - Prefix all interface names with I. Use a name that reflects an interface's capabilities, either a general noun or an "-able".



interface IClock
{
   DateTime Time { get; set; }
   ...
}

interface IAlarmClock : IClock
{
   void Ring();
   DateTime AlarmTime { get; set; }
   ...
}

interface IDisposable
{
   void Dispose();
}

interface IEnumerable
{
   IEnumerator GetEnumerator();
}


Custom attributes - Suffix all attribute class names with Attribute. The C# compiler recognizes this and allows you to omit it when using it.



public class IsTestedAttribute : Attribute
{
   public override string ToString()
   {
      return "Is Tested";
   }
}

//"Attribute" suffix can be omitted

[IsTested]
public void Ring();


Custom exceptions - Suffix all custom exception names with Exception.



public class UserNotExistentException :
    System.ApplicationException
{
   ...
}


Delegates - Suffix all event handlers with Handler; suffix everything else with Delegate.



public delegate void ImageChangedHandler();
public delegate string StringMethodDelegate();


Casing



C# standards dictate that you use a certain pattern of Pascal Casing (first word capitalized) and Camel Casing (all but first word capitalized).


Pascal Casing - use PascalCasing for classes, types, methods and constants.

public class ImageClass
{
   const int MaxImageWidth = 100;
   public void ResizeImage();
}

enum Days
{
   Sunday,
   Monday,
   Tuesday,
   ...
}

Camel Casing - use camelCasing for local variables and method arguments.

int ResizeImage(int imageCount)
{
   for(int index = 0; index < imageCount; index++)
   {
      ...
   }
}


Generics



Generics, introduced in .NET 2.0, are classes that work uniformly on values of different types.



Use capital letters for types; don't use "Type" as a suffix.



//Good

public class Stack ‹T›

//Bad

public class Stack ‹t›
public class Stack ‹Type›


Delegates




Use delegate inference instead of explicit delegate instantiation.



public delegate void ImageChangedDelegate();
public void ChangeImage()
{
   ...
}

//Good

ImageChangedDelegate imageChanged = ChangeImage;

//Bad

ImageChangedDelegate imageChanged =
    new ImageChangedDelegate(ChangeImage);


Use empty parenthesis on anonymous methods without parameters.



public delegate void ImageChangeDelegate();
ImageChangedDelegate imageChanged = delegate()
{
   ...
}


Miscellaneous



  • Avoid putting using statements inside a namespace

  • Check spelling in comments

  • Always start left curly brace { on a new line

  • Group framework namespaces together; add custom and thirdparty namespaces below

  • Use strict indentation (3 or 4 spaces, no tabs)

  • Avoid fully qualified type names

  • Indent comment at the same line as the code

  • All member variables should be declared at the top of classes; properties and methods should be separated by one line each

  • Declare local variables as close as possible to the first time they're used

  • File names should reflect the classes that they contain


Common Pitfalls



Let's face it, we all do these things one time or another. Let's avoid them as best as we can:



Names that make sense to no one but ourselves.



string myVar;
MyFunction();


Single or double letter variable names (this is excusable for local variables).



int a, b, c, a1, j1, i, j, k, ii, jj, kk, etc.


Abstract names.



private void DoThis();
Routine48();
string ZimboVariable;


Acronyms.



//AcronymFunction

AF();
//SuperFastAcronymFunction

SFAT()


Different functions with similar names.



DoThis();
DoThisWillYa();


Names starting with underscores. They look cool, but let's not ;)



int _m1 = 0;
string __m2 = "";
string _TempVariable = "";


Variable names with subtle and context-less meanings.



string asterix = "";
// (this is the best function of all)

void God()
{
   ...
}


Abbreviations.



string num;
int abr;
int i;

0 comments