Arc Forumnew | comments | leaders | submitlogin
1 point by rocketnia 4768 days ago | link | parent

In Common Lisp and Scheme, the syntax is pretty darn regular: Pretty much everything is (or can be) a reader macro. It's just that the string syntax (the #\" reader macro) and the list syntax (the #\( reader macro) are rather arbitrary and inconsistent with each other. It's mostly a matter of readability:

  ; current
  (def foo (a b)
    (+ "foo: " a b))
  
  ; somewhat more consistency
  (def (foo ((a (b nil
    ((+ ("foo: " (a (b nil nil
  
  ; a somewhat consistent version for a lisp without cons cells
  (4 def foo (2 a b
    (4 + "foo: " a b
  
  ; an extremely consistent version, without the need for escape
  ; sequences or separating whitespace
  (^4 |^3def |^3foo (^2 |^1a |^1b
    (^4 |^1+ "^5foo:  |^1a |^1b
(I put in some whitespace anyway 'cause I'm nice like that.)

The real issue here is that a syntax that stops at providing reader macros isn't arbitrary enough to meet the arbitrary demands of readability, so the individual syntaxes end up having to make the choices the core didn't. That makes for a greater number of arbitrary choices overall, and that more or less determines the apparent number of arbitrary choices made, and someone who has a similar but less arbitrary alternative in mind (regardless of whether it's possible to achieve) will see inconsistencies.

The arbitrary aspects of a language might be distracting and reduce productivity, but on the other hand they could punctuate the programming experience in an enjoyably artistic way, or even keep a programmer's attention focused while they plan their next moves. Maybe we don't always know what's best for us....

But I think we'll better know the full benefit of background music when we have convenient blank slates to compose it on. Programming's enthralling enough for me without background music anyway. ^_^ So I might as well continue to apply Occam's Razor without regret.