semicolon at end of python's statements

Gary Herron gherron at digipen.edu
Thu Aug 29 03:50:40 EDT 2013


On 08/28/2013 07:10 PM, Sam Fourman Jr. wrote:
>
> On Wed, Aug 28, 2013 at 8:18 PM, Mohsen Pahlevanzadeh 
> <mohsen at pahlevanzadeh.org <mailto:mohsen at 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130829/f7ff9ec4/attachment.html>


More information about the Python-list mailing list