Debating Syntax is Dumb

V good points! Have you looked at Haskell / Elm style syntax? Would love to hear whether that’s easier to understand…

I am also a big fan of |>. Somehow I think that has more to do with semantics than Syntax, i.e. you get a sort of currying out of the box with many FP languages, but you have to jump through more hoops with other languages…

Thanks for the comment. As a beginner programming language builder / tinkerer, I never thought about this angle before.

1 Like

Maybe opinionated / standard code formatter could help.

Really interesting.

Consistent indentation is helpful, What helps even more helpful (and let’s be clear, I can’t speak for anyone but myself) is syntax highlighting. Having a combination of shape (indentation) AND a different color keyword (end) is probably what helps me be employable. I think that’s why I find do/end easier than {}: they’re larger and easier to discern, especially when they are a different, consistent color.

Aside from my minor quibble about parens in anonymous functions, the Elixir formatter had been a godsend. ALL languages should have an opinionated formatter. :slight_smile:

Ah, there was one other thing I used to do that I knew was “wrong” but was really helpful: move the do in a with statement to a new line. It’s inconsistent with Elixir syntax, but it’s a visual delimiter between the condition and the logic sections of the code.

After 9 months or so of using the formatter, I’ve been able to retrain my brain around the way it lasts out code.

Oh, and really big font helps, too. :grimacing:

2 Likes

I was thinking earlier: would it be true to say that dyslexic ppl are just more sensitive to syntax issues?

I.e. whether they are just better at identifying syntax problems, than a user whose brain can take on a little extra cognitive load at little extra cost…

But nevertheless also experience some superfluous cost of effort…

The syntax issues are perhaps there for everybody, just harder to spot or describe for many…

Then again, perhaps dyslexia’s impact differs from person to person…

But your issues make sense to me, but perhaps just not as obvious to spot for many.

One of the problems is that even for people that are diagnosed with the same issues, the symptoms are different. So, I’m quite sure there core are sets of rules that would make sense as a starting point, but I’m sure there will be folks they don’t work for.

I can’t be clear enough that I can only speak from my own experience. I haven’t worked in a language that I can’t eventually adjust to but my issues are mild compared to others’. I’ve worked professionally in Java, JavaScript, Ruby, Python, Go, Elm, and Elixir. Elixir and Ruby are the easiest for me, with Elixir being easier than Ruby by a small margin. They required the shortest adjustment time. And, again, if it weren’t for syntax highlighting, I’d probably have to find another profession.

1 Like

Too true here! Different things teach one different ways of doing things. :slight_smile:


As for syntax I can adapt to about anything, however I highly HIGHLY prefer the syntax to be:

  1. Consistent (Elixir has a couple of inconsistencies that bugs the heck out of me).
  2. A hard-defined spec (I’ve still yet to find a spec for elixir other than the source code itself, C++'s spec is monstrously huge, never go that far, OCaml hits a VERY nice balance of perfectly defined spec and readability here).
  3. The syntax matches the language (Elixir’s parser actually parses a lot of invalid forms that later in the compiler pipeline will be rejected, which makes building secondary parsers very difficult, in addition the Elixir AST can represent a lot of code that just cannot exist syntactically).
  4. Unambiguous in representation (should be obvious, elixir has a few pain points here but not as big as the above).
  5. And a dozen or gross of personal preferences (the above 4 points are the big big 4 points focused on in language design courses in schools, like here, that every language should follow).

Probably best ‘syntax’ overall is easily S-Expressions as it matches the above 4 perfectly, however it does tend to be a little…hmmm…verbose (though macro’s and read-macro’s can fix that!).
For great ‘designed’ languages, I hesitate to say OCaml as it would easily have a few changes if designed fresh, but OCaml is great as it’s syntax is fully representative of the language, is unambiguous, and is consistent (excluding type names and other such non-syntax things).
And of course languages like FORTH the syntax is just beyond trivial! ^.^

Those are just in-general my issues with Elixir’s syntax, the biggest being that it conflates form with functions in some very odd ways at times. ^.^;

2 Likes

You’re right to say that “rubbish” is subjective, but there may be a valid intuition driving said subjective feelings. Where there is smoke, there is often (though not always) a fire. If enough people find a certain syntax distasteful, I believe it would warrant an investigation into why. Though, I don’t have an exact answer as to how many people should be called “enough”.

1 Like

When I was younger, I was far more interested in art and prose than in programming. Now that I’ve adopted programming as my main hobby, I find beautiful syntax to be a huge motivator for me. During my refactoring stage, I often reorganize the layout of my code as a means of pattern searching, attempting to find better abstractions within my logic. Though I try not to commit formatting changes needlessly, as the git diffs can get quite confusing that way.

2 Likes

Debating Syntax is Dumb

Syntax is the lowest form of critique. The lowest . I cannot take it seriously.

How do you feel about debating debating syntax? :wink:

4 Likes