3 ms·
I was thinking axes of 'readability' and 'expressiveness' would make a nice chart for programming languages.
by silisili 3y ago
I was thinking axes of 'readability' and 'expressiveness' would make a nice chart for programming languages.
- fuzztester 3y agoAs long as the negative sides of both axes are included too. e | | | -r ------------- r | | | -e
- fuzztester 3y agoFilling in language names is left as a fun exercise for the reader.
- silisili 3y agoPython top right, Go bottom right, Brainfuck bottom left, Rust or Perl top left. (Don't kill me fanatics)
- Dylan16807 3y agoDo you think many people would put Rust and Perl next to each other?
- silisili 3y agoIn this chart, sure. Not like, the same dot, but both in that quadrant. But those are my personal opinions, as I find both difficult to read yet very expressive. YMMV.
- Dylan16807 3y agoInteresting. I haven't heard anyone complain that Rust is harder to read than the average language, just stuff about writing it.
- NikkiA 3y agoSome of the dewrapping constructs can get a bit gnarly looking when there is something wrapped in a wrapper in a wrapper sort of thing. But it's probably largely author-dependant and you could write the same code more readably.
- Linux-Fan 3y agoHaving never written anything in Rust but read and “translated” some code (maybe 3k LOC?) from Rust to Ada, I can tell that I found Rust rather hard to read and harder than e.g. Ruby (which I also do not know how to write but translated to Java once). Here is what I guess makes it hard to read for me: There are many terse keywords (fn, mut) and symbols (&, [], ->) along with some things that look like Java annotations and are equally hard to understand without knowing the language. Array slices look easy enough to understand [a..b] but surprise: b is actually exclusive? The definition of arrays is the most weird one I have ever encountered [u8; n]. To me Rust looks much like C++ with a twist and people rightfully complain about C++ often :) The documentation about language and libraries was solid for my cases and most of the time it seemed enough to ignore most of the tiny key words and symbols without losing much understanding of what the code intends to do. If I were given the choice I'd probably still prefer Rust's weird syntax with added safety over the clarity of C which offers no safety at all (not talking about obfuscated code contests here).
- Dylan16807 3y ago> To me Rust looks much like C++ with a twist and people rightfully complain about C++ often :) But would you put C++ next to Perl in terms of difficulty reading? I wouldn't have thought they were particularly close. (In terms of normal code at least, not the implementations of ultra-generic templates.)
- 2colours 3y agoThe difficulty of reading Perl is probably overclaimed and overrepresented. Let's not forget that we are comparing a pretty darn low-level language to a fairly high-level one. And regarding design principles, I think the comparison is clearly on point. These are languages where the motto is basically "if you can't do it (if you can do it but it's perceived too long that also counts) then the language needs to be horizontally extended to account for this use case". My vague impression was that Rust is still a (significant) simplification over C++. (Ada is a funny case because it seems to be deliberately designed to be hard to read and hard to write, overall a pain in the arse, in the spirit of "if you never reach flow, you will always be very focused", I guess.)
- pnut 3y agoI was a professional perl5 developer for years and when working through https://doc.rust-lang.org/book/ https://doc.rust-lang.org/book/, kept remarking to myself how similar the languages are, in terms of expressiveness, complexity, and implied developer disciplines. Rust feels like an industrial version of Perl to me.
- thayne 3y agoI don't think those are orthgonal though. For example, if a language lacks expressiveness, that can hinder its readability. But on the flip side, if it is highly expressive that can also potentially hurt readibility, especially if the reader isn't very familiar with the language. Although both are somewhat subjective (readability moreso than expressiveness), and context specific.
- silisili 3y agoExactly, they don't need to be orthogonal in my opinion. Every language should strive to be in the top right quadrant. Keep in mind, this is just what I value in a language. The perfect programming language to me is one that is expressive while also being easy to read. I think Python is nice in that regard, and probably why it's so popular to this day. But there's always room for improvement!