Why Ruby Is More Readable Than Python
51–60 of 149 posts
Re: Why Ruby Is More Readable Than Python
#52Re: Why Ruby Is More Readable Than Python
#53I'm thinking in terms of avoiding back-tracking in your syntax.
E.g.: regices are hard as shit to read, and I don't think that back-tracking helps
(ab + c)*
Or *+(ab, c)
The first says ab, no - it's the union of ab and something, something is c, no - it's one or more of those.The second says one-or-more of the union of (ab) and (c).
Why haven't languages pushed that way?
Re: Why Ruby Is More Readable Than Python
#54Subjective opinion presented as fact? Say it ain't so.
Re: Why Ruby Is More Readable Than Python
#55Does Ruby have support for just exporting functions around? All these examples are class based. When I was a Python programmer, we found functions scaled infinitely better over time (with the exception of data classes, unfortunately) for complex business logic especially.
Re: Why Ruby Is More Readable Than Python
#56I find Ruby to be more straightforward than Python. In isolation, I’d argue Ruby is greatly more readable and understandable than Python. In practice, Ruby code isn’t. Once someone starts doing advanced meta programming, get the shovel, because you’re going to kill whoever wrote it and need to bury the body. Rails largely gets away with this by having opinionated design, good documentation, and a large user base who…
At the end of the day coding is hard. I’d rather have nice DSLs to learn than verbose spaghetti to read.
Re: Why Ruby Is More Readable Than Python
#57> While both languages are much easier to read than say, PHP or Java, [...blah blah blah...]
Which leads me to wonder: Have there been any serious studies of the readability of programming language syntactic and semantic conventions? For instance, a good friend of mine (whose day job is working as a software consultant, and whom I imagine would disagree with the author's assertion) finds it extremely difficult to understand python code in particular due to his dyslexia, and I wonder how common such problems are, both as a % of people and % of programming languages.
Re: Why Ruby Is More Readable Than Python
#58I find Ruby to be more straightforward than Python. In isolation, I’d argue Ruby is greatly more readable and understandable than Python. In practice, Ruby code isn’t. Once someone starts doing advanced meta programming, get the shovel, because you’re going to kill whoever wrote it and need to bury the body. Rails largely gets away with this by having opinionated design, good documentation, and a large user base who…
This is why Elixir makes me hate life sometimes. They took a language like Erlang where it seemed almost impossible to write an unreadable program even when it was doing very sophisticated things, and Rubied it up.
Re: Why Ruby Is More Readable Than Python
#59Subjective opinion presented as fact? Say it ain't so.
This is a matter of style; we encourage writers to write this way and trust that readers know the difference between fact and opinion. Go through a typical college writing class and the teacher will direct you to delete phrases like “I think” and “I believe” from your writing.
I'm all for pieces clearly from a personal perspective. There one can drop the redundant "I think" bits. But often dropping the qualifier turns it from a statement about one person to a universal statement, as with the title of the article. For me this erases the many interesting possibilities in between.
For example, a post title something like, "Which programmers find Ruby more readable than Python?" is way more interesting. The universal is false, but I'm sure it's true for some people and false for others. An exploration of that could lead to interesting ways to think about languages. E.g., is it better for novice programmers? For programmers from non-engineering backgrounds? For programmers with difference cognitive styles or capabilities?
Re: Why Ruby Is More Readable Than Python
#60Does Ruby have support for just exporting functions around? All these examples are class based. When I was a Python programmer, we found functions scaled infinitely better over time (with the exception of data classes, unfortunately) for complex business logic especially.
You can do…
module Foo
extend self
def bar
“Bar!”
end
end
Foo.bar #=> “Bar!”
And you can include that module in other modules. No classes required.