From 3e106b6d53966d4ac3b3490b277edc6696d12aeb Mon Sep 17 00:00:00 2001 From: Brent Farris Date: Sun, 7 Jul 2019 18:31:23 -0700 Subject: [PATCH] Adding info on while, do-while, and infinite loops Updating based on the question [found here](https://github.com/BeardedManStudios/ForgeNetworkingRemastered/issues/299) --- CONTRIBUTING.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3110d92e..5e06b678 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,6 +56,24 @@ if (1 == 1) } ``` +For infinite loops, while loops, and do-while loops, we need these to be exceptionally clear. So in the case of any of these we will use hanging brackets. +```csharp +while (true) +{ + DoSomethingFancy(); +} + +do +{ + DoSomethingFancy(); +} while(true); + +for(;;) +{ + DoSomethingFancy(); +} +``` + For lambda expressions we have hanging brackets ```csharp Call(() =>