r/AskProgramming • u/H1BNOT4ME • Aug 16 '24
Which programming language you find aesthetically attractive?
For me, Ada is perhaps the most aesthetically pleasing language to write and read. It has a pleasant visual structure with sections nicely organized into blocks.
package State_Machine is
type Fan_State is (Stop, Slow, Medium, Fast) with Size => 2; -- needs only 2 bits
type Buttons_State is (None, Up, Down, Both) with Size => 2; -- needs only 2 bits
type Speed is mod 3; -- wraps around to 0
procedure Run;
private
type Transition_Table is array (Fan_State, Buttons_State) of Fan_State;
Transitions : constant Transition_Table :=
(Stop => (Stop, Slow, Stop, Stop),
Slow => (Slow, Medium, Stop, Stop),
Medium => (Medium, Fast, Slow, Stop),
Fast => (Fast, Fast, Medium, Stop));
end package State_Machine;
package body State_Machine is
procedure Run is
Current_State : Fan_State;
Fan_Speed : Speed := 0;
begin
loop -- repeat control loop forever
Read_Buttons (Buttons);
Current_State := Transitions (Current_State, Buttons);
Control_Motor (Current_State);
Fan_Speed := Fan_Speed + 1; -- will not exceed maximum speed
end loop;
end Run;
end package body State_Machine39
u/rambosalad Aug 16 '24
C# is the most readable at a glance to me. Not my favorite language though
14
u/Kaos_nyrb Aug 16 '24
C# is just C++ with the ugly removed. I love it.
→ More replies (1)7
u/NocturneSapphire Aug 17 '24
I'd argue it's much more similar to Java than C++, both syntactically and in execution (both compile to an IR, which is then JIT compiled to native code at runtime). And the IR/runtimes both also support additional languages, like Scala/F# for functional programming.
5
u/EdiblePeasant Aug 16 '24
Let us say I wanted to copy and paste C++ code in an IDE doing C#, then make modifications for C# syntax. Is it doable, or would it be better to start from scratch?
→ More replies (7)6
u/user926491 Aug 16 '24
depends on how advanced the code is but universally it's better from scratch
→ More replies (2)5
u/trpittman Aug 16 '24 edited Oct 01 '26
Redacted my comments after getting banned from worldnews for talking about Israel's propaganda budget.
26
27
9
9
u/The-_Captain Aug 16 '24
Everyone is going to put their favorite programming language.. but in terms of aesthetics I can't see how you beat Lisps. The structure of homoiconicity is sublime.
Programming in Objective-C back in the day after having learned Python just months before made me feel like a real grownup developer so shoutout to that
→ More replies (10)
8
19
u/miyakohouou Aug 16 '24
Haskell. You can write ugly Haskell for sure, but in general I really love how lightweight the syntax is.
→ More replies (2)6
u/zFlox Aug 16 '24
Yes, Haskell with code ligatures font is chefs kiss. Wish I could use it more.
→ More replies (1)4
27
u/PoetryandScience Aug 16 '24
C Brilliantly simple; simply brilliant. You can relate directly to the code in the machine. Designed top be the easiest compiler for the compiler writer to write. Once you realise this the simplicity of its form is a delight. You can do whatever you like.
It is completely unrestrained so care needed. Like the origional UNIX, it assumed complete competence.
→ More replies (16)5
u/Kallory Aug 16 '24
Agreed. I think the only thing not aesthetically pleasing about C is when you start creating large structs with different data types. It feels inconsistent visually.
I think also the way some people do all their declarations at the top of a file is also inconsistent compared to the C code actually doing the work. When you run into 10+ lines of imports and then a bunch of CONST declarations in all caps. I know this makes the code more readable but I always feel like I'm being forcefed a bunch of information that may or may not be relevant to something I'm trying to understand or an extention of the code that I'm trying to implement.
5
4
u/PoetryandScience Aug 17 '24
Data declaration in C only requires two mutually calling routines from the compiler writers point of view. The mutual co-call being triggered by the precedence of parenthesis. This simple (as far as the compiler writer is concerned) allows you to build unlimited elaborate data structures. But it does mean that the code writer must read declaration starting from the middle and not left to right as in spoken languages. Tricky until the delight in its simplicity replaces annoyance.
Declaring information early makes writing the compiler easier with fewer passes required.
C is KISS. Interpreted by the military as Keep It Simple Stupid.
The only thing (eventually) that was built into C that is for the code writer and not the compiler writer was arrays, Pointers being already available and mapping directly into the machine code.
1
5
u/rwilcox Aug 17 '24
Smalltalk, so much
Syntax that fits inside an index card? Readable function calls? Using methods for things that would be keywords in other languages?
You canSign: me status: Direction Up
→ More replies (1)
40
u/lordnacho666 Aug 16 '24
Nobody gonna put in a word for python? No braces, indentation takes care of blocks?
35
u/spacedragon13 Aug 16 '24
These people are desperate to appear sophisticated or something 😂
6
Aug 16 '24 edited Aug 16 '24
I picked Go because I prefer the strictness of it. And I say this as someone who created a whole Object Oriented scripting language that models the dynamic nature of Python:
# Outputs all binary codes of a specified length include: __CURR_CONFIG__, __LOG__ str: "" func binary(bin, x) if(x.==(0)) str.concat(bin, "\n") return x.--() binary(bin.add("0"), x) binary(bin.add("1"), x) x: input_int("Enter number -> ") binary("", x) write_file("data/bin.txt", str)→ More replies (2)19
8
Aug 16 '24
I don't get all the hate on indentation, the formatter will indent your curly brace wrapped, semicolon ended code anyways.
Indentation makes the code more legible regardless of language.
→ More replies (3)12
u/MazieStationary Aug 16 '24
The braces make code more readable and pleasing in my personal opinion
→ More replies (1)6
u/BeverlyGodoy Aug 16 '24
I think it differs from person to person but I would say python is more appealing to my eyes because it's fair for all. I have seen new engineers write C++ and it can be super hard to read because they start lines randomly. So yes, braces or no braces, I think it's a matter of personal choice on what is aesthetic.
→ More replies (1)3
u/dnult Aug 16 '24
We recently had a bug deployed to production because an indent was missing.
→ More replies (3)3
u/zztong Aug 17 '24 edited Aug 17 '24
I do like Python, but I'd rather have the braces from C/C++/C#/Java for compound statements. I'd still indent, but I think the braces add clarity. I realize Python has used braces for dictionaries.
→ More replies (1)7
u/useful_person Aug 16 '24
After having helped people who don't indent their C++ code at all, I can honestly say forced indentation is just chef's kiss
13
u/RicketyRekt69 Aug 16 '24
Python is the opposite of what I would call aesthetically pleasing. Indentation for encapsulation is stupid. Doesn’t help that it’s dynamically typed
→ More replies (11)6
→ More replies (7)10
u/Ento_three Aug 16 '24
I reaaaally dislike the indentation of python. I much prefer using braces. Call me weird, but yeah, I often make errors with indentation and far fewer errors with braces.
6
Aug 16 '24
Sometimes I edit with multiple IDEs that all have different indentation lengths. This makes editing Python code incredibly annoying for me. Python's syntax is garbage, imho.
→ More replies (1)
4
4
7
3
3
u/exotic_anakin Aug 16 '24
I think Kotlin, Swift, and Dart are all pretty nice aesthetically. Also JS/TS, but that's probably just Stockholm Syndrome ;)
3
3
3
u/Rikai_ Aug 16 '24
I love the look of Elixir
And weirdly I also like reading Lua code
C++ is great when I write it lol, a lot of people codebases are horrible
3
u/greenappletree Aug 16 '24
Perl because it lets u get away with many thjngs and allows for much creativity haha
→ More replies (1)
3
10
u/spacedragon13 Aug 16 '24
Python 🐍
After leaving Python for other languages and coming back, it looks ridiculously simple and straightforward.
6
6
8
2
u/SpaceMonkeyOnABike Aug 16 '24
Up voting for Ada. There is a good set of reasons why it was used for teaching and it's structure and aesthetic are 2 of them.
2
2
u/plutoniator Aug 16 '24
C++, once you normalize for functionality. C++ is ugly until you try to do the same thing in another language.
→ More replies (5)
2
u/funbike Aug 16 '24
For certain domains, I like Clojure or other LISP dialects.
It's especially good for DSLs, and even better for ones with a symbolic math basis. A long time ago, I wrote a 3D ray tracer in LISP and it was especially good for creating a scene description language DSL.
2
u/fatmankarla Aug 16 '24
I don't have an answer for aesthetically attractive, but I have one that I don't like at all. Rust. I have no idea why, I like a lot of things about the language, memory safety, macros, so much to like. But every time I see it its like, god why so ugly.
2
2
u/CatalonianBookseller Aug 16 '24
Standard ML and Erlang but me mind has been damaged by VB6 some time ago so it probably don't count.
2
u/theclapp Aug 16 '24
I've gotten very used to Go in the last decade, so that. I especially love how gofmt makes everyone's code look the same.
Lisp. After you get used to it, the () tend to fade away a bit.
Haven't done any Ada since the early 90's, but didn't think much of it at the time, near as I can remember. Doesn't it have case-sensitive keywords? I hate that. (I may be thinking of Modula-2, though.)
→ More replies (1)
2
2
2
2
u/RomanaOswin Aug 16 '24
Simplify down Go or Rust, remove the lifetime cruft from Rust or the verbose error handling from Go, sprinkle in some elegant syntactic sugar, and (IMO) you have a very attractive language.
I prefer V over Borgo, but that may just be because I write more Go than Rust, so the syntax feels more natural.
2
2
2
u/zz9873 Aug 17 '24
If anyone says Rust I‘ll die. Also I don‘t really have much programming experience and from the languages I know at least a bit (Python, JavaScript, C#, C++) I really like C#.
→ More replies (2)
2
Aug 17 '24
Assembly. Cools like what you image code to look like as a kid. Awesome looking horrifying to read
2
2
u/CHARispronouncedCARE Aug 17 '24
Java, but the addition of features like lambdas and other “niceties” have started to severely decrease the legibility of programs.
2
u/Caramel_Last Aug 17 '24
I still have trouble understanding <T> SomeClass <T>. SomeClass<T, U> is easily readable. But what is <T>SomeClass<T>? I remember I was forced to do that once and I can't remember when and why was it so
→ More replies (1)2
u/Caramel_Last Aug 17 '24
I still have trouble understanding <T> SomeClass <T>. SomeClass<T, U> is easily readable. But what is <T>SomeClass<T>? I remember I was forced to do that once and I can't remember when and why was it so
2
u/Xemptuous Aug 18 '24
Honestly, C. I've loved to learn many different languages and get a feel for them all, and there's something about C that just looks clean and "to the point" compared to most other languages. Aside from that, Python if done right, and Zig are very aesthetically nice.
2
u/EcstaticAssumption80 Aug 18 '24
Call me crazy, but well-written modern structured COBOL with sensible naming conventions is super easy to read.
5
Aug 16 '24
Go (honestly, it's such a great language)
→ More replies (1)10
u/lovesToClap Aug 16 '24
Aesthetic is not how I would describe Go at all. Clear and pretty easy to understand, yes but I’m not a fan of the := syntax, the error checking all over the place, and there just seems to be some syntactic sugar missing. Something like Ruby is easy to call aesthetic because it uses a lot of syntactic sugar. Just me 2¢
→ More replies (3)
2
2
1
1
1
1
1
u/BaronOfTheVoid Aug 16 '24
Haskell...
or Smalltalk
separate arguments by spaces
have names so that the resulting sequence of function calls etc. resemble a sentence in almost natural language
that's beauty
1
1
1
u/azangru Aug 16 '24 edited Aug 16 '24
The more I look at other languages, the more I like the aesthetics of javascript and typescript. Although the asterisk in function*, or the # to designate private class fields (and records and tuples in the future) are pretty offputting.
1
u/Snypenet Aug 16 '24
to be honest? JavaScript, no joke. It's such a delight to write and read. Not Typescript on top of JavaScript, but just plain JavaScript.
1
1
1
1
1
u/Tarkus459 Aug 17 '24
Visual Basic. Its code is pretty. When I switched to C# I had a time getting over the extra punctuation.
→ More replies (1)
1
1
u/nrr Aug 17 '24
I find no language aesthetically pleasing, but there are some that are more ergonomic than others at the problems they solve.
Ada is nice though. SPARK giving me access to the why3 prover basically for free is an absolute joy.
1
u/mister_drgn Aug 17 '24
I think Haskell looks nice because it’s so sparse. You can write beautifully simple function definitions like
addTwo = (+ 2)
Then you start trying to understand all that sparse code, and you have to remember wtf the <*> operator does when it’s applied to functions vs when it’s applied to lists.
1
1
1
1
u/MadocComadrin Aug 17 '24
Not really any of them. Some are easier on the eyes than others, but plain text will always be, well, plain.
Proof assistants with IDE support for stuff like math symbols and super/subscripts is pretty nice when you're writing very short snippets though.
1
1
1
1
1
1
u/meSmash101 Aug 17 '24
Java, as long as you write as if you see the coder that will read your code as your brother/sister you really love and care about for. If you don’t care it can get sh1t really fast, you want to rip your eyeballs off their sockets!
→ More replies (1)
1
1
1
u/Top_Lime1820 Aug 17 '24
F#
Go watch Scott Wlaschin's videos on YouTube. It's just really beautiful.
The pipe operator |> with Fira Code font... chef's kiss
1
u/fahim-sabir Aug 17 '24
I am going with Erlang.
The idea of using a period as a line terminator is brilliant. Just like a natural language sentence.
I’ve never used it to do anything useful though.
1
u/Xinoj314 Aug 17 '24
Actually Smalltalk, that language has a rich history and many current languages are inspired by Smalltalk, it commercialized OO and TDD was first written in Smalltalk, the concept of IDE.
People are more familiar with Ruby, and Matz says that he drew a lot of ideas from Smalltalk, like monkey patching Core classes with new or overriden methods, concept of anonymous blocks
Smalltalk took a few wrong turns and became irrelevant when Java and Modern C++ came to the scene, but I really like the syntax and its history
1
u/notCamelCaseName Aug 17 '24
I'd say it really depends on what you're used to read, I like rust's aesthetic because I'm used to it and the compiler enforcing certain styling rules really helps with readability when discovering a new code, plus I like chaining function calls on iterators. My friends find it unreadable though
1
1
1
1
1
1
1
1
Aug 17 '24
I primarily code in python, C# and JavaScript.
For me it's C#.
It has the cleanliness and ease of use of high level language like JavaScript or python, but it strictly typed and static nature just makes it feel clean and sleek when the code base starts getting big.
Java and C++ just looks goddamn ugly to me.
Python and JavaScript just turns into slop when the classes get big.
1
u/Euphoric-Stock9065 Aug 17 '24 edited Aug 17 '24
Clojure, Common Lisp, Scheme, Racket, Fennel... any of the Lisps. Why? I can read them without ambiguity. I don't have to guess at operator precedence or syntax rules or much of anything really - the first argument is a function/macro call, the rest are args, nested recursively like a tree. That's all you need to remember, freeing the rest of your brain to work on the actual program.
All programs compile down to an AST but Lisps are the only languages that look like their AST. The simplicity allows me to visualize and think about the program as it is, not buried behind arbitrary syntax choices of the language designers. You can, of course, make your own arbitrary choices and extend the language with macros - but you're in control, not the language committee.
1
1
1
u/godfetish Aug 17 '24
LISP is very aesthetically pleasing. Very orderly and complete. I also liked the compiler that I wrote for generating the machine code for controlling a multi-axis robot. It very much looked like it could it have been the numerical interpretation of audio as a machine would hear it. - a fellow human
1
u/NoCoincidence123 Aug 17 '24
C ... love the way the curly braces and indents demarcate code blocks, and the stripped down simplicity.
1
1
u/Jerreh_Boi Aug 17 '24
I always thought Swift read great back when I used it. Now I work with Python and C#. I guess I find the C-style format more attractive because I much prefer C# over Python now
2
1
u/lemgandi Aug 17 '24
After a lot of professional experience in C, C++, and Python, I been writing a lot of Lua recently. The "Everything is an Associative Array" structure can lead to fun elegant code. But it can also be a gateway to weird inscrutable code. Overall I find it cool.
1
1
u/Caramel_Last Aug 17 '24
Java has some weird aesthetic quality for me. Nothing is really cryptic about java. Linus said he can look at C and know what it will be in assembly code. Well I'm not him but Java does something similar for me I guess. I can read Java and understand what it's about on high level. Doesn't mean it's always correct but it's better than nothing. And while it's verbose it isn't Cobol level verbose. Whenever I write a little bit of JS I keep finding myself using int i = ... when I should be doing let/const.. it's like final and then variable name comes.. it's so weird. I don't like :int syntax of ts either. And for same reason I think Java is more beautiful than kotlin
1
1
u/gzk Aug 17 '24
APL.
I can't read it or write it, but I saw it in a "kid detectives solve mysteries using programming" type book as a little kid and thought the mathematical symbols were cool and always wondered how people typed them.
2
1
1
1
1
1
1
1
1
1
1
1
u/heybart Aug 18 '24
COBOL ! I'm handicapped and I prefer languages that don't require me to hit the shift key a lot
→ More replies (1)
1
1
1
1
u/karasutengu Aug 18 '24
Python the most intuitive, Javascript the most fun, TRAC the most interesting... OPS5 the most trippy
1
1
1
u/fasti-au Aug 18 '24
Aesthetic break llms. It can’t handle white space so it sorta isn’t in my future
1
1
u/QuietSheep_ Aug 18 '24
Nim, Python outside of boilerplate and ugly double underscores, Haxe, and Lua.
Also, Gdscript, but that's engine specific.
1
1
1
1
1
1
1
1
1
u/VoraciousTrees Aug 20 '24
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
1
1
1
u/rebcabin-r Aug 21 '24
Mathematica (Wolfram) is best for sheer beauty. C++ is what we must use, but it's so so noisy.
1
1
1
u/MartinHelmut Aug 23 '24
COBOL. It gives me a cassette futuristic feel just looking at it, at least the older versions with capitalised keywords. For me this is a language that could have been used in the Nostromo board computer (Alien), and I love that style.
1
u/micronian2 Aug 23 '24
Of all the languages I have had to use, I find Ada still the best looking one. I especially like the fact that it allows me to model scalars with more details in a readable way. Sure it can be more verbose than some other languages, but I find it easier to comprehend, even after not seeing the code for many months.
1
u/Intellosympa Aug 26 '24
Forth
Absolute freedom. Minimalist footprint. And you can dive into the compiler to understand or modify it.
1
1
u/Engineer_5983 Sep 07 '24
Objective C blows. Swift is brilliant. I find Swift easy to read and aesthetically very nice. I’m surprised more aren’t using Swift for new tools - Apple open sourced it.
1
Oct 30 '24
Visual Basic (.NET)
I love the coding conventions and how they use capitalization.
Has the most defensive verbose syntax, to me. Just enough, without going overboard.
No semicolon at the end of statements.
I really dislike how Ada "over-uses" underscores.
Honestly, I kinda just don't like ALGOL-family (Pascal, Delphi, Ada) languages, syntactically. They're too much for me...
0
Aug 16 '24
[deleted]
6
u/itijara Aug 16 '24
Elixir has a similar Aesthetic.
→ More replies (1)4
u/a3th3rus Aug 17 '24
At a glance yes, but not that similar when you deep a little bit deeper. I like Elixir more than Ruby.
6
u/CaffeinatedTech Aug 16 '24
I've been checking out ruby lately. I like it a lot, and prefer it over python. Ruby with HTMX would be pretty sweet.
→ More replies (2)1
1
u/armahillo Aug 16 '24
Ruby, as well!
Rails is 🤷♂️ I appreciate the aesthetics of a well organized app, though that is also very possible without rails though!
→ More replies (2)1
Aug 17 '24
Remember all the "I ♥️ Ruby 🥰" blog posts? That was almost 20 years ago. Remember blogs?
→ More replies (2)
17
u/Shadowsake Aug 16 '24
Elixir is one of my favorites. Haskell too, though I haven't found time to study it yet.