Consistent naming of enum members

Bug #1367725 reported by GunChleoc
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
widelands
Won't Fix
Low
Unassigned

Bug Description

We don't have a standard for naming enum members. we have UPPERCASE_WITH_UNDERSCORE, lowercase_with_underscore, Title_Case_With_Underscore and CamelCase.

Examples:

enum NodeCaps {
 CAPS_NONE = 0,
 /** can we build normal buildings? (use BUILDCAPS_SIZEMASK for binary
  * masking)*/
 BUILDCAPS_SMALL = 1,
 BUILDCAPS_MEDIUM = 2,
 BUILDCAPS_BIG = 3,
 BUILDCAPS_SIZEMASK = 3,
...
}

enum {
 PCap_Bulldoze = 1, // can bulldoze/remove this buildings
 PCap_Dismantle = 1 << 1, // can dismantle this buildings
 PCap_Enhancable = 1 << 2, // can be enhanced to something
};

enum FlagId {
 FlagStart = 0,
 FlagEnd = 1
};

What do we want here?

Related branches

Revision history for this message
SirVer (sirver) wrote :

We stick to googles style guide (because it is the best documented on the web), so they should be named like constants (which they are): kFlagStart, kBulldoze.

Also, when they are touched they can be converted into enum class {} directly, so that they are in a namespace. FlagId::kStart is saver and reads the same as kFlagStart.

Changed in widelands:
status: New → Confirmed
importance: Undecided → Low
Changed in widelands:
status: Confirmed → Triaged
tags: added: cleanups lowhangingfruit
Revision history for this message
GunChleoc (gunchleoc) wrote :
Changed in widelands:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.