People posting Ruby questions often post their code as if it were given in a Interactive Ruby Shell (IRB) dialogue, but given the IRB prompt is redundant, annoying, and slows down reading, I think it will be a good idea to discourage people from posting the code like this, and encourage them to post in a static script form, unless giving an interactive dialogue is really necessary. I propose this point to be considered as one criterion for editing as well. Similar things may be said for other languages that have an interactive mode.
What is meta?
- Any Stack Exchange user can ask a question
- The community provides support, votes on ideas, and reports bugs
- Your voice helps shape the way Stack Exchange operates
I have a similar conflict with scala code. It looks like this:
but on the other hand it
Of course the user can have both, he groups his code, and only shows few interesting, formatted results as comment:
As a heavy Python user, I find using the shell can be useful sometimes. I agree that the Ruby shell puts too much garbage that distracts from the real code though. My solution is to use the
IRB's output can be refined to the desired level. Rather discourage its output usage, we can recommend users to try using both of these switches at once:
So the output looks like: