Naming conventions and type prefixes
Uses names that reveal intent without confusing prefixes with typing.
Overview
Prefixes such as c, n, d, l, a, b and o help readers recognize text, number, date, logical, array, block and object in team conventions. They neither declare types nor validate automatically. Combine a prefix with intent: nQuantity says more than nValue1. Preserve Protheus and external-contract identifiers; localizing author variables does not authorize renaming PARAMIXB or dictionary fields. Official good-practice guidance supplies the standardization context; the small example is an editorial proposal rather than a universal project convention. (TOTVS, n.d., ref. 1)
Commented example
#Include "Protheus.ch"
User Function Ed315()
Local cSummary := "Test"
Local nQuantity := 2
Local lValidated := .T.
// Prefixes express intent without validating values.
If lValidated
ConOut(cSummary + ": " + cValToChar(nQuantity))
EndIf
Return NilFictional summary with quantity 2. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Avoid ambiguous abbreviations and mid-flow type changes. Document API or legacy naming exceptions.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.