Skip to content

Coding Conventions

Steve Pieper edited this page Jul 7, 2017 · 3 revisions

Naming Conventions

  • Acronyms should have consistent capitalization
    • DICOM or dicom, not Dicom.
  • CamelCase or camelCase
  • Class names capitalized
  • method names lowercase
  • js filename matches class name (if one class in file) or descriptive (lowercase) name if file contains a related family of classes
  • prefer fully written out words (not abbreviations) and longer identifiers for variables and methods

Documentation

  • TBD

Testing

  • TBD

Language

  • target "modern and future" browsers
    • transpiling for older environments should be handled elsewhere
  • ES6 conventions
    • Classes
    • arrow functions
    • let instead of var
    • no modules/imports (yet)

Tooling

  • avoid package dependencies whenever possible
  • Avoid excess tooling in dcmjs proper
  • Create other repositories and projects for
    • packaging
    • transpiling
    • integration with web frameworks
Clone this wiki locally