Naming

General

  • CamelCase is used to indicate different parts of a name.
  • Underscores are used for the RP2040’s register addresses and bits (see module MCU2).
  • Modules begin uppercase.
  • All exported items begin uppercase (but see RECORD fields).
  • CONSTs begin uppercase.
  • TYPEs begin uppercase.
  • RECORD fields begin lowercase, even if exported.
  • VARs begin lowercase (unless exported).
  • Exported PROCEDUREs begin uppercase, local (non-exported) ones lowercase.
  • PROCEDURE parameters begin lowercase.
  • If a part of the CamelCase-ed name is an all-caps acronym, then the next part begins lowercase, such as SPIdev, to preserve the acronym.

Remarks

  • I prefer local procedures to start lowercase, since I this way know when reading code if a procedure is part of the API.
  • Naming exported items should take into account that they will always be referred to qualified by their module name. For example, UARTd.Device, not UARTd.UARTdevice.
  • Some exceptions due to the Oberon tradition: writer and reader variables are usually W and R, respectively.