6 ms·
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.
- ofalkaed 3y agoAssembly. It feels tangible, nothing is hidden, it is just bits and registers.
- GianFabien 3y agoThe AT&T syntax drives me bonkers. All the %, $ etc characters. Not to mention the numerous '.'prefixed directives. It takes immense concentration to grok the assembler output of C compilers.
- sloaken 3y agoI specifically like PDP-11 assembly. Motorola 68K is very similar.
- sneed_chucker 3y agoEh, depends on the ISA.
- fuzztester 3y agoI liked 6502 assembly and did some hobby programs in it.
- raxxorraxor 3y agoIf I can pick anything my vote goes to Pancake Stack: https://esolangs.org/wiki/Pancake_Stack https://esolangs.org/wiki/Pancake_Stack Otherwise 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.
- pamoroso 3y agoLisp, because of the beautiful way its syntax represents code as data and data as code.
- Lk7Of3vfJS2n 3y agoI don't find the parentheses beautiful.
- GianFabien 3y agoNone of them! Programming languages are designed to be machine parsed and compiled to working code. For me, most languages incorporate too many punctuation characters ("fly dirt" as a co-worker once called them) with different meanings for different languages. I almost suggested Lisp, but the long-hyphenated-function-names detracts from its otherwise simple syntax.
- adammarples 3y agoProgramming languages are obviously also designed to be parsed by humans
- beardyw 3y agoOf regularly used languages I would go for SQL in that quite often it does just what it says. It was developed for business people to use, and I pitched it as that early on, but ... not really.
- gregjor 3y agoSQL is declarative by design, so it literally does what it says. Useful but not beautiful.
- gregjor 3y agoC, but beauty is in the eye of the beholder.
- atmanactive 3y agoPerl.
- dylwi 3y agoI would pick ooRexx: https://sourceforge.net/projects/oorexx/ https://sourceforge.net/projects/oorexx/ Personally, I consider its free-form and case-insensitive syntax to be amazing.
- nivertech 3y agoIn decreasing order: - English (the ChatGPT/LLM programming language) - ML family - SQL (queries and DDL only - DSL) - Algol family (Algol 60/68, Pascal, Ada) - Logo NoSyntax is the best syntax? - TCL/Tk - Forth - Lisp family ... ETOOMANYSIGILS: - Perl / Ruby / Elixir ETOOMATHLIKE: - Prolog / Datalog / Erlang ETOOVERBOSE: - PHP / Java / C# ETOOANCIENT - SQL (Stored Procedures and Triggers) The worst: - various assembly languages - LaTeX - APL family - Brainf*ck
- legrande 3y ago> Brainf*ck Regular expressions look a lot like Brainfuck. A little trick is to break regexps up into various lines that do different things
- nivertech 3y agoyes, if your PL supports multiline regex with end of line comments[1]. 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] var urlRegex = new RegExp( /(?:(?:(https?|ftp):)?\/\/)/.source // protocol + /(?:([^:\n\r]+):([^@\n\r]+)@)?/.source // user:pass + /(?:(?:www.)?([^/\n\r]+))/.source // domain + /(\/[^?\n\r]+)?/.source // request + /(\?[^#\n\r]*)?/.source // query + /(#?[^\n\r]*)?/.source // anchor );
- rak1507 3y ago> Regular expressions look a lot like Brainfuck. I'm sorry, have you ever seen a regular expression? No they do not.
- b20000 3y agoc++
- jarpschop 3y agoI find Python and Haskell both very elegant.
- frou_dh 3y agoI really like the syntax of Standard ML. It's pretty much the essence of that kind of static functional language, without a bunch of experiments and cruft bolted on. 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. - ...
- fuzztester 3y agoWhat implementation do you use?
- frou_dh 3y agoMLton. IMHO Poly/ML is borderline unusable because its build-system is so inferior to MLton's. I've never used SML/NJ but I get the impression that it has a lot of history and is kinda sprawling.
- fuzztester 3y agoThanks.
- mikewarot 3y agoFree Pascal handles pointers in the cleanest way possible. @ is the address of something, and ^ is what something points to. There's no ambiguity about anything, and certainly no confusion with array indices. Begin/End might be a bit verbose, but it better impedance matches with my view of the world, so it works well for me. 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 'cube : dup dup * * ; This avoids a lot of confusion with modes and things that happen in the normal forth compilers.
- flipcoder 3y agoPython
- rurban 3y agoTypescript over Python for me. Prolog also of course. 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.
- torstenvl 3y agoC has to be up there. 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).
- strokirk 3y agoEven though I prefer Python, I find Ruby can be very beautiful. Allowing ? and ! as part of variable and function names is very nice.
- account-5 3y agoI quite like dart.
- fuzztester 3y agoCan you create desktop GUIs in Dart alone, or do you need to use Flutter? Edit: I googled, looks like you need Flutter too for that.
- theihor 3y agoLisp. Best syntax is no syntax.
- rochak 3y agoPython. I love working with it (except when it comes to package management and distribution).