Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #53196 > unrolled thread
| Started by | Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> |
|---|---|
| First post | 2013-08-29 04:48 +0430 |
| Last post | 2013-08-29 04:27 +0000 |
| Articles | 5 — 4 participants |
Back to article view | Back to comp.lang.python
semicolon at end of python's statements Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> - 2013-08-29 04:48 +0430
Re: semicolon at end of python's statements Roy Smith <roy@panix.com> - 2013-08-28 20:33 -0400
Re: semicolon at end of python's statements Chris Angelico <rosuav@gmail.com> - 2013-08-29 10:47 +1000
Re: semicolon at end of python's statements Roy Smith <roy@panix.com> - 2013-08-28 21:04 -0400
Re: semicolon at end of python's statements Steven D'Aprano <steve@pearwood.info> - 2013-08-29 04:27 +0000
| From | Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> |
|---|---|
| Date | 2013-08-29 04:48 +0430 |
| Subject | semicolon at end of python's statements |
| Message-ID | <mailman.332.1377735563.19984.python-list@python.org> |
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
[toc] | [next] | [standalone]
| From | Roy Smith <roy@panix.com> |
|---|---|
| Date | 2013-08-28 20:33 -0400 |
| Message-ID | <roy-FA3B8B.20331128082013@news.panix.com> |
| In reply to | #53196 |
In article <mailman.332.1377735563.19984.python-list@python.org>, Mohsen Pahlevanzadeh <mohsen@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? In theory, nothing. In practice, all the real Python programmers will make fun of you. Somewhat more seriously, every language has its own way of doing things. There's the set of things the language allows you to do, and the somewhat smaller set of things that have become accepted as the "proper" way to do things in that language. For Python, putting semicolons at the ends of statements falls into the first set but not the second.
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-08-29 10:47 +1000 |
| Message-ID | <mailman.338.1377737268.19984.python-list@python.org> |
| In reply to | #53198 |
On Thu, Aug 29, 2013 at 10:33 AM, Roy Smith <roy@panix.com> wrote:
> In article <mailman.332.1377735563.19984.python-list@python.org>,
> Mohsen Pahlevanzadeh <mohsen@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?
>
> In theory, nothing. In practice, all the real Python programmers will
> make fun of you.
>
> Somewhat more seriously, every language has its own way of doing things.
> There's the set of things the language allows you to do, and the
> somewhat smaller set of things that have become accepted as the "proper"
> way to do things in that language. For Python, putting semicolons at
> the ends of statements falls into the first set but not the second.
This is about Perl, but may be of interest.
http://www.perl.com/pub/2007/12/06/soto-11.html
One of his main points is that languages differ primarily in what they
force you to say - not what you're able to express. C forces you to
declare the ends of statements with semicolons. Python forces you to
be consistent with indentation. Smalltalk (if I have this correct)
forces you to put parentheses in expressions like a+b*c to declare
order of operations. German forces you to match das/die/der to the
noun it's referring to. Doing what a completely different programming
language forces you to do is like speaking with the wrong grammar
("Murdered in the bed we will be! One day we will in bed find
ourselves stone dead!"[1]); native speakers will understand you, but
it doesn't sound fluent.
ChrisA
[1] Mit der knife in der chess! Sun on the Stubble. Great book.
[toc] | [prev] | [next] | [standalone]
| From | Roy Smith <roy@panix.com> |
|---|---|
| Date | 2013-08-28 21:04 -0400 |
| Message-ID | <roy-511C18.21043728082013@news.panix.com> |
| In reply to | #53203 |
In article <mailman.338.1377737268.19984.python-list@python.org>, Chris Angelico <rosuav@gmail.com> wrote: > This is about Perl, but may be of interest. > > http://www.perl.com/pub/2007/12/06/soto-11.html I got about halfway through, then raised an uncaught TLDNR Exception. But I did like what he had to say about Tcl. Tcl is under-appreciated. A few gigs back, I did a lot of work in Tcl. We were writing a network management tool (long since subsumed into IBM Tivoli via multiple corporate mergers and put out to pasture: http://tinyurl.com/qxd4kw9). The dev team consisted mostly of people who were networking subject matter experts and not real programmers. Tcl turned out to be an excellent tool to let the SME's express their networking knowledge in executable form without having to learn C++, Java, or even Python. Tcl is also ridiculously easy to embed. It's literally one line of C code and you've got an embedded Tcl interpreter running.
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve@pearwood.info> |
|---|---|
| Date | 2013-08-29 04:27 +0000 |
| Message-ID | <521ecdb1$0$11100$c3e8da3@news.astraweb.com> |
| In reply to | #53196 |
On Thu, 29 Aug 2013 04:48:26 +0430, Mohsen Pahlevanzadeh 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? It's about the same as writing this: x = 1 pass y = 2 pass z = x**2 + y**2 pass print z pass except you save three keystrokes per LOC. -- Steven
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web