C/C++ Code Style: update conventions for type & value naming #80
No reviewers
Labels
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-developer-docs#80
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ideasman42/blender-developer-docs:pr-enum-naming-convention"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Update enum naming conventions text based on discussion in:
Based this comment by Brecht which was generally agreed on:
blender/blender#99080 (comment)
Since the existing docs state enum names should be all upper case, I've updated the docs to note that pascal-case should be used for C++ style enum labels based on:
https://devtalk.blender.org/t/style-for-enumerator-values/35290
C/C++ Code Style for Enumsto C/C++ Code Style: update conventions for type & value namingThere is a missing resolution to the followup: https://devtalk.blender.org/t/style-for-enumerator-values/35290/15 (The part
We do need to have a policy for abbreviations
).Regarding abbreviations, there are two different cases imho:
lib
forlibrary
, orctx
forcontext
). In common written text, these typically follow capitalization rules of the regular words.VSE
forVideo Sequence Editor
,BKE
forBlender KErnel
,DNA
for...Definitely Not Acid
???ID
for...Independent Data-block
??? ). These are typically always written in all capitals.So for C++ enum identifiers, I would propose to:
_
around acronyms when it helps readability.This could give identifiers like
ID_MakeLocalInLib
,ImageScaleInVSE
etc.Also CC @HooglyBoogly @JacquesLucke @JulianEisel @howardt
Checkout
From your project repository, check out a new branch and test the changes.