Skip to content

PRO3D Coding Guidelines

RebeccaNowak edited this page Apr 9, 2021 · 2 revisions

Formatting

try not to go beyond horizontal character 115

Namespaces

open namespaces only on top of file, not in module scope

sort namespaces according to their general applicability e.g. to avoid wrong namespace hiding. suggested sequence/grouping

  1. .net system
  2. aardvark base
  3. aardvark rendering
  4. aardvark media
  5. project specific
  6. specialized 3rd party

Functions

limit function parameters to the necessary minimum in number and size e.g. don’t pass the whole model or scene if you function only needs 3 members

always put thought into the sequence of parameters, especially with respect to piping

avoid nested functions, they are not really pure because they get hidden parameters via closures

Actions

make explicit, top level action types, as for instance SurfacePropertiesAction instead of SurfaceProperties.Action

GUI Coding

always write [iconName] and "icon" next to each other so it can be searched easily

Wrong: clazz "cube middle aligned icon"

Right: clazz "middle aligned cube icon"

MISC

use ~~ insteal of AVal.constant, needs open of FSharp.Data.Adaptive.Operators

Clone this wiki locally