<p>Why does Visual Studio declare new classes as private in C#?  I almost always switch them over to public, am I the crazy one?</p>

[{'answer_id': 39906, 'author': 'Craig', 'author_id': 2894, 'author_profile': 'https://Stackoverflow.com/users/2894', 'pm_score': -1, 'selected': False, 'text': '<p>C++, upon which C# is derived, specified that the default class access level is private.  C# carries this forward  for better or worse.</p>\n'}, {'answer_id': 39908, 'author': 'Nick Berardi', 'author_id': 17, 'author_profile': 'https://Stackoverflow.com/users/17', 'pm_score': 0, 'selected': False, 'text': '<p>No I always have to slap that "public" keyword on the front of the class, so you are not alone.  I guess the template designers thought it was a good idea to start with the very basics.  You can edit these templates though in your Visual Studio install, if it really annoys you that much, but I haven\'t gotten to that point yet.</p>\n'}, {'answer_id': 39911, 'author': 'Espo', 'author_id': 2257, 'author_profile': 'https://Stackoverflow.com/users/2257', 'pm_score': 4, 'selected': False, 'text': '<p>I am not sure WHY it does that, but here\'s what you do in order to get Visual Studio to create the class as Public by default:</p>\n\n<p>Go over to “Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\ItemTemplates\\CSharp\\Code\\1033″, you will find a file called Class.zip, inside the .zip file open the file called Class.cs, the content of the file looks like this:</p>\n\n<pre><code>using System;\nusing System.Collections.Generic;\n$if$ ($targetframeworkversion$ == 3.5)using System.Linq;\n$endif$using System.Text;   \n\nnamespace $rootnamespace$\n{\n    class $safeitemrootname$\n    {\n    }\n}\n</code></pre>\n\n<p>All you need to do is add “Public” before the class name. The outcome should look like this:</p>\n\n<pre><code>using System;\nusing System.Collections.Generic;\n$if$ ($targetframeworkversion$ == 3.5)using System.Linq;\n$endif$using System.Text;   \n\nnamespace $rootnamespace$\n{\n    public class $safeitemrootname$\n    {\n    }\n}\n</code></pre>\n\n<p>One last thing you need to do is flush all the Templates Visual Studio is using, and make him reload them. The command for that is ( it takes a while so hold on): </p>\n\n<pre><code>devenv /installvstemplates\n</code></pre>\n\n<p>And that’s it, no more private classes by default. Of course you can also add internal or whatever you want.</p>\n\n<p><a href="http://www.dev102.com/2008/03/14/how-to-get-visual-studio-to-create-new-classes-public-by-default/" rel="noreferrer">Source</a></p>\n'}, {'answer_id': 39919, 'author': 'SQLMenace', 'author_id': 740, 'author_profile': 'https://Stackoverflow.com/users/740', 'pm_score': -1, 'selected': False, 'text': '<p>For security reasons. </p>\n\n<p>You want to expose certain methods and not your whole class.</p>\n'}, {'answer_id': 39955, 'author': 'McKenzieG1', 'author_id': 3776, 'author_profile': 'https://Stackoverflow.com/users/3776', 'pm_score': 4, 'selected': True, 'text': '<p>Private access by default seems like a reasonable design choice on the part of the C# language specifiers.</p>\n\n<p>A good general design principle is to make all access levels as restrictive as possible, to minimize dependencies. You are less likely to end up with the wrong access level if you start as restrictive as possible and make the developer take some action to make a class or member more visible. If something is less public than you need, then that is apparent immediately when you get a compilation error, but it is not nearly as easy to spot something that is more visible than it should be.</p>\n'}, {'answer_id': 39958, 'author': 'Joel Coehoorn', 'author_id': 3043, 'author_profile': 'https://Stackoverflow.com/users/3043', 'pm_score': 0, 'selected': False, 'text': "<p>Even if you mark a class as public, members are still private by default.  In other words, the class is pretty much useless outside the same namespace.  I think making it public by default instead may go too far, though.  Try using 'internal' some.  It should provide enough access for <em>most</em> purposes.</p>\n"}]
['https://Stackoverflow.com/questions/39903', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/632/']