Naming conventions

Please can we have naming conventions be configurable? I realise that the
current conventions may be the recommended ones, but if I'm in a team who
use different conventions then I have little choice but to do as I'm told.



9 comments
Comment actions Permalink

You are right but still I am wandering why the heck your team use their own
naming conventions instead of Microsoft's recommended? I mean all the static
code analyzers and maybe other tools as well use Microsofts naming
conventions I have never understand why the hell a team would use their own.

Gabriel

"Rick" <rick@nospam.com> wrote in message
news:ekpof1$l1o$1@is.intellij.net...

Please can we have naming conventions be configurable? I realise that the
current conventions may be the recommended ones, but if I'm in a team who
use different conventions then I have little choice but to do as I'm told.

>
>



0
Comment actions Permalink

Hello Rick,

could you please elaborate on what exactly do you mean under 'naming conventions'?
ReSharper allows
to customize prefixes / suffixes for declaration of fields, locals and parameters
(ReSharper|Options|CodeStyle|
C#|Naming Convention).

Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


Please can we have naming conventions be configurable? I realise that
the current conventions may be the recommended ones, but if I'm in a
team who use different conventions then I have little choice but to do
as I'm told.



0
Comment actions Permalink

Hello Dmitry,

They are not enough for all. You can't specify CamelCase or mpascalCase
styles for fields, privateMethodNameInPascal() cannot be specified either.
Cannot specify public fields have no prefix and begin uppercase while private
fields begin with prefix "_" and next letter lowercase. Essentialy, current
settings allow using different flavors of Microsoft naming (prefixes mostly,
I've never seen suffixes).

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


DS> Hello Rick,
DS>
DS> could you please elaborate on what exactly do you mean under 'naming
DS> conventions'?
DS> ReSharper allows
DS> to customize prefixes / suffixes for declaration of fields, locals
DS> and parameters
DS> (ReSharper|Options|CodeStyle|
DS> C#|Naming Convention).
DS> Dmitry Shaporenkov
DS> JetBrains, Inc
DS> http://www.jetbrains.com
DS> "Develop with pleasure!"
>> Please can we have naming conventions be configurable? I realise that
>> the current conventions may be the recommended ones, but if I'm in a
>> team who use different conventions then I have little choice but to
>> do as I'm told.
>>


0
Comment actions Permalink

Yes, but obviously ReSharper can't support any naming conventions that were
invented in the last decades :)
I suspect that some people still use Hungarian notation, which is an example
of even more complicated
naming convention than having different prefixes depending on the accessibility
of a member, even in C#.

Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


Hello Dmitry,

They are not enough for all. You can't specify _CamelCase or
m_pascalCase styles for fields, privateMethodNameInPascal() cannot be
specified either. Cannot specify public fields have no prefix and
begin uppercase while private fields begin with prefix "_" and next
letter lowercase. Essentialy, current settings allow using different
flavors of Microsoft naming (prefixes mostly, I've never seen
suffixes).

Sincerely,
Ilya Ryzhenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

DS>> Hello Rick,
DS>>
DS>> could you please elaborate on what exactly do you mean under
DS>> 'naming
DS>> conventions'?
DS>> ReSharper allows
DS>> to customize prefixes / suffixes for declaration of fields, locals
DS>> and parameters
DS>> (ReSharper|Options|CodeStyle|
DS>> C#|Naming Convention).
DS>> Dmitry Shaporenkov
DS>> JetBrains, Inc
DS>> http://www.jetbrains.com
DS>> "Develop with pleasure!"
>>> Please can we have naming conventions be configurable? I realise
>>> that the current conventions may be the recommended ones, but if I'm
>>> in a team who use different conventions then I have little choice
>>> but to do as I'm told.
>>>


0
Comment actions Permalink

Hello Dmitry,

If you can't support all, it doesn't mean you should not try to support majority
of naming styles. Or at least give people API to write a plugin to support
their naming styles.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


DS> Yes, but obviously ReSharper can't support any naming conventions
DS> that were
DS> invented in the last decades :)
DS> I suspect that some people still use Hungarian notation, which is an
DS> example
DS> of even more complicated
DS> naming convention than having different prefixes depending on the
DS> accessibility
DS> of a member, even in C#.
DS> Dmitry Shaporenkov
DS> JetBrains, Inc
DS> http://www.jetbrains.com
DS> "Develop with pleasure!"
>> Hello Dmitry,
>>
>> They are not enough for all. You can't specify _CamelCase or
>> m_pascalCase styles for fields, privateMethodNameInPascal() cannot be
>> specified either. Cannot specify public fields have no prefix and
>> begin uppercase while private fields begin with prefix "_" and next
>> letter lowercase. Essentialy, current settings allow using different
>> flavors of Microsoft naming (prefixes mostly, I've never seen
>> suffixes).
>>
>> Sincerely,
>> Ilya Ryzhenkov
>> JetBrains, Inc
>> http://www.jetbrains.com
>> "Develop with pleasure!"
DS>>> Hello Rick,
DS>>>
DS>>> could you please elaborate on what exactly do you mean under
DS>>> 'naming
DS>>> conventions'?
DS>>> ReSharper allows
DS>>> to customize prefixes / suffixes for declaration of fields, locals
DS>>> and parameters
DS>>> (ReSharper|Options|CodeStyle|
DS>>> C#|Naming Convention).
DS>>> Dmitry Shaporenkov
DS>>> JetBrains, Inc
DS>>> http://www.jetbrains.com
DS>>> "Develop with pleasure!"
>>>> Please can we have naming conventions be configurable? I realise
>>>> that the current conventions may be the recommended ones, but if
>>>> I'm in a team who use different conventions then I have little
>>>> choice but to do as I'm told.
>>>>


0
Comment actions Permalink

I am most concerned about the imposition of case. What annoys me most is
that if I highlight a variable name like "MyVariable" and then choose to
rename it (intending to rename it "MyVariable2"), I am prompted with
"myVariable". I then need to fix the capitalization before adding the "2".
Why can't I just be prompted with the variable name as it was originally?

"Ilya Ryzhenkov" <orangy@netix.ru> wrote in message
news:9f6b3e2912f4e98c8e50509000946@news.intellij.net...

Hello Dmitry,

>

They are not enough for all. You can't specify CamelCase or mpascalCase
styles for fields, privateMethodNameInPascal() cannot be specified either.
Cannot specify public fields have no prefix and begin uppercase while
private fields begin with prefix "_" and next letter lowercase.
Essentialy, current settings allow using different flavors of Microsoft
naming (prefixes mostly, I've never seen suffixes).

>

Sincerely,
Ilya Ryzhenkov



0
Comment actions Permalink

Code analysis systems like FxCop (which you should be running your code
through anyway) will flag improper casing as well. Resharper is conforming
to C# standards. When you choose to violate standards, you should expect
some minor inconveniences to come along with that.

"Rick" <rick@nospam.com> wrote in message
news:enad9p$fi6$1@is.intellij.net...
>I am most concerned about the imposition of case. What annoys me most is
>that if I highlight a variable name like "MyVariable" and then choose to
>rename it (intending to rename it "MyVariable2"), I am prompted with
>"myVariable". I then need to fix the capitalization before adding the "2".
>Why can't I just be prompted with the variable name as it was originally?
>

"Ilya Ryzhenkov" <orangy@netix.ru> wrote in message
news:9f6b3e2912f4e98c8e50509000946@news.intellij.net...

>> Hello Dmitry,
>>
>> They are not enough for all. You can't specify CamelCase or mpascalCase
>> styles for fields, privateMethodNameInPascal() cannot be specified
>> either. Cannot specify public fields have no prefix and begin uppercase
>> while private fields begin with prefix "_" and next letter lowercase.
>> Essentialy, current settings allow using different flavors of Microsoft
>> naming (prefixes mostly, I've never seen suffixes).
>>
>> Sincerely,
>> Ilya Ryzhenkov
>



0
Comment actions Permalink

I do not follow the guidelines because I don't have that option. I bought
Resharper to make my life easier and not to provide "inconveniences". Surely
it is easier to just prompt me with what I highlighted rather than trying to
be too smart and anticipate my intentions.

BTW I don't use FxCop because I don't want to use it. And hey, my code STILL
works. Imagine that!

"Paul Bradshaw" <pbradshaw@advsol.com> wrote in message
news:encmfm$f1l$1@is.intellij.net...

Code analysis systems like FxCop (which you should be running your code
through anyway) will flag improper casing as well. Resharper is
conforming to C# standards. When you choose to violate standards, you
should expect some minor inconveniences to come along with that.

>

"Rick" <rick@nospam.com> wrote in message
news:enad9p$fi6$1@is.intellij.net...

>>I am most concerned about the imposition of case. What annoys me most is
>>that if I highlight a variable name like "MyVariable" and then choose to
>>rename it (intending to rename it "MyVariable2"), I am prompted with
>>"myVariable". I then need to fix the capitalization before adding the "2".
>>Why can't I just be prompted with the variable name as it was originally?
>>
>> "Ilya Ryzhenkov" <orangy@netix.ru> wrote in message
>> news:9f6b3e2912f4e98c8e50509000946@news.intellij.net...
>>> Hello Dmitry,
>>>
>>> They are not enough for all. You can't specify _CamelCase or
>>> m_pascalCase styles for fields, privateMethodNameInPascal() cannot be
>>> specified either. Cannot specify public fields have no prefix and begin
>>> uppercase while private fields begin with prefix "_" and next letter
>>> lowercase. Essentialy, current settings allow using different flavors of
>>> Microsoft naming (prefixes mostly, I've never seen suffixes).
>>>
>>> Sincerely,
>>> Ilya Ryzhenkov
>>
>>
>



0
Comment actions Permalink

The key thing is to write working code. Consistent naming conventions are a secondary goal, but a goal nonetheless.

My wish list, in order:
Type naming conventions for interfaces, classes, enums, etc.
Capitalization supported in all conventions.
Const conventions.
I am not interested in visibility based conventions, but I guess some people would use them.

Many might find it odd, but I dislike the convention that all interfaces must begin with "I". I prefer to suffix my implementations rather than prefix my interfaces. I feel that keeps the focus on the abstraction. Additionally, prefixing makes finding things alphabetically that much harder.

There is no reason to expect or enforce that all organizations adopt the MS conventions. If MS cared that much about it, they could have written a much more restrictive compiler!

"A foolish consistency is the hobgoblin of little minds, the favorite of little statesmen, philosophers and divines." -- Ralph Waldo Emerson

0

Please sign in to leave a comment.