r/ProgrammingLanguages • u/[deleted] • 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.)
3
u/jason-reddit-public Jul 31 '24
"Clean" is a subjective standard.
Lisp s-expression syntax is very regular and I personally consider it clean however most programmers dislike it (hence the Lisp means Lost In a Sea of Parenthesis derogatory comments).
Python, Ruby and even Go are both fairly clean looking to me and I suspect most programmers agree. Forth is pretty simple and regular though it has always been fairly niche. Assembly language, especially for risc inspired machines is very clean in many ways yet higher level languages are designed for more reasons than just portability.
Brainf*ck has is very regular syntax although it was literally designed to look terrible and be difficult to write or read (probably a universal consensus).
Objectively, we could look at different measures of complexity. For example the size of the grammar though the Brainf*ck, assembly and Forth examples already tell us that this measure won't necessarily determine popularity.
Obviously syntax is only part of the equation. The semantics and another subjective concept I'll call "power" usually comes into play. It's so subjective that I won't try to define it but I think most people know what I mean. (Technically all Turing complete programming languages are kind of equal in "power" though some probably lead to more efficient execution on our modern hardware designed literally to run C like languages as quickly as possible.) Languages with lots of packages available let you create a program in less time though you give up some control when you use someone else's code.
To wrap up, many factors determine a language's success. If there was a universal best language we would all be programming in it by now.