Skip to content

Latest commit

 

History

History
86 lines (67 loc) · 1.68 KB

source_code_itself.adoc

File metadata and controls

86 lines (67 loc) · 1.68 KB

Source Code Itself

Conventions, Idioms 🥷

  • e.g. pep8, zen of python

import this

⚠️ Redundant information in naming

Reduce useless noise

Repeated informations

package org.mycompany.worlddestroyer;
/**
* The implementation of the Death Star. (1)
* @author Joe@empire.org (2)
*/
public class DeathStarImpl // (3)
             implements DeathStarInterface // (4)
{}
  1. Tells nothing more than the class signature

  2. In internal projet, maybe rely on version control history

  3. Of course it is an implementation

  4. Of course it is an interface

  • @author does not encourage collective code ownership

Which is more readable?

Exception class names suffixed with 'Exception'
Removing 'Exception' suffix of exception class names does not reduce meaning, on the contrary

Domain Driven Design

  • Ubiquitous Language

Domain Specific Languages

  • Code that reads like prose

  • Fluent interfaces