Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #53197 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2013-08-29 10:31 +1000 |
| Last post | 2013-09-05 15:15 +0000 |
| Articles | 7 — 4 participants |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: semicolon at end of python's statements Chris Angelico <rosuav@gmail.com> - 2013-08-29 10:31 +1000
Re: semicolon at end of python's statements Duncan Booth <duncan.booth@invalid.invalid> - 2013-09-05 11:33 +0000
Re: semicolon at end of python's statements Chris Angelico <rosuav@gmail.com> - 2013-09-05 22:02 +1000
Re: semicolon at end of python's statements Grant Edwards <invalid@invalid.invalid> - 2013-09-05 14:04 +0000
Re: semicolon at end of python's statements Jeremy Sanders <jeremy@jeremysanders.net> - 2013-09-05 16:05 +0200
Re: semicolon at end of python's statements Chris Angelico <rosuav@gmail.com> - 2013-09-06 00:13 +1000
Re: semicolon at end of python's statements Duncan Booth <duncan.booth@invalid.invalid> - 2013-09-05 15:15 +0000
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-08-29 10:31 +1000 |
| Subject | Re: semicolon at end of python's statements |
| Message-ID | <mailman.333.1377736286.19984.python-list@python.org> |
On Thu, Aug 29, 2013 at 10:18 AM, 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? Very little. Putting the semicolon makes you look like a C programmer who's new to Python; omitting it makes you look like you actually understand Python :) As a C and C++ programmer myself, I know where you're coming from, but putting semicolons at the ends of Python statements is as useless as putting ((((lots of (((irritating (((superfluous (((parentheses))))))))))))) in your C++ code. The parser won't mind, but subsequent programmers will wonder what these unnecessary syntactic elements are for. ChrisA
[toc] | [next] | [standalone]
| From | Duncan Booth <duncan.booth@invalid.invalid> |
|---|---|
| Date | 2013-09-05 11:33 +0000 |
| Message-ID | <XnsA2327F75D8838duncanbooth@127.0.0.1> |
| In reply to | #53197 |
Chris Angelico <rosuav@gmail.com> wrote:
> On Thu, Aug 29, 2013 at 10:18 AM, 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?
>
> Very little. Putting the semicolon makes you look like a C programmer
> who's new to Python; omitting it makes you look like you actually
> understand Python :)
>
> As a C and C++ programmer myself, I know where you're coming from, but
> putting semicolons at the ends of Python statements is as useless as
> putting ((((lots of (((irritating (((superfluous
> (((parentheses))))))))))))) in your C++ code. The parser won't mind,
> but subsequent programmers will wonder what these unnecessary
> syntactic elements are for.
>
> ChrisA
>
Someone I knew actually used these definitions when writing C in a Pascalish, Algol68ish
style (if I remembered them correctly):
#define IF if(((
#define AND ))&&((
#define OR )||(
#define THEN ))){
#define ELSE }else{
#define FI }
--
Duncan Booth http://kupuguy.blogspot.com
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-09-05 22:02 +1000 |
| Message-ID | <mailman.86.1378382574.5461.python-list@python.org> |
| In reply to | #53692 |
On Thu, Sep 5, 2013 at 9:33 PM, Duncan Booth
<duncan.booth@invalid.invalid> wrote:
> Someone I knew actually used these definitions when writing C in a Pascalish, Algol68ish
> style (if I remembered them correctly):
>
> #define IF if(((
> #define AND ))&&((
> #define OR )||(
> #define THEN ))){
> #define ELSE }else{
> #define FI }
Because s/he thought it made for better code, or as a joke? Usually I
see this sort of thing as the latter...
ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Grant Edwards <invalid@invalid.invalid> |
|---|---|
| Date | 2013-09-05 14:04 +0000 |
| Message-ID | <l0a30u$jpu$1@reader1.panix.com> |
| In reply to | #53692 |
On 2013-09-05, Duncan Booth <duncan.booth@invalid.invalid> wrote:
> Someone I knew actually used these definitions when writing C in a
> Pascalish, Algol68ish style (if I remembered them correctly):
>
> #define IF if(((
> #define AND ))&&((
> #define OR )||(
> #define THEN ))){
> #define ELSE }else{
> #define FI }
Yep, I once knew somebody who used a set of macros like that to make C
programs look as much like some dialect of BASIC as possible. He also
wrote his letters/memos in Lotus 1,2,3...
--
Grant Edwards grant.b.edwards Yow! I want to mail a
at bronzed artichoke to
gmail.com Nicaragua!
[toc] | [prev] | [next] | [standalone]
| From | Jeremy Sanders <jeremy@jeremysanders.net> |
|---|---|
| Date | 2013-09-05 16:05 +0200 |
| Message-ID | <mailman.97.1378389956.5461.python-list@python.org> |
| In reply to | #53692 |
Chris Angelico wrote: > Because s/he thought it made for better code, or as a joke? Usually I > see this sort of thing as the latter... http://oldhome.schmorp.de/marc/bournegol.html http://utcc.utoronto.ca/~cks/space/blog/programming/BourneGol Jeremy
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-09-06 00:13 +1000 |
| Message-ID | <mailman.98.1378390424.5461.python-list@python.org> |
| In reply to | #53692 |
On Fri, Sep 6, 2013 at 12:05 AM, Jeremy Sanders <jeremy@jeremysanders.net> wrote: > Chris Angelico wrote: > >> Because s/he thought it made for better code, or as a joke? Usually I >> see this sort of thing as the latter... > > http://oldhome.schmorp.de/marc/bournegol.html > http://utcc.utoronto.ca/~cks/space/blog/programming/BourneGol Yep, that's some impressive code right there! ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Duncan Booth <duncan.booth@invalid.invalid> |
|---|---|
| Date | 2013-09-05 15:15 +0000 |
| Message-ID | <XnsA232A4F2AA4B4duncanbooth@127.0.0.1> |
| In reply to | #53714 |
Chris Angelico <rosuav@gmail.com> wrote: > On Fri, Sep 6, 2013 at 12:05 AM, Jeremy Sanders ><jeremy@jeremysanders.net> wrote: >> Chris Angelico wrote: >> >>> Because s/he thought it made for better code, or as a joke? Usually I >>> see this sort of thing as the latter... It was intended for clearer code, which is true if you don't like curly braces, and who does round here? >> >> http://oldhome.schmorp.de/marc/bournegol.html >> http://utcc.utoronto.ca/~cks/space/blog/programming/BourneGol > > Yep, that's some impressive code right there! > > ChrisA > That brings back memories all right, but its not as good as the version I remember as it doesn't 'fix' the logical operator priorities. -- Duncan Booth http://kupuguy.blogspot.com
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web