S
Stephen Sprunk
C# Learner said:One of the biggest flaws in C syntax, in my opinion, is the required
parentheses for test conditions.
Without the parens you would need a "then" keyword of some kind. It seems
like an even trade.
Another nicety about Python is the fact that whitespace is used for
defining code blocks. This makes code much clearer than the equivalent
C code, which requires block being/end markers.
OTOH, C not using whitespace to mean anything gives programmers lots of
flexibility in how they format their source code to improve readability.
Block begin/end markers are very useful, and having such things explicit
arguably makes things easier for both the compiler and subsequent coders.
Here's a very simple Python code sample:
http://www.kernelthread.com/hanoi/html/py.html .
Try staring at it for one minute.
After having done so, take a look at this:
http://www.kernelthread.com/hanoi/html/c.html .
Even if one's accustomed to C syntax, the former is still clearer and
easier-to-read, don't you think?
That depends on the reader; the C version is far clearer to me. You also
put error-checking into the C version that's not in the Python one, which is
unfair when considering code length.
S