String Literal - Declarative Notation

Declarative Notation

In the original FORTRAN programming language (for example), string literals were written in so-called Hollerith notation, where a decimal count of the number of characters was followed by the letter H, and then the characters of the string:

35HAn example Hollerith string literal

This declarative notation style is contrasted with bracketed delimiter quoting, because it does not require the use of balanced "bracketed" characters on either side of the string.

Advantages:

  • eliminates text searching (for the delimiter character) and therefore requires significantly less overhead
  • avoids the problem of delimiter collision
  • enables the inclusion of metacharacters that might otherwise be mistaken as commands
  • can be used for quite effective data compression of plain text strings

Drawbacks:

  • this type of notation is error-prone if used as manual entry by programmers

This is however not a drawback when the prefix is generated by an algorithm as most likely the case

Read more about this topic:  String Literal