I always had trouble with "its vs it's".
But i recently came up with a rule that i can remember.
Its -- should be used like "his", ie you don't say: "what is hi's name?" you say "what is his name?"
It's -- this is the other one. or in other words it's is used when you can break it apart into "it is".
I guess it seems obvious in retrospect. The key is just to remember one, and the other just falls into place.
mlathe
@mlathe
Best posts made by mlathe
Latest posts made by mlathe
-
RE: Your never to old
-
RE: Best ways to increase your LOC
[quote user="djork"][quote user="Bob Janova"]For a simple pass-through like this I tend to write it as ...
public int UserID { get { return userID; } set { userID = value; } }
Since that code isn't doing anything semantically important, it's best to get it out of the way so I can see the code that does something useful instead. (Of course, if the setter actually does some validation or something, I format it more conventionally.)[/quote] Nice, one-liner :) I usually don't go that far in C#... but anyway the real WTF in the code I posted is this:
[/quote]if (value != userID)
{
userID = value;
}
Two things... One.. I think that puting the entire getter/setter stuff on one line is dumb. The entire point of formating is to create a uniform readable set of text. changing the format in special cases kind of goofs up uniform rule (some might say its more readable though).
Two. The "if (value != userID)" might be an important test, if the setter stmt ends up copying the code instead of copying the reference. What happens if you userId happens to contain an image for instance? its not worth wasting the time copying if its not needed.
-
RE: What will baby's name be?
you're right.. kind of. Its French, but doesn't seem to be related to Rene (at least as far as i can tell)