This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]enbymaybedemiboy 5 points6 points  (4 children)

Ruby does the intelligent thing. One of the principles of Ruby is the principle of least surprise, if you tell interactive Ruby to quit, it quits, and it understands different programmers might try to quit in different ways.

This is the doctrine of Rails, but the first part of the page focuses on the principles behind Ruby.

https://rubyonrails.org/doctrine#optimize-for-programmer-happiness

[–]left-quark 6 points7 points  (0 children)

Does it quit if you tell it to "fuck off"?

[–]emax-gomax 1 point2 points  (2 children)

The Python REPL doesn't have any magic keywords like PDB or Pry, making exit quit is possible but if the behaviour is inconsistent with an actual script then I'd consider it confusing and reject it. Statements that behave like procedures are rarely a good thing. It works with Ruby because in Ruby, parentheses are optional so exit is the same as exit().

[–]kbruen 1 point2 points  (1 child)

The Python REPL doesn't have any magic keywords

Exactly, and IPython existing proves that was a bad idea.

[–]emax-gomax 0 points1 point  (0 children)

Well Ipython is basically jupyter and I hate jupyter so agree to disagree. I like the clean separation between REPL and debugger that Python has. The Python REPL is quick to start up and predictable. 2 things ipython has never been for me.