On 08/28/2013 07:10 PM, Sam Fourman Jr. wrote:
On Wed, Aug 28, 2013 at 8:18 PM, Mohsen Pahlevanzadeh
<moh...@pahlevanzadeh.org <mailto:moh...@pahlevanzadeh.org>> wrote:
Dear all,
I'm C++ programmer and unfortunately put semicolon at end of my
statements in python.
Quesion:
What's really defferences between putting semicolon and don't put?
Yours,
Mohsen
I totally understand where you are coming from, but
I have found that the thing I can't get used to is the "indent thing"
Python is a great language, but I always secretly find myself
wishing I could somehow use python, and not deal with the mandatory
"indents"
Sam Fourman Jr.
What an odd thing to say. In what sense do you consider indents to be
non-mandatory in other languages? In *any* programming language, if you
write code without indents, it is absolutely unreadable, absolutely
unmaintainable, and you will be absolutely fired!
Other languages force you (and your editor) to maintain two indications
of nesting, (1) indentation, so you can read it, and (2)
braces/begin/end/whatever, so the compiler can read it. Neither one is
truly optional, and woe to you if the two don't match. On the other
hand, Python's use of indentation as the (only) indication of nesting is
readable by both humans and parsers.
Looked at that way, other languages seem foolish and burdensome and
Python's indentation is the only sensible way.
Whether you follow that argument or not, I hope you come to like
Python's indentation eventually. Many (most?) of the rest of here have.
Gary Herron
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
--
http://mail.python.org/mailman/listinfo/python-list