r/ProgrammingLanguages • • Jul 31 '24

Blog post Clean Syntax?

All my replies and the original contents of this OP have been withdrawn. They were a complete waste of time.

From what I can gather, everybody is happy with poor syntax in their languages, nobody is interested in 'clean'.

Someone posted, with a dozen upvotes:

Your example is optimized to your language's special capabilities.

I replied:

"No, pretty much everything in my syntax is cleaner than the C equivalent."

That got multiple downvotes for stating a fact.

There was also this:

For your own toy language by all means use your own syntax

This reinforces my original implication that simple syntax is only suited for toy languages, and not serious ones.

However too much of this was about my language, but that was only an example. There seems to be much irrational distrust of clear syntax for any language.

Maybe, clear code is associated with older languages which no one likes anymore?

(Original examples.)

2 Upvotes

35 comments sorted by

View all comments

5

u/Kaisha001 Jul 31 '24

I find personally that a good syntax is easy to skim/read and identify the larger components.

Now it's probably a lot of 'mental inertia' talking here, but I like the { }, ( ), [ ] syntax blocks because it makes it easy to see what belongs to what.

f(a, b, c) or f[a, b, c] is easier to read than say f a b c, even if the later makes sense in the language.

Likewise I've always preferred { } or similar delimiters to begin/end style (and I've been working with verilog a lot lately so begin/end you do get used to) since I find it easier to read.

Even in general languages we use punctuation to break up text and make reading easier.

record R1 = {                     # natural alignment (no padding)
    u8 a
    u64 b
    }

record R1 = [
    u8 a
    u64 b
    ]

I find either of those easier to read. But it's your language, those little details are as much personal preference as anything.

0

u/[deleted] Aug 01 '24

[deleted]

0

u/Kaisha001 Aug 01 '24

People get weirdly dogmatic over language syntax it seems...