-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Update ruby tutorials #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update ruby tutorials #156
Conversation
@CaiqueMitsuoka Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@CaiqueMitsuoka Thank you for signing the Contributor License Agreement! |
|
||
conn = Bunny.new(:automatically_recover => false) | ||
conn.start | ||
connection = Bunny.new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change really an improvement? Isn't it obvious what conn
and ch
and x
mean in this small script?
Sorry but in rabbitmq/rabbitmq-website#499 (comment) I mentioned what would accepted without scrutiny and long names wasn't on that list. Changes for the sake of changes is not something anyone is interested in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think better names always improve code readability. This kind of name seems obvious to native speakers but for people who english it is not the mother tongue this kind of names can get trick really quick.
Like x
is obvious that is for exchange
because in the context there is an exchange and x
sounds like ex
. But for people who can read but not necessary speaker english x
sounds like it would sound in their native tongue.
Sorry for not letting this clear the first time. If you still think it does not worth I can switch back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a native speaker. You have method names such as queue
, fanout
and create_channel
. They return values and in a 13-25 line long script it is trivial to see where a particular variable is initialized regardless of whether you use an IDE or a sophisticated enough editor.
So Python, Java and PHP (IIRC, the 3 most visited tutorials on rabbitmq.com) and a few others use names such as |
Update the ruby tutorials with the 1.9+ syntax and variable names.
Basically linted with rubocop default configuration.
I made a refactor to the tutorial six (the RPC one) to be a little more clear the role of the instructions and their context. Please send some feedback on that
I will send the pull request on rabbitmq-website once this one is approved or merged.