3 ms·
My pet theory is that a lack of non-whitespace separators heavily discourages clever one-liners or compact sequences of operations and forces the programmer to
by qppo 6y ago
My pet theory is that a lack of non-whitespace separators heavily discourages clever one-liners or compact sequences of operations and forces the programmer to write more readable code.
- labawi 6y agoPython actually has ';', and I think you can write everything in one line if you really want to, e.g. in an inline script python3 -c 'import math; tau=math.pi*2; r=1; u=r*tau; s=r*r*tau/2; v=r*r*r*tau*2/3; print(u,s,v)'
- marvy 6y agoIn this simple script you can, but eventually you need an loop or something and you realize you're kind of stuck: before_loop; while something: step1; step2; after_loop; Note that after_loop is still inside the loop. Also you can't have multiple colons on the same line, so this doesn't work either: if test: do_this; else: do_that That gives a syntax error