w0051977
w0051977

Reputation: 15797

.NET naming conventions

I am supporting and developing a large application. This question relates specifically to naming conventions.

The previous developer used Pascal Casing, underscores for variable names and a few other techniques, which seem to be frowned upon these days.

My question is: should I continue using the conventions that he used for consistency or introduce conventions that don't seem to be frowned upon as described here: http://www.dofactory.com/reference/csharp-coding-standards.aspx at the expense of inconsistency for at least some time.

I am trying to refactor the code as I go along so maybe I should introduce new conventions in new areas of the application and continue refactoring the code by replacing frowned upon conventions with modern conventions?

Perhaps I am overthinking this.

Upvotes: 0

Views: 150

Answers (1)

Albin Sunnanbo
Albin Sunnanbo

Reputation: 47038

If the old code is consistent, keep it consistent, different style all over the place makes it even more confusing.

If you are going to change, make it a work item, schedule it and do it all at once.

You can of course find arguments for making a gradually change. If you can convince your self that you will complete the renaming by working in small steps where you need to work on the code anyway, go ahead. But to be honest, how many of those gradually transforming code process get finished before there is an updated style guide line and you start of in a third style before cleaning up the first change.

If your code is already in an inconsistent style there is even more compelling reasons to clean up the mess right now before it gets even worse.

Upvotes: 3

Related Questions