Inspired by this question.
How should I let a user know that the code they've written goes against Microsoft's recommended practice? In this case, instantiating an SPSite
instance with a hardcoded URL, not disposing of SPSite
when finished and getting an SPList
instance with the hardcoded list name when it is available in the method parameters.
Normally I'd put it in a comment but that's difficult when it's several lines long. When it's not related to the answer, should I even point this out?
// Building query here
rather than replace it with quick-and-dirty string concanenation. It won't stop the laziest coders writing dangerous code but it'll force people to go looking for the answer, at least giving them a chance of finding the right one.