From df2ccebabb5af3b304ba8220e4c9364f8fd9f830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 8 Aug 2022 17:17:38 +0200 Subject: README: Update information about Hungarian notation. --- README | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'README') 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. -- cgit v1.2.3