PCSX2 Documentation/Code Formatting Guidelines: Difference between revisions

Jump to navigation Jump to search
Line 31: Line 31:
There is no justifiable reason for any class in PCSX2 to use private variable members. Private members are only useful in the context of _dynamically shared core libraries_, and only hinder the object extensibility of non-shared application code. Use <code>protected</code> for all non-public members instead, as it protects members from unwanted public access while still allowing the object to be extended into a derived class without having to waste a lot of silly effort to dance around private mess.
There is no justifiable reason for any class in PCSX2 to use private variable members. Private members are only useful in the context of _dynamically shared core libraries_, and only hinder the object extensibility of non-shared application code. Use <code>protected</code> for all non-public members instead, as it protects members from unwanted public access while still allowing the object to be extended into a derived class without having to waste a lot of silly effort to dance around private mess.


==Topic 4: Name Protected Class Members with 'm_'==
==Topic 4: Name Protected Class Members with <code>m_</code>==


It is highly recommended to prefix protected class members with <code>m_</code>; such as <code>m_SomeVar</code> or <code>m_somevar</code>. This is a widely accepted convention that many IDEs are adding special built in support and handling for, and for that reason it can help improve class organization considerably for all contributors to the project. However, like most other guidelines it is not a definitive requirement.
It is highly recommended to prefix protected class members with <code>m_</code>; such as <code>m_SomeVar</code> or <code>m_somevar</code>. This is a widely accepted convention that many IDEs are adding special built in support and handling for, and for that reason it can help improve class organization considerably for all contributors to the project. However, like most other guidelines it is not a definitive requirement.
ninja
782

edits

Navigation menu