aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-08 17:17:38 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-08 17:17:38 +0200
commitdf2ccebabb5af3b304ba8220e4c9364f8fd9f830 (patch)
treea1508e4eab66f36ff2d0e2b0ba6f794ed8816e7f
parent171cedf64c0ccb7e3b1bda50202e095c596df84e (diff)
downloadEpisodeBrowser-df2ccebabb5af3b304ba8220e4c9364f8fd9f830.tar.gz
README: Update information about Hungarian notation.
-rw-r--r--README28
1 files changed, 28 insertions, 0 deletions
diff --git a/README b/README
index 49be3fd..1be0d2c 100644
--- a/README
+++ b/README
@@ -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.