NML

Coding practices and standards

Posted on 14 February 2022
Charl Marais

Overview

NML want everybody to have the freedom they need to creatively contribute to their work. Too many rules stifle creative freedom and too few entices disorder and confusion. The document outlines some practices and standards that are highly encouraged and, where noted with expected.

Feel free to raise your opinion on any of these guidelines and to contribute to the document. Email Charl, Justin, Isobel, or Kirsten with any corrections or suggestions.

Coding

General

Git

C#

The following links are the basis for NML C# coding practices. Any NML practices that conflict with or are additional to these guidelines are noted below.

C# Coding Conventions

C# Coding Style

Secure coding guidelines

NML conflicts & additions

General

Naming

      for (var index = 0; index < input.Length; index++)
      {
          // Use index
      }

Layout Conventions

	if ((val1 > val2) && (val1 <= val3))
	{
	    // Take appropriate action.
	}
	Should be:
	if (IsVal1GreaterThanVal2() && IsVal1GreaterThanVal3())
	{
	    // Take appropriate action.
	}

Implicitly typed local variables

LINQ Queries

TypeScript

The following link is the basis for NML TypeScript coding practices. Any NML practices that conflict with or are additional to these guidelines are noted below.

Google TypeScript Style Guide

Conflicts or additions

React

The following link is the basis for NML React coding practices. Any NML practices that conflict with or are additional to these guidelines are noted below.

Airbnb React/JSX Style Guide https://css-tricks.com/react-code-style-guide/

An error has occurred. This application may no longer respond until reloaded. Reload