Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.65 KB

CrazyMultilineString.md

File metadata and controls

38 lines (26 loc) · 1.65 KB

Crazy multiline literals (CrazyMultilineString)

Description

In source text, multi-line constants can be initialized in two ways:

  • 'classic', which uses line feed and string concatenation
  • 'crazy' where lines are separated by whitespace

The second method complicates the perception; when using it, it is easy to make and miss a mistake.

Examples

Difficulty understanding:

String = "BBB" "CC"
"F";

Classic variant:

String = "BBB" + "CC"
         + "F";

Sources