From 9a3b54ea00edbbc98af7033a1f3e2ae6e79b89c4 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Thu, 1 Sep 2022 20:35:33 +0000 Subject: [PATCH] Update 'Style Guide' --- Style-Guide.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Style-Guide.md b/Style-Guide.md index 9965a4c..8d9ab12 100644 --- a/Style-Guide.md +++ b/Style-Guide.md @@ -158,4 +158,27 @@ const ( All enum values the ARF compiler are prefixed with the name of the enum they belong to, as shown above. -The `iota` keyword just initializes everything in the block with incrementing values. \ No newline at end of file +The `iota` keyword just initializes everything in the block with incrementing values. + +# Naming Things + +Choose descriptive, even lengthy names for things, but don't go absolutely crazy. Use full words, and separate them using camel case. Never, ever use single letter variables (yes, including `i`). For example, say you wanted to name a struct that stored a database of cached parsing results: + +These are overly terse and do not convey meaning well. Imagine trying to decipher the meaning of these among a sea of symbols and other names. +``` +Cache +PCache +PCacheDB +``` + +This is excessive. Imagine writing a method for this! +``` +DatabaseOfCachedParsingOperationResults +``` + +This is perfect. +``` +ParsingResultCache +``` + +Note: it can be easier to have somewhat longer names for variables, functions, and members, and somewhat shorter names for types. \ No newline at end of file