Skip to content

Codestyle Guidelines

Smilla Fox edited this page May 28, 2021 · 12 revisions

general style guidelines

  • code and comments always in English
  • class comments document all instance and class attributes
  • test code is also code! (guidelines also apply here)

naming

  • package: IMAPClient
  • categories: IMAPClient-Core, IMAPClient-Tests
  • prefix: IC

punctuation

  • as few points as possible
  • no points at the end of a method

new lines

  • if one statement write everything in one line
  • opening bracket in one line, then a new line, closing bracket at the end of statement
  • new line after reciever of cascade
  • empty line after the method signature

whitespaces

  • whitespace before and after every binary operator; e.g.: (a + b) * c, z @ c
  • NO whitespace between two brackets for example: [[:sig | self inform: sig] on: Error do: self destruct]
  • NO whitespace before and after all brackets (self isTrue)

indentation

  • camelCase for variables, methods and parameters
  • first letter uppercase for class names and categories

comments

just don't write them

  • if you really really really need a comment: single line with comment only