diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-08 17:17:38 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-08 17:17:38 +0200 |
commit | df2ccebabb5af3b304ba8220e4c9364f8fd9f830 (patch) | |
tree | a1508e4eab66f36ff2d0e2b0ba6f794ed8816e7f | |
parent | 171cedf64c0ccb7e3b1bda50202e095c596df84e (diff) | |
download | EpisodeBrowser-df2ccebabb5af3b304ba8220e4c9364f8fd9f830.tar.gz |
README: Update information about Hungarian notation.
-rw-r--r-- | README | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -60,3 +60,31 @@ following additional programs are required: To build b/EpisodeBrowser.exe, issue `make' in the root directory of the project. + +Hacking +~~~~~~~ +The Episode Browser source code uses a limited form of Hungarian +notation. In summary, Hungarian notation is used only for + + - traditional Win32 names such as uMsg, lParam, hWnd, + - variables of Windows-specific types, like hfNormal (HFONT), + - arrays, such as vTipCtx (read as: context tip vector), + - booleans, such as bActive, bViewWatched, + - counts, such as cb (byte count), cch (character count), and + - type disambiguation. + +For an example of the last point, imagine you have an integer named +`rating', which you want to convert to a string. What should the +string be called? The simple answer is `sRating'. + +In addition, global variables are prefixed with g_ and non-public +member variables are prefixed with m_. + +A special note on the meaning of cb and cch: these prefixes are used +to designate size. For strings, this means the total size, including +space for the terminating NUL character. To designate string length +without NUL, `len' is used. + +While specific Hungarian prefixes are unnecessary for most variables, +"natural" word order should be avoided. In other words, lenString is +preferred over stringLen, because it mirrors vString. |