Skip to content

Commit

Permalink
docs/WorkflowGuidelines: lowly typed bad practice
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Aug 2, 2023
1 parent 13ba026 commit 467b047
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/WorkflowGuidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,19 @@

This way, the code is more performant (even though this is the least important aspect), readable (as we can immediately see what is the potentially problematic variable) and maintainable (as new unexpected but unrelated exceptions can be generated by future versions of the library that contains the function called).


* Not benefiting from your type system:

We use statically-typed languages (such as TypeScript and C#, as opposed to JavaScript and Python) so that our code can be
better protected by the compiler (instead of having to to cover every possible scenario with tests). Therefore, please
make use of the type system whenever you can, for example:

* Do not use edge-values to denote absence of value. Example: use null (`Nullable<DateTime>`) instead of `DateTime.MinValue`.
* Do not use `undefined` which is a pitfall from JavaScript (the fact that it has two kinds of null values is a defect in
its design). As we're using TypeScript we should be able to avoid the uglyness of JavaScript.
* Use Option types instead of Nullable ones if your language provides it (e.g. if you're using F# instead of C#).


* If you want to contribute a script, do not use PowerShell or Bash, but
an F# script. The reason to not use PowerShell is a personal preference
from the maintainer of this project (and his suspicion that it might not
Expand Down

0 comments on commit 467b047

Please sign in to comment.