Go to Hell
-
Here I came to a code, which looks like a Horror Movie of C#:
public bool IsMatched(string str)
{
if(str.ToString().Equals("Customer"))
{
return true;
}
return false;
}What this means? Is it really require? Go to hell.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
-
Here I came to a code, which looks like a Horror Movie of C#:
public bool IsMatched(string str)
{
if(str.ToString().Equals("Customer"))
{
return true;
}
return false;
}What this means? Is it really require? Go to hell.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
-
Does that compile? or should it be
public bool IsMatched(string str)
. If it is a bool then this function does the same asif (str=="Customer")
maybe they wanted to writepublic bool IsCustomer(string str)
{
return (str=="Customer");
}Yes, it's "public bool". My point here is in this line:
if(str.ToString().Equals("Customer"))
What is the significance of doing ToString() in a string? I am going mad... :mad: Ahh!!! Why people does this ToString() in a string variable?Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
-
Yes, it's "public bool". My point here is in this line:
if(str.ToString().Equals("Customer"))
What is the significance of doing ToString() in a string? I am going mad... :mad: Ahh!!! Why people does this ToString() in a string variable?Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
-
no point, but it doesn't do any harm other than making the code slightly less readable. Also no need to call Equals directly could call ==
-
Here I came to a code, which looks like a Horror Movie of C#:
public bool IsMatched(string str)
{
if(str.ToString().Equals("Customer"))
{
return true;
}
return false;
}What this means? Is it really require? Go to hell.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
-
no point, but it doesn't do any harm other than making the code slightly less readable. Also no need to call Equals directly could call ==
-
It's not very big thing as your subject suggested
Life's Like a mirror. Smile at it & it smiles back at you.- P Pilgrim So Smile Please
I got one better. The other developer here wrote: DataRow Dr; if( ((string)Dr["Col"]).ToString() != "false") return true; else return false; The biggest problem is that the value was stored in the database as a non nullable boolean value. She also wrote a stored proc that was more than 265 pages or roughly 5 megs worth of code. She didn't know how to write a query to test for null parameter so she wrote one query for ever parameter combination for the procedure that had 10 parameters. So effectively 2^10 number of combinations. I hope someone dumps her sorry behind, she gives programmers a bad name.
nothing
-
I got one better. The other developer here wrote: DataRow Dr; if( ((string)Dr["Col"]).ToString() != "false") return true; else return false; The biggest problem is that the value was stored in the database as a non nullable boolean value. She also wrote a stored proc that was more than 265 pages or roughly 5 megs worth of code. She didn't know how to write a query to test for null parameter so she wrote one query for ever parameter combination for the procedure that had 10 parameters. So effectively 2^10 number of combinations. I hope someone dumps her sorry behind, she gives programmers a bad name.
nothing
icestatue wrote:
a stored proc that was more than 265 pages or roughly 5 megs worth of code
Bah!!!! Please tell me that is a typo. If not, lie to me please, or my head may explode. And our cleaning people have asked that I not do that any more, as they hate cleaning brain out of my office. I can't even deal with 256 *line* sprocs, much less 256 pages.
Before .NET 4.0, object Universe = NULL;
-
icestatue wrote:
a stored proc that was more than 265 pages or roughly 5 megs worth of code
Bah!!!! Please tell me that is a typo. If not, lie to me please, or my head may explode. And our cleaning people have asked that I not do that any more, as they hate cleaning brain out of my office. I can't even deal with 256 *line* sprocs, much less 256 pages.
Before .NET 4.0, object Universe = NULL;