Skip to main content
8 events
when toggle format what by license comment
Oct 13, 2015 at 17:42 comment added IEatBagels Seem's it's not only resharper!
Oct 13, 2015 at 17:36 comment added Mathieu Guindon @TopinFrassi isn't [NotNull] part of the ReSharper annotations framework? AFAICT it only tells R# to check the call site isn't passing a possibly null reference.
Oct 13, 2015 at 15:03 comment added IEatBagels There's a [NotNull] attribute you can use, that indicates value shouldn't be null but doesn't make any validation. Apart from that, always be defensive about your input, you don't know if the user of your class is Satan or Bugs Bunny (who will be considered kind for this example). With the method's xml header there's a way to specify thrown exceptions! Check it out :)
Oct 13, 2015 at 13:38 comment added JD.B Maybe this isn't the place, but is there a 'good' way to handle possible null values? Or is it better to take the defensive approach and always assume the worse (ie, check that buffer != null in this case)? In addition, what about try/catching blocks of code. Like if we assume that this is suppose to throw exceptions that are passed up to the caller? Is that just a comment in that case?
Oct 13, 2015 at 13:27 history edited JD.B CC BY-SA 3.0
Added Visual Studio styled comment (for intellisense).
Oct 13, 2015 at 13:20 comment added IEatBagels I've never seen these comments you're talking about assuming the safety of the class. Plus, written this way they're not even visible in the IDE. Otherwise, good answer!
Oct 13, 2015 at 13:16 review First posts
Oct 13, 2015 at 13:17
Oct 13, 2015 at 13:15 history answered JD.B CC BY-SA 3.0