Live data from Hacker News

Why Ruby Is More Readable Than Python

confuzeus.com

11–20 of 149 posts

Re: Why Ruby Is More Readable Than Python

#11

Interesting. Even with the examples given, I found Python considerably easier to follow, with the possible exception of the inheritance example. Just goes to show how subjective it all is!

I agree, ruby's @ and @@ probably will make it a bit harder to read for anyone that is new to both languages, plus it seems more lengthy to me, python wins.

Re: Why Ruby Is More Readable Than Python

#12
post #9

Subjective 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.

Use the Active Voice.

Re: Why Ruby Is More Readable Than Python

#13
Until metaprogramming, autoloading, DSLs and everything that eventually makes Ruby code unreadable takes place due to personal preferences.

Ruby is clever, it can be beautiful, but I've never seen a good codebase using it grow well without enforcing strictly opinionated ways of writing it to ensure maintainability. Which breaks a lot of the expectations of some Ruby developers that chose the language because they like to write it in their own way.

Re: Why Ruby Is More Readable Than Python

#14
post #9

Subjective 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 get this, and I've started to write this way, because it gets a better response; but it feels to me like it's designed to maximize an emotional response and not a cognitive response, and find I have less trust in people who write this way (Which is most things, i get)

I do wonder how this style of writing has impacted the psychology of argument, I imagine there are others who read this style of writing and assume it is written in stone or as an objective statement, and not a subjective one. This may just be human nature.

Re: Why Ruby Is More Readable Than Python

#16

I find it odd that getters and setters are implemented in Ruby … manually. attr_accessor is the idiomatic way to do it (or attr_reader / attr_writer if you want more granular control).

It's for encapsulation. You can switch them out for a method with logic without changing your interface. I don't know Python very well - is that the same there?

Re: Why Ruby Is More Readable Than Python

#17

Interesting. Even with the examples given, I found Python considerably easier to follow, with the possible exception of the inheritance example. Just goes to show how subjective it all is!

Indeed. I started working with Ruby for at least a year before I started working with Python. To this day I still can't do anything useful in Ruby, and I'm proficient in Python.

Python is far more readable and comprehensible than Ruby.

Haven't even bothered to read TFA because it's just weird flamewar bait.

Re: Why Ruby Is More Readable Than Python

#18
post #9

Subjective 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.

Oh. So this is why clickbait and trolling have increased so dramatically? The kids are being encouraged to do it by their teachers?

Eternal September gets worse when their teachers are teaching them bad habits from the get-go.

Re: Why Ruby Is More Readable Than Python

#20

I find it odd that getters and setters are implemented in Ruby … manually. attr_accessor is the idiomatic way to do it (or attr_reader / attr_writer if you want more granular control).

It's for encapsulation. You can switch them out for a method with logic without changing your interface. I don't know Python very well - is that the same there?

You can override the relevant dunders, but why would you.
Post reply on HN