I Was Wrong: Syntax Matters
I used to think syntax doesn’t matter in programming until I started playing the guitar. I couldn’t believe how wrong I was. I’ll tell you why syntax does matter – and why Reason has been great for OCaml.
I played the piano during my formative years. I first learned short minuets and Bach’s Inventions. Eventually I could play Mendelssohn’s fugues and preludes, and later sonatas by Mozart or Beethoven. Haydn’s variations were fun to learn. Ultimately I was able to play more difficult pieces by Liszt, Gershwin or Rachmaninoff.
I learned C during my first semester in college. I first learned variables, operators and control flow. Eventually I studied functions, memory allocation, and later data structures. Recursion was fun to learn. Ultimately I was able to understand more difficult constructs such as function pointers and variadic functions.
I felt like a fish out of water when I first picked up a guitar. Suddenly that familiar interface of 88 keys spanning 7 octaves was no more: the uniform, planar interface I was used to had morphed into a non-uniform, two-dimensional fretboard.
I took a programming languages class in my 4th semester. That was my first exposure to OCaml. I thought I had a good grasp of programming until I saw two semicolons (;;
) together. I didn’t look at OCaml again after that class. It wasn’t until years later that Reason eased me back into OCaml. This time for good.
I had no choice but to learn the fretboard. I persevered and eventually came to a good understanding of the strings, shapes, scales and patterns. I could have done the same with OCaml, but I didn’t have to. Reason made me productive at first. I was able to focus on learning the module system, interfacing with C or GADTs. In parallel, I learned to read and understand OCaml syntax.
Learning a new thing from a familiar perspective removed friction. And allowed me to pursue what matters to me: depth and mastery. Whether in a captivating concerto, or a new kind of computer system.
So does syntax really matter? If it didn’t, surely you wouldn’t object to changing all braces to parentheses? Or have whitespace be syntactically significant?
But we know that’s not the reality. People have preferences. Likely from previous exposure. Whatever you choose, I beg you, don’t you ever make me write Malbolge.
Happy hacking! - Antonio