New issue 66 by dvdvorle: Use String.Equals("") instead of "".Equals(String)
http://code.google.com/p/gitsharp/issues/detail?id=66
In the jgit source i see a lot of the following (for example):
"FETCH_HEAD".equals(ref)
I would like to propose that this be replaced in the GitSharp source with:
ref.Equals("FETCH_HEAD")
Reason:
I think the only gain "".Equals(string_var) has over string_var.Equals("")
is that in some cases you can ommit testing for null, see also the
following answer to a stackoverflow question:
http://stackoverflow.com/questions/1659097/c-string-equals-vs/1660262#1660262
Now some might say this is a matter of personal preference, but I really
think changing the order improves readability. To me, the first version
reads like yoda ("green the grass is.") while the second version reads like
proper english ("the grass is green.")
i agree.
-- henon