Skip to the content.

Coding Conventions

The following standards apply to all development platforms. Specific standards can be found in explicitly named readmes and extend/override general ones:

Indentation

4 spaces. No tabs.

New Lines and Blocks

TODOs

TODO comments are always welcome to keep track for all devs on what people are currently working on/what is to come. But all TODOs should always reference the issue number it will be part of.

Bad

// TODO Remove the setter, since id should later be constant.
public void setId(int id) {
  this->id = id;
}

One does not know who might be working on that TODO, or if it became redundant.

Good

// TODO #69 Remove the setter, since id should later be constant.
public void setId(int id) {
  this->id = id;
}

In this case the GitLab issue provides context and meta information on the TODO.

Always check if all your TODOs are finished before finishing a issue.

General Naming

Naming is specific the development language. The following points are to be adhered for Java and C#

Unit Tests

Unittests must be structured in given/when/then notation:

@Test
public void sampleUnittest() {
  // given (assignments here)
  PatientDao patientDao = new PatientDaoJdbcImpl();
  PatientId id = new PatientId("123");

  // when (execution here)
  Patient p = patientDao.retrievePatientById(id);

  // then (asserts here and never above, no assignments or executions allowed)
  Assert.assertNotNull(p);
}