programming Jan 13, 2016

Comment Syntax in Programming Languages (and the Eye of Osiris)

I witnessed an uncommon debate the other day. Someone was asking why programming languages don't agree on a common syntax for comments.

Besides the usual indifferent answers such as "why would they", "why should they", and "it doesn't matter in the least", a couple of points were made:

  1. When designing a programming language, discussing the comment syntax is the ultimate form of bikeshedding (opens new window).
  2. An interesting corollary of Parkinson's law of triviality is Wadler's law of language design (opens new window), stating that when designing a programming language "twice as much time is spent discussing syntax than semantics, twice as much time is spent discussing lexical syntax than syntax, and twice as much time is spent discussing syntax of comments than lexical syntax."

In conclusion, why not just rip off Sketchy JS (opens new window)' "Eye of Osiris" operator syntax introduced by James Mickens?

{[~æ this is a comment *$€Beyonce

(A curly brace, a square brace, a squiggle, and the combined AE character. Place your comment after the first part of the Eye of Osiris and close the Eye of Osiris using an asterisk, a dollar sign, a euro sign, and a tiny picture of Beyonce.)

#programming language design

Follow me on Twitter, GitHub.

unless otherwise stated, all content & design © copyright 2021 victor felder