3 ms·
> Nobody wants a language where whitespace is significant as a debugging extension language! It’s verbose and unpleasant and fiddly to write in a REPL. You are
by sidkshatriya 4y ago
> Nobody wants a language where whitespace is significant as a debugging extension language! It’s verbose and unpleasant and fiddly to write in a REPL.
You are correct about it being fiddly to write multi-line Python scripts at the REPL.
However:
- Modern python REPLs are really good. They auto-complete very well and suggest indentation when they recognise the syntax of the previous line:
```
$ python3
>>> for x in range(1, 10):<user presses enter key>
....<indentation is provided by REPL, note the "....">
```
- Python indentation rules are quite simple once you get the hang of it
- The issue with typing at the REPL is really more about remembering the syntax of various language statements rather than the white space rules of Python. This is a problem with using any (other language) like, say, Lua/Javascript at the REPL.
- Most "scripts" at the REPL tend to be just a single line where you don't need to worry about whitespace indentation. When you have a long script then you simply run a program directly
- Yes, Python scripting at the REPL is a bit more verbose than Javascript (for example). But most people can live with the extra characters and the verbosity makes it easier to understand what you meant a few REPL commands ago
- The reason to use Python generally its insanely large ecosystem of software. The inconvenience of the white-space-significant aspect of language at the REPL is totally offset by that.