Details
-
Improvement/Rework
-
Resolution: Fixed
-
Trivial
-
2.0.0-alpha.3
-
None
Description
<p>From <a href="http://forum.team-mediaportal.com/threads/mp2-325-mp2-coding-style-resharper-settings.113098/#post-1031178" data-cke-saved-href="http://forum.team-mediaportal.com/threads/mp2-325-mp2-coding-style-resharper-settings.113098/#post-1031178">internal discussion</a>:</p><p>MJGraf:</p><div style="padding:.5em 1em .5em 1em;border-radius:.3em;border:1px dashed #b4b4b4;" class="jePanel_dashed"><p> Here: <a data-cke-saved-href="http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/18_Contribute/4_Development/Coding_Standards" href="http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/18_Contribute/4_Development/Coding_Standards" target="_blank" class="externalLink">http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/18_Contribute/4_Development/Coding_Standards</a> we don't say anything about consts.<br />ReSharper insists in PascalCasing, e.g. private const int DefaultCacheSize = 4096;<br />But in many older sources we use all upper casing with underscores between words, such as: private const int DEFAULT_CACHE_SIZE = 4096;</p></div><p>chefkoch:</p><div style="padding:.5em 1em .5em 1em;border-radius:.3em;border:1px dashed #b4b4b4;" class="jePanel_dashed"><p>I would like to suggest applying this to readonly fields as well, but i am not sure if only to public or public static or all read only ones.</p></div><p>MJGraf:</p><div style="padding:.5em 1em .5em 1em;border-radius:.3em;border:1px dashed #b4b4b4;" class="jePanel_dashed"><p> I agree, but I think we should only use it for static readonly fields. At least for me, the uppercase notation implies that this field has always the same value. Non-static readonly fields may have different values in different instances of a class as they can be initialised by different (overloaded) constructors.<br />I don't see a difference for visibilities, so I would apply this independent from the access modifier.</p></div><p><br /></p>