From a895f47ffa8538deabafc552fdc6e3142f4ff9d7 Mon Sep 17 00:00:00 2001 From: flaviut Date: Sat, 11 Oct 2014 16:00:49 -0700 Subject: [PATCH] Move things from whitespace faq here --- NEP-1-:-Style-Guide-for-Nimrod-Code.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/NEP-1-:-Style-Guide-for-Nimrod-Code.md b/NEP-1-:-Style-Guide-for-Nimrod-Code.md index 7b601a5..71c0381 100644 --- a/NEP-1-:-Style-Guide-for-Nimrod-Code.md +++ b/NEP-1-:-Style-Guide-for-Nimrod-Code.md @@ -99,9 +99,14 @@ be changed in the future.

### Coding Conventions ### - The 'return' statement should only be used when it's control-flow properties - are required. Use a procedures implicit 'result' variable instead. Using the - implicit result variables allows both the Nimrod compiler and its various - backends to perform special optimizations + are required. Use a procedures implicit 'result' variable instead. This improves + readably. + +- Prefer to return `[]` and `""` instead of `nil`, or throw an exception if that + is appropriate. + +- Use a proc when possible, only using the more powerful facilities of macros, + templates, iterators, and converters when necessary. - Use the 'let' statement (not the var statement) when declaring variables that do not change within their scope. Using the let statement ensures that