« Home | DisposableResource » | Media Center Update » | Class Designer C++ Support Cut » | Blog Marketing » | Indigo » | MPAA » | .NET Array Expectations » | Wrestling Gold from Today's Software Projects » | MCE 2005 » | RSS Audio Convenience »

Field Name Colors

Eric Gunnerson wrote a post on field name conventions where the conclusion was that having an m_ prefix in front of field names makes it easier to identify fields versus variables. This is particularly useful when you’re looking through unfamiliar source code. Regardless, I still prefer not to have adornment on code names past what would be used in normal language (and have always recoiled from Hungarian notation). It just seems cleaner to be able to read source and have it sound close to a natural language sentence as far as the class, field, property and method names are concerned.

It would be great if the IDE could color field names differently from variable names, so you could easily differentiate them in code without having an ugly prefix being used just as a field marker. Did a search on lady bug and found a match on this type of functionality and voted for it:

Suggestion Details: Syntax coloring: Identifiers differenciation (local variables, fields, properties, methods, events)

If such functionality were available, I’d probably not go pyrotechnic with the colors and just differentiate the fields with a different color.

Resharper already does this.

Post a Comment

Links to this post

Create a Link