What programming language has the most beautiful syntax?
What programming language has the most beautiful syntax?
The most beautiful syntax is subjective and varies from person to person. Some people might find a particular programming language's syntax to be elegant and straightforward, while others might find it unnecessarily complex. Ultimately, the choice of programming language depends on the specific requirements of the project and the preferences of the programmer or development team.
34 comments
[ 4.0 ms ] story [ 93.7 ms ] threadOtherwise for a high level language and perhaps a controversial pick, but I like JavaScript. Simple and straight forward, can often be reduced to the absolute minimum.
You can of course make every language ugly by writing ugly code.
Regular expressions look a lot like Brainfuck. A little trick is to break regexps up
into
various
lines
that
do
different
things
BTW: that's what I'm doing when programming in kdb+/q (APL family language), even though it's less idiomatic. But I prefer readability and maintainability over succinctness.
---
[1]
I'm sorry, have you ever seen a regular expression? No they do not.
Lack of cruft aside, even the basic syntactic choices are just plain better than OCaml, e.g.
- Commas instead of semicolons as separators in lists/records.
- Local declarations mirror top-level declarations.
- Distinct keyword to create a new type vs a mere type alias.
- ...
Stoic/Stoical/MStoical is a non-Forth forth... which handles strings well, 'string is a single world "string", and "longer string which can include spaces" give you fairly good coverage of all of your string needs, and unlike forth, it just takes the top parameter (a string) as an input into : to define a word, so you can do
This avoids a lot of confusion with modes and things that happen in the normal forth compilers.Much less strange new characters for new concepts, whilst still elegant. Not so the semantics, they suck a bit.
Ruby and C++ are almost perl/rust like, esp. ugly.
One thing I find particularly beautiful is the elegance of how if and else work, which obviates the need for a separate elseif/elif keyword.
I also like that types are always on the left, which provides a nice symmetry for assignments. When I declare `int x` with int on the left, what I'm saying is that an assignment of x (e.g., y = x) results in an int being passed to the left of the = operator. This is different from Rust, Zig, etc., which IMO get this wrong (or at least ugly/counterintuitive).
Edit: I googled, looks like you need Flutter too for that.