Philosophical difference between ruby and python.

Example:

    $ irb
    irb(main):001:0> exit
    $ irb
    irb(main):001:0> quit

    $ python
    >>> exit
    Use exit() or Ctrl-D (i.e. EOF) to exit

Ruby follows POLS, principle of least surprise i.e. it accepts both exit and quit to accommodate programmer’s obvious desire to quit terminal. Ruby behave as the programmer’s expects it to behave. This often leads to having more than one way to do the same thing.

Python follows “One right way to do things”. python here explicitly instructs programmer to do the right or the proper thing, even though it is obvious to python that user wants to quit terminal. Python is explicit in everything.

Happy Coding.:)

Archive