Naming variables

Write things out, give them descriptive names. We are not stuck in the nineties — your IDE has auto-complete.

You won't spend more time typing because you give things descriptive names.

Accepted shorthands

SSI-specific terms that prefix expressions or occur multiple times in a line and are super clear:

  • vc: Verifiable Credential
  • vp: Verifiable Presentation

Non-SSI-specific terms that prefix expressions or occur multiple times in a line and are super clear:

  • req: Request
  • res: Response
  • idx: Index

Abbreviations that are usually not referred to with their written out name:

  • jwk, pem, jwt

Examples of bad variable names

Play guess the variable

  • val egfUri = "test" - what is an egf?
  • kpg.initialize(256) - Everyone would have understood keyPairGenerator.initialize(256)
  • val bcEC
  • tm - It's a TrustManagerFactory and referred to once
  • cpv.validate(...) - It would have been a CertPathValidator, it is referred to once