From 399a76446c6528c87b4b25fdd9b3509e3a3474a3 Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Tue, 29 Nov 2022 21:00:01 -0500 Subject: [PATCH] Update for 29-11-22 21:00 --- tech/development.wiki | 1 + tech/names_in_code.wiki | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tech/names_in_code.wiki diff --git a/tech/development.wiki b/tech/development.wiki index bd1fabf..6d746e2 100644 --- a/tech/development.wiki +++ b/tech/development.wiki @@ -3,6 +3,7 @@ == Conceptual == * [[error_handling]] +* [[names_in_code]] == Libraries == diff --git a/tech/names_in_code.wiki b/tech/names_in_code.wiki new file mode 100644 index 0000000..932dade --- /dev/null +++ b/tech/names_in_code.wiki @@ -0,0 +1,21 @@ += Names in Code = + +Standards and conventions for naming stuff, in code + +1) Dont abbreviate names + * Abbreviation relies on context. Context you may not have re-reading your + code +2) Dont put types in variable names + * Thats a Windows.h C99 moment +3) Add units to variables unless the type tells you + * IE a delay function takes a paramater _delaySeconds_, not just _delay_. + * If you have a unit like `chronos::timespan`, however, you dont need that +4) Dont put types in your types + * IE AbstractX, BaseX, etc... + * If you need to to this, maybe try renaming the child class instead to be + more specific +5) Refactor if you find yourself naming code "utils" or "helper" + * 99% of the time those utils can be broken into their own classes + * This is true even if you have a 'utils' type function just for Cookies, + Math, etc +