Oberon RTK

Naming

How program elements are named

General

  • CamelCase is used to indicate different parts of a name.

  • Underscores are used for register addresses, bits, values, and flags.

  • 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 UARTstr, to preserve the acronym.

Remarks

  • I prefer local procedures to start lowercase, since this way I know when reading code if a procedure is part of the module API.

  • Naming exported items should take into account that they will always be referred to qualified by their module name. For example, UARTdev.Device, not UARTdev.UARTdevice.

  • Some exceptions due to the Oberon tradition: writer and reader variables are usually W and R, respectively.

Last updated: 11 April 2025