Joe White’s Blog

Life, .NET, and Cats


ReSharper coolness of the day: generated constructor visibility


If you use ReSharper‘s Alt+Ins to generate a constructor, and you’re in an abstract class, ReSharper is automatically smart enough to make the constructor protected.

This only makes sense. After all, .NET design guidelines recommend that abstract classes shouldn’t have public constructors — you can’t instantiate the class, so while a public constructor is harmless, it’s also misleading.

But… no matter how much sense it makes, it’s cool. It’s one of those little details that make me like ReSharper so much.

Addendum: when you use Alt+Enter to change the constructor’s visibility, public isn’t even on the list. Nice touch.

One Response to “ReSharper coolness of the day: generated constructor visibility”

  1. Dew Drop - April 23, 2009 | Alvin Ashcraft's Morning Dew Says:

    [...] ReSharper coolness of the day: generated constructor visibility (Joe White) [...]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Joe White's Blog copyright © 2004-2011. Portions of the site layout use Yahoo! YUI Reset, Fonts, and Grids.
Proudly powered by WordPress. Entries (RSS) and Comments (RSS). Privacy policy