PCSX2 Documentation/Code Formatting Guidelines: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 5: Line 5:
Variable type prefixes are commonly known as [http://en.wikipedia.org/wiki/Hungarian_notation Hungarian Notation], and are the sort of variable names popularized by the <code>Win32API</code>. They look something like this is in ideal situations:
Variable type prefixes are commonly known as [http://en.wikipedia.org/wiki/Hungarian_notation Hungarian Notation], and are the sort of variable names popularized by the <code>Win32API</code>. They look something like this is in ideal situations:


<nowiki>DWORD dwSomeDoubleWord;</nowiki>
<nowiki>DWORD dwSomeDoubleWord;</nowiki>


... and look something more like this in practical situations involving real code:
... and look something more like this in practical situations involving real code:


<code>wxChar* lpwstrOmgThisSucks;</code>
<nowiki>wxChar* lpwstrOmgThisSucks;</nowiki>


Besides being obscenely ugly, this naming convention is totally impractical for modern programming via an IDE with autocomplete features. Coders using such tools want to do autocomplete by the subject of the variable's purpose, and are then automatically provisioned variable type information via tooltip, making the prefix neigh worthless. If I'm looking for the `MasterVolume` of a voice, I might think `VoiceVolumeMaster`, `MasterVolumeVoice`, or `VolumeVoiceMaster` and in fact I'll probably have no idea of it's a dword, word, int, or float value type. Any code using this naming convention will be changed to something more sensible.
Besides being obscenely ugly, this naming convention is totally impractical for modern programming via an IDE with autocomplete features. Coders using such tools want to do autocomplete by the subject of the variable's purpose, and are then automatically provisioned variable type information via tooltip, making the prefix neigh worthless. If I'm looking for the `MasterVolume` of a voice, I might think `VoiceVolumeMaster`, `MasterVolumeVoice`, or `VolumeVoiceMaster` and in fact I'll probably have no idea of it's a dword, word, int, or float value type. Any code using this naming convention will be changed to something more sensible.
ninja
782

edits

Navigation menu