When its short I prefer B. It does a great job of keeping the code located where it is used. While the above example uses elipses to bring LinkMatchedBug's definition close to its use, real programs will often have a hundred lines or more between them (as part of a big switch or if/elseif block). "A" tends to force the reader to skip back and forth through the code to try to make sense of it. Two caveats: first off, the actual function needs to be decently self explanatory. Addding a comment may suffice, but if you're doing something tricky its usually best to use A, and make sure the function name is very descriptive. Second, if you are going to use a pattern more than once... maybe more than twice... A is vastly prefered over code duplication. In this specific example, I prefer A because "LinkMatchedBug" seems more descriptive than the actual string.Format() comand. I might change my mind if I saw the rest of the code and decided that the Format string spoke for itself, given the context.
C
cmdrrickhunter
@cmdrrickhunter
Posts
-
A question of style: inline delegates -
DNS hijacking?I emailed Kodak about it, and it is legit. They use yesmail for some of their mailings, as several posters have sugested. They have the yesmail server listed in their domain because a message from kodak.com looks better than one from yesmail.com (hey, whadda ya know ;) ) So there's no phishing there... feel free to continue buying film from this good company :-D .... if they still make film. Does film still exist? All I have are digital cameras now
-
DNS hijacking?I would argue otherwise. This Yesmail thing looks like a big spamming site, not an internal system. Why do they have a certificate in the first place?