Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #89005 > unrolled thread

New to Python - block grouping (spaces)

Started byBlake McBride <blake1024@gmail.com>
First post2015-04-15 21:07 -0700
Last post2015-04-16 18:45 +0000
Articles 20 on this page of 119 — 32 participants

Back to article view | Back to comp.lang.python


Contents

  New to Python - block grouping (spaces) Blake McBride <blake1024@gmail.com> - 2015-04-15 21:07 -0700
    Re: New to Python - block grouping (spaces) Paul Rubin <no.email@nospam.invalid> - 2015-04-15 21:48 -0700
    Re: New to Python - block grouping (spaces) Chris Angelico <rosuav@gmail.com> - 2015-04-16 14:51 +1000
    Re: New to Python - block grouping (spaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-04-16 15:49 +1000
      Re: New to Python - block grouping (spaces) Paul Rubin <no.email@nospam.invalid> - 2015-04-15 23:11 -0700
        Re: New to Python - block grouping (spaces) William Ray Wing <wrw@mac.com> - 2015-04-16 09:00 -0400
      Re: New to Python - block grouping (spaces) BartC <bc@freeuk.com> - 2015-04-16 11:51 +0100
        Re: New to Python - block grouping (spaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-04-17 03:10 +1000
          Re: New to Python - block grouping (spaces) Tim Chase <python.list@tim.thechases.com> - 2015-04-16 12:49 -0500
          Re: New to Python - block grouping (spaces) BartC <bc@freeuk.com> - 2015-04-16 22:04 +0100
          Re: New to Python - block grouping (spaces) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-04-17 11:37 +0200
      Re: New to Python - block grouping (spaces) Serhiy Storchaka <storchaka@gmail.com> - 2015-04-16 22:14 +0300
    Re: New to Python - block grouping (spaces) alister <alister.nospam.ware@ntlworld.com> - 2015-04-16 07:46 +0000
      Re: New to Python - block grouping (spaces) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-04-16 10:47 +0200
      Re: New to Python - block grouping (spaces) Chris Angelico <rosuav@gmail.com> - 2015-04-16 19:34 +1000
      Re: New to Python - block grouping (spaces) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-04-16 12:09 +0200
        Re: New to Python - block grouping (spaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-04-16 20:43 +1000
          Re: New to Python - block grouping (spaces) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-04-16 13:07 +0200
            Re: New to Python - block grouping (spaces)yhoni alister <alister.nospam.ware@ntlworld.com> - 2015-04-16 13:18 +0000
              Re: New to Python - block grouping (spaces)yhoni BartC <bc@freeuk.com> - 2015-04-16 14:44 +0100
                Re: New to Python - block grouping (spaces)yhoni Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-04-16 18:46 +0100
                Re: New to Python - block grouping (spaces)yhoni alister <alister.nospam.ware@ntlworld.com> - 2015-04-16 18:03 +0000
              Re: New to Python - block grouping (spaces)yhoni Chris Angelico <rosuav@gmail.com> - 2015-04-16 23:50 +1000
              Re: New to Python - block grouping (spaces)yhoni Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-04-16 16:09 +0200
                Re: New to Python - block grouping (spaces)yhoni alister <alister.nospam.ware@ntlworld.com> - 2015-04-16 18:04 +0000
          Re: New to Python - block grouping (spaces) Chris Angelico <rosuav@gmail.com> - 2015-04-16 23:41 +1000
          Re: New to Python - block grouping (spaces) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-04-16 15:57 +0200
    Re: New to Python - block grouping (spaces) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-04-16 13:17 +0100
    Re: New to Python - block grouping (spaces) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-04-16 14:48 +0200
    Re: New to Python - block grouping (spaces) Simmo <square.steve@gmail.com> - 2015-04-16 14:37 +0100
    Re: New to Python - block grouping (spaces) Blake McBride <blake1024@gmail.com> - 2015-04-16 07:52 -0700
      Re: New to Python - block grouping (spaces) Blake McBride <blake1024@gmail.com> - 2015-04-16 08:01 -0700
        Re: New to Python - block grouping (spaces) alister <alister.nospam.ware@ntlworld.com> - 2015-04-16 18:08 +0000
          Re: New to Python - block grouping (spaces) memilanuk <memilanuk@gmail.com> - 2015-04-16 11:28 -0700
      Re: New to Python - block grouping (spaces) Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2015-04-16 15:05 +0000
        Re: New to Python - block grouping (spaces) edmondo.giovannozzi@gmail.com - 2015-04-20 03:00 -0700
      Re: New to Python - block grouping (spaces) memilanuk <memilanuk@gmail.com> - 2015-04-16 08:05 -0700
      Re: New to Python - block grouping (spaces) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-04-16 16:05 +0100
        Re: New to Python - block grouping (spaces) CHIN Dihedral <dihedral88888@gmail.com> - 2015-04-19 11:46 -0700
      Re: New to Python - block grouping (spaces) Chris Angelico <rosuav@gmail.com> - 2015-04-17 01:03 +1000
      Re: New to Python - block grouping (spaces) Grant Edwards <invalid@invalid.invalid> - 2015-04-16 15:21 +0000
      Re: New to Python - block grouping (spaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-04-17 03:41 +1000
        Re: New to Python - block grouping (spaces) Ron Adam <ron3200@gmail.com> - 2015-04-16 14:54 -0400
      EditorConfig for cross-editor consistent code style (was: New to Python - block grouping (spaces)) Ben Finney <ben+python@benfinney.id.au> - 2015-04-17 06:10 +1000
      Re: New to Python - block grouping (spaces) Michael Torrie <torriem@gmail.com> - 2015-04-17 09:44 -0600
        Re: New to Python - block grouping (spaces) Grant Edwards <invalid@invalid.invalid> - 2015-04-17 16:28 +0000
          Re: New to Python - block grouping (spaces) BartC <bc@freeuk.com> - 2015-04-17 18:05 +0100
            Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-17 10:13 -0700
            Re: New to Python - block grouping (spaces) sohcahtoa82@gmail.com - 2015-04-17 11:13 -0700
              Re: New to Python - block grouping (spaces) Marko Rauhamaa <marko@pacujo.net> - 2015-04-17 23:28 +0300
            Re: New to Python - block grouping (spaces) Chris Angelico <rosuav@gmail.com> - 2015-04-18 07:10 +1000
            Re: New to Python - block grouping (spaces) Dan Sommers <dan@tombstonezero.net> - 2015-04-18 01:18 +0000
              Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-17 19:22 -0700
                Re: New to Python - block grouping (spaces) BartC <bc@freeuk.com> - 2015-04-19 12:44 +0100
                  Re: New to Python - block grouping (spaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-04-19 23:23 +1000
                    Re: New to Python - block grouping (spaces) wxjmfauth@gmail.com - 2015-04-19 07:22 -0700
                  Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-19 07:01 -0700
            Re: New to Python - block grouping (spaces) Michael Torrie <torriem@gmail.com> - 2015-04-17 20:14 -0600
              Re: New to Python - block grouping (spaces) Marko Rauhamaa <marko@pacujo.net> - 2015-04-18 09:53 +0300
            Re: New to Python - block grouping (spaces) Ben Finney <ben+python@benfinney.id.au> - 2015-04-18 12:22 +1000
              Re: New to Python - block grouping (spaces) Larry Hudson <orgnut@yahoo.com> - 2015-04-17 22:28 -0700
              Re: New to Python - block grouping (spaces) Marko Rauhamaa <marko@pacujo.net> - 2015-04-18 10:00 +0300
                Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-18 00:13 -0700
                  Re: New to Python - block grouping (spaces) Marko Rauhamaa <marko@pacujo.net> - 2015-04-18 10:42 +0300
                Re: New to Python - block grouping (spaces) Michael Torrie <torriem@gmail.com> - 2015-04-19 11:15 -0600
                  Re: New to Python - block grouping (spaces) Marko Rauhamaa <marko@pacujo.net> - 2015-04-19 23:41 +0300
                    Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-19 19:00 -0700
                    Re: New to Python - block grouping (spaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-04-20 12:54 +1000
                      Re: New to Python - block grouping (spaces) Chris Angelico <rosuav@gmail.com> - 2015-04-20 13:05 +1000
                        Re: New to Python - block grouping (spaces) Marko Rauhamaa <marko@pacujo.net> - 2015-04-20 08:09 +0300
              Re: New to Python - block grouping (spaces) BartC <bc@freeuk.com> - 2015-04-19 12:38 +0100
                Re: New to Python - block grouping (spaces) Ben Finney <ben+python@benfinney.id.au> - 2015-04-19 22:59 +1000
                  Re: New to Python - block grouping (spaces) BartC <bc@freeuk.com> - 2015-04-19 22:42 +0100
                    Re: New to Python - block grouping (spaces) Ron Adam <ron3200@gmail.com> - 2015-04-19 19:28 -0400
                    Re: New to Python - block grouping (spaces) Ben Finney <ben+python@benfinney.id.au> - 2015-04-20 09:59 +1000
                      Re: New to Python - block grouping (spaces) BartC <bc@freeuk.com> - 2015-04-20 01:30 +0100
                Re: New to Python - block grouping (spaces) Dave Angel <davea@davea.name> - 2015-04-19 09:18 -0400
                Re: New to Python - block grouping (spaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-04-19 23:22 +1000
                Re: New to Python - block grouping (spaces) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-04-19 14:30 +0100
                Re: New to Python - block grouping (spaces) Chris Angelico <rosuav@gmail.com> - 2015-04-20 01:15 +1000
                  Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-19 09:03 -0700
                    Re: New to Python - block grouping (spaces) Mel Wilson <mwilson@the-wire.com> - 2015-04-19 17:38 +0000
                    Re: New to Python - block grouping (spaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-04-20 03:53 +1000
                      Re: New to Python - block grouping (spaces) Mel Wilson <mwilson@the-wire.com> - 2015-04-19 18:25 +0000
                      Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-19 19:08 -0700
                        Re: New to Python - block grouping (spaces) Chris Angelico <rosuav@gmail.com> - 2015-04-20 12:24 +1000
                          Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-19 19:43 -0700
                            Re: New to Python - block grouping (spaces) Chris Angelico <rosuav@gmail.com> - 2015-04-20 13:03 +1000
                              Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-19 20:28 -0700
                                Re: New to Python - block grouping (spaces) Chris Angelico <rosuav@gmail.com> - 2015-04-20 13:44 +1000
                                  Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-20 19:18 -0700
                            Re: New to Python - block grouping (spaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-04-20 20:30 +1000
                              Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-20 04:51 -0700
                                Re: New to Python - block grouping (spaces) albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-04-25 17:42 +0000
                              Re: New to Python - block grouping (spaces) BartC <bc@freeuk.com> - 2015-04-20 13:05 +0100
                              Re: New to Python - block grouping (spaces) wxjmfauth@gmail.com - 2015-04-24 01:50 -0700
                        Re: New to Python - block grouping (spaces) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-04-20 03:38 +0100
                        Re: New to Python - block grouping (spaces) llanitedave <llanitedave@birdandflower.com> - 2015-04-21 08:29 -0700
                          Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-21 10:49 -0700
                            Re: New to Python - block grouping (spaces) llanitedave <llanitedave@birdandflower.com> - 2015-04-21 14:35 -0700
                              Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-21 20:11 -0700
                                Re: New to Python - block grouping (spaces) llanitedave <llanitedave@birdandflower.com> - 2015-04-21 21:05 -0700
                                  Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-22 04:37 -0700
                                    Re: New to Python - block grouping (spaces) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-04-22 13:05 +0100
                      Re: New to Python - block grouping (spaces) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-04-20 20:38 +1200
                        Re: New to Python - block grouping (spaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-04-20 20:15 +1000
                    Re: New to Python - block grouping (spaces) Dan Sommers <dan@tombstonezero.net> - 2015-04-19 18:07 +0000
                      Re: New to Python - block grouping (spaces) Chris Angelico <rosuav@gmail.com> - 2015-04-20 06:03 +1000
                      Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-19 18:46 -0700
                      Re: New to Python - block grouping (spaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-04-20 12:42 +1000
                Re: New to Python - block grouping (spaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-04-20 03:46 +1000
                  Re: New to Python - block grouping (spaces) Paul Rubin <no.email@nospam.invalid> - 2015-04-19 13:36 -0700
            Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-24 22:06 -0700
              Re: New to Python - block grouping (spaces) Marko Rauhamaa <marko@pacujo.net> - 2015-04-25 10:27 +0300
                Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-25 09:52 -0700
      Re: New to Python - block grouping (spaces) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-04-24 08:31 +0100
      Re: New to Python - block grouping (spaces) Michael Torrie <torriem@gmail.com> - 2015-04-24 08:03 -0600
    Re: New to Python - block grouping (spaces) Rustom Mody <rustompmody@gmail.com> - 2015-04-16 10:59 -0700
      Re: New to Python - block grouping (spaces) Rob Gaddi <rgaddi@technologyhighland.invalid> - 2015-04-16 18:45 +0000

Page 3 of 6 — ← Prev page 1 2 [3] 4 5 6  Next page →


#89037

FromGrant Edwards <invalid@invalid.invalid>
Date2015-04-16 15:21 +0000
Message-ID<mgok2m$mf5$1@reader1.panix.com>
In reply to#89031
On 2015-04-16, Blake McBride <blake1024@gmail.com> wrote:

> Thanks for all the responses.  I especially like the Pike pointer. 
> To be clear:
>
> 1.  I don't think languages should depend on invisible elements to
>     determine logic.

I had the same attitude when I first tried Python 15 years ago. But,
Python was the only free language implimentation I could find for
Windows that had all the features to allow me to easily write a
program to suck e-mail messages out of Outlook via DCOM and shove them
over to an SMTP server.

After a few days of use, I was a firm believer in semantically
significant indentation (and have been ever since).

> 2.  Having been an employer, it is difficult to force programmers to
>     use any particular editor or style.  Different editors handle tabs
>     and spaces differently.  This is all a bloody nightmare with Python.

It's an even _worse_ problem for C, PHP, Javascript, et al.  At least
Python requires some semblance of order and method.  Those other
languages allow complete anarchy, and any time developer A has to
read/edit code from devloper B, it wastes all sorts of time.

> 3.  Languages that use braces (or the like) can be run through a
>     program beautifier to correct the indentation.

With Python, there's no need.  The indenation is _already_ correct.

>     You are just screwed in Python.  So, Python may be a cute
>     language for you to use as an individual, but it is unwieldy in a
>     real development environment.

Ah.  That explains why Google uses it so much.

> 4.  Language beautifiers used on bracey languages removes all
>     arguments in favor of an off-side language.

As trolls go, I don't think this rates much above a C-.

-- 
Grant Edwards               grant.b.edwards        Yow! VICARIOUSLY experience
                                  at               some reason to LIVE!!
                              gmail.com            

[toc] | [prev] | [next] | [standalone]


#89040

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2015-04-17 03:41 +1000
Message-ID<552ff43f$0$12982$c3e8da3$5496439d@news.astraweb.com>
In reply to#89031
On Fri, 17 Apr 2015 12:52 am, Blake McBride wrote:

> Thanks for all the responses.  I especially like the Pike pointer.  To be
> clear:
> 
> 1.  I don't think languages should depend on invisible elements to
> determine logic.

Icompletelyagreethatinvisibleelementsareterribleandalllanguagesshouldeliminatethemcompletely.Anythingelsewillharmreadabilityandmakesitmuchhardertofollowthelogic.


> 2.  Having been an employer, it is difficult to force programmers to use
> any particular editor or style.  Different editors handle tabs and spaces
> differently.  This is all a bloody nightmare with Python.


Do you really expect us to believe for a microsecond that the choice
between "4 spaces" or "tab" is worse than the C brace wars?

If you, as an employer, cannot get your programmers to follow your in-house
style requirements, then what instructions can you get them to follow? Do
they even bother to show up? Other than on "lunch is on the boss" day?



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#89053

FromRon Adam <ron3200@gmail.com>
Date2015-04-16 14:54 -0400
Message-ID<mailman.357.1429221308.12925.python-list@python.org>
In reply to#89040

On 04/16/2015 01:41 PM, Steven D'Aprano wrote:
>> >2.  Having been an employer, it is difficult to force programmers to use
>> >any particular editor or style.  Different editors handle tabs and spaces
>> >differently.  This is all a bloody nightmare with Python.
>
> Do you really expect us to believe for a microsecond that the choice
> between "4 spaces" or "tab" is worse than the C brace wars?

You know I've never thought braces where the problem in a language, and in 
python, not having them isn't a problem either.

The reason I dislike C is due to the amount of boiler plate and the low 
level of code, which requires managing memory, declaring prototypes and 
including headers.  All of which I think are much more troublesome and 
harder to get right than any amount of braces.

Both sides have advantages, but Python's design is meant to represent code 
in an easier to see and read way.  Representing blocks by indention is 
consistent with that.  (And so is outlines in written language.)

I could equally like a language where blocks are literal code objects that 
can be assigned to names.  In that case the block delimiters would be 
consistent with that language design and that would be perfectly fine to 
me.  The code would be representing what it does in an expected and useful way.

    block = {statement_1; statement_2; ...}

The cases in between seem a bit unclean to me however.  Where braces are 
used to define blocks that aren't exposed.  I think it's ok, but it also 
seems a bit unclean to me.  Adding more noise than necessary to the code. 
But I understand at some time, when a language was designed it may have 
been that it made parsing the language simpler.  (it does.)  Or it may have 
just been the language designers preference at that time.  <shrug>

But still, I think the whole braces are good/evil is over stated.  There 
are lots of more important things in languages to consider.

Cheers,
    Ron



[toc] | [prev] | [next] | [standalone]


#89050 — EditorConfig for cross-editor consistent code style (was: New to Python - block grouping (spaces))

FromBen Finney <ben+python@benfinney.id.au>
Date2015-04-17 06:10 +1000
SubjectEditorConfig for cross-editor consistent code style (was: New to Python - block grouping (spaces))
Message-ID<mailman.356.1429215052.12925.python-list@python.org>
In reply to#89031
Chris Angelico <rosuav@gmail.com> writes:

> If you're prepared to run a beautifier on your employees' code, you
> should have no problem requiring that they adopt a syntactically-legal
> style.

For teams with a mixture of text editors in use, there are even tools
nowadays to help everyone's text editor enforce consistency of the
fundamentals in the code.

One which is ready now and already widely adopted is EditorConfig:

    EditorConfig helps developers define and maintain consistent coding
    styles between different editors and IDEs. The EditorConfig project
    consists of a file format for defining coding styles and a
    collection of text editor plugins that enable editors to read the
    file format and adhere to defined styles. EditorConfig files are
    easily readable and they work nicely with version control systems.

    <URL:http://editorconfig.org/>

-- 
 \        “I was in Las Vegas, at the roulette table, having a furious |
  `\     argument over what I considered to be an odd number.” —Steven |
_o__)                                                           Wright |
Ben Finney

[toc] | [prev] | [next] | [standalone]


#89077

FromMichael Torrie <torriem@gmail.com>
Date2015-04-17 09:44 -0600
Message-ID<mailman.374.1429285961.12925.python-list@python.org>
In reply to#89031
On 04/16/2015 08:52 AM, Blake McBride wrote:
> Thanks for all the responses.  I especially like the Pike pointer.
> To be clear:
> 
> 1.  I don't think languages should depend on invisible elements to
> determine logic.
> 
> 2.  Having been an employer, it is difficult to force programmers to
> use any particular editor or style.  Different editors handle tabs
> and spaces differently.  This is all a bloody nightmare with Python.
> 
> 3.  Languages that use braces (or the like) can be run through a
> program beautifier to correct the indentation.  You are just screwed
> in Python.  So, Python may be a cute language for you to use as an
> individual, but it is unwieldy in a real development environment.
> 
> 4.  Language beautifiers used on bracey languages removes all
> arguments in favor of an off-side language.

While it appears that you had already made up your mind about the matter
long before posting, and perhaps was just looking for vindication, I
feel that some of the snide replies you got were just not tremendously
professional.  However, it may be that people recognized that you likely
had made up your mind already, and posted accordingly.

[toc] | [prev] | [next] | [standalone]


#89078

FromGrant Edwards <invalid@invalid.invalid>
Date2015-04-17 16:28 +0000
Message-ID<mgrcb5$sn2$1@reader1.panix.com>
In reply to#89077
On 2015-04-17, Michael Torrie <torriem@gmail.com> wrote:
> On 04/16/2015 08:52 AM, Blake McBride wrote:
>> Thanks for all the responses.  I especially like the Pike pointer.
>> To be clear:
>
[troll bait elided]

> While it appears that you had already made up your mind about the
> matter long before posting, and perhaps was just looking for
> vindication, I feel that some of the snide replies you got were just
> not tremendously professional.

There are people who post to Usenet professionally?  And I've been
doing it all these years _for_free_?  And, it's not like there's some
sort of Olympics for which I needed to maintain my amateur standing.

> However, it may be that people recognized that you likely had made up
> your mind already, and posted accordingly.

I think most of us just assumed he was just trolling and were playing
along for the fun of it.

-- 
Grant Edwards               grant.b.edwards        Yow! As President I have
                                  at               to go vacuum my coin
                              gmail.com            collection!

[toc] | [prev] | [next] | [standalone]


#89079

FromBartC <bc@freeuk.com>
Date2015-04-17 18:05 +0100
Message-ID<Y3bYw.302660$ms.24839@fx30.am4>
In reply to#89078
On 17/04/2015 17:28, Grant Edwards wrote:
> On 2015-04-17, Michael Torrie <torriem@gmail.com> wrote:

>> However, it may be that people recognized that you likely had made up
>> your mind already, and posted accordingly.
>
> I think most of us just assumed he was just trolling and were playing
> along for the fun of it.

What was troll-like about it? The OP made it clear he didn't like the 
way Python made use of tabs, but he didn't want an argument about it or 
to be persuaded to change his mind or change anyone else's.

He wanted to know if there was a simple syntax wrapper for it. That 
seems reasonable enough.

(Actually *I* would quite like to know why languages don't have 
switchable syntax anyway to allow for people's personal preferences.)

-- 
Bartc

[toc] | [prev] | [next] | [standalone]


#89080

FromRustom Mody <rustompmody@gmail.com>
Date2015-04-17 10:13 -0700
Message-ID<3af12a43-748c-41aa-ad6a-bb5a9deb05fd@googlegroups.com>
In reply to#89079
On Friday, April 17, 2015 at 10:36:13 PM UTC+5:30, BartC wrote:
> (Actually *I* would quite like to know why languages don't have 
> switchable syntax anyway to allow for people's personal preferences.)

Mess in programming syntax is because of html:
http://blog.languager.org/2012/10/html-is-why-mess-in-programming-syntax.html

[toc] | [prev] | [next] | [standalone]


#89084

Fromsohcahtoa82@gmail.com
Date2015-04-17 11:13 -0700
Message-ID<32224544-40dc-49a8-8371-ef18683e0b7f@googlegroups.com>
In reply to#89079
On Friday, April 17, 2015 at 10:06:13 AM UTC-7, BartC wrote:
> On 17/04/2015 17:28, Grant Edwards wrote:
> > On 2015-04-17, Michael Torrie <torriem@gmail.com> wrote:
> 
> >> However, it may be that people recognized that you likely had made up
> >> your mind already, and posted accordingly.
> >
> > I think most of us just assumed he was just trolling and were playing
> > along for the fun of it.
> 
> What was troll-like about it? The OP made it clear he didn't like the 
> way Python made use of tabs, but he didn't want an argument about it or 
> to be persuaded to change his mind or change anyone else's.
> 
> He wanted to know if there was a simple syntax wrapper for it. That 
> seems reasonable enough.
> 
> (Actually *I* would quite like to know why languages don't have 
> switchable syntax anyway to allow for people's personal preferences.)
> 
> -- 
> Bartc

Allowing a switchable syntax only makes the fight even worse.  If you made braces in Python an option to use instead of whitespace block delimiting, then there'd be a ton of infighting among Python developers over which to use.  Just look at C/C++ developers fighting over where the opening brace goes.

By having the language itself forcing a specific style, it requires everyone using it to either shut up and get over it, or just don't use the language.

Personally, I like the Python style.  It forces people to write code that is at least somewhat good to look at.  Not like monstrosities like this that I see from newbie (hell, even professional) C/C++ programmers:

if (something > something_else)
{
result = do_something();
if (!result){
printf("Error!\n")
    return 0;
    }
    do_other_stuff();
    }

Can someone still write ugly code in Python?  No doubt about it.  But at least code blocks will be easily deciphered.

[toc] | [prev] | [next] | [standalone]


#89088

FromMarko Rauhamaa <marko@pacujo.net>
Date2015-04-17 23:28 +0300
Message-ID<87a8y6zehg.fsf@elektro.pacujo.net>
In reply to#89084
sohcahtoa82@gmail.com:

> Can someone still write ugly code in Python? No doubt about it. But at
> least code blocks will be easily deciphered.

That's how I was originally convinced about Python: a coworker with a
terrible C++ "handwriting" produced neat, legible code in Python.

I'm still slightly annoyed by some downsides in the indentation style,
but the practical benefits more than compensate. Also, the semicolon
rules of JavaScript and Go are horrible compared with the simple line
continuation rules of Python.


Marko

[toc] | [prev] | [next] | [standalone]


#89091

FromChris Angelico <rosuav@gmail.com>
Date2015-04-18 07:10 +1000
Message-ID<mailman.380.1429305058.12925.python-list@python.org>
In reply to#89079
On Sat, Apr 18, 2015 at 3:05 AM, BartC <bc@freeuk.com> wrote:
> (Actually *I* would quite like to know why languages don't have switchable
> syntax anyway to allow for people's personal preferences.)

Why do it? What's the advantage of calling two different syntaxes one
language? Simpler to just call them two separate languages - maybe two
languages that share some sort of runtime, but two languages. For
instance, Java bytecode doesn't have to be created from Java source
code, but we don't consider NetRexx to be a "switchable syntax" for
Java. It's a completely separate language that compiles to a .class
file.

ChrisA

[toc] | [prev] | [next] | [standalone]


#89100

FromDan Sommers <dan@tombstonezero.net>
Date2015-04-18 01:18 +0000
Message-ID<mgsbco$e1t$1@dont-email.me>
In reply to#89079
On Fri, 17 Apr 2015 18:05:52 +0100, BartC wrote:

> (Actually *I* would quite like to know why languages don't have
> switchable syntax anyway to allow for people's personal preferences.)

You want LISP, the programmable programming language.

[toc] | [prev] | [next] | [standalone]


#89103

FromRustom Mody <rustompmody@gmail.com>
Date2015-04-17 19:22 -0700
Message-ID<73a6cda5-2962-462a-8aa3-d43dbb077a0d@googlegroups.com>
In reply to#89100
On Saturday, April 18, 2015 at 6:49:30 AM UTC+5:30, Dan Sommers wrote:
> On Fri, 17 Apr 2015 18:05:52 +0100, BartC wrote:
> 
> > (Actually *I* would quite like to know why languages don't have
> > switchable syntax anyway to allow for people's personal preferences.)
> 
> You want LISP, the programmable programming language.

You got it!!
One of the deep paradoxes in 'getting' programming is that you cant do 
programming without some syntax; and yet syntax is irrelevant.

I dont believe one can ever get that without some experience of Lisp --
Minsky's Turing award lecture is an elaboration of this:
http://web.media.mit.edu/~minsky/papers/TuringLecture/TuringLecture.html

[toc] | [prev] | [next] | [standalone]


#89146

FromBartC <bc@freeuk.com>
Date2015-04-19 12:44 +0100
Message-ID<YyMYw.250907$_r1.122849@fx39.am4>
In reply to#89103
On 18/04/2015 03:22, Rustom Mody wrote:
> On Saturday, April 18, 2015 at 6:49:30 AM UTC+5:30, Dan Sommers wrote:
>> On Fri, 17 Apr 2015 18:05:52 +0100, BartC wrote:
>>
>>> (Actually *I* would quite like to know why languages don't have
>>> switchable syntax anyway to allow for people's personal preferences.)
>>
>> You want LISP, the programmable programming language.

I don't really want Lisp (not even with a shiny new syntax).

> You got it!!
> One of the deep paradoxes in 'getting' programming is that you cant do
> programming without some syntax; and yet syntax is irrelevant.

Yes, exactly!

When I sometimes want to code in Python, why can't I used my usual syntax?

The tabbing isn't so much of a big deal, but, for example, I normally 
use ":=" and  "=" for Python's "=" and "==" operators, and it can be a 
nuisance when switching between syntaxes. (At least Python picks up the 
use of "=" inside an expression, unlike C...)

-- 
Bartc

[toc] | [prev] | [next] | [standalone]


#89151

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2015-04-19 23:23 +1000
Message-ID<5533ac70$0$13003$c3e8da3$5496439d@news.astraweb.com>
In reply to#89146
On Sun, 19 Apr 2015 09:44 pm, BartC wrote:

> When I sometimes want to code in Python, why can't I used my usual syntax?

When I go to China, why doesn't everyone speak English for my convenience?

I'll tell you what. When you convince the makers of C compilers to support
Python syntax as an alternative, then I'll help with making Python
compilers support C syntax.


-- 
Steven

[toc] | [prev] | [next] | [standalone]


#89154

Fromwxjmfauth@gmail.com
Date2015-04-19 07:22 -0700
Message-ID<26221ac8-4c29-473e-8120-55c6d8cf9bf2@googlegroups.com>
In reply to#89151
Le dimanche 19 avril 2015 15:24:10 UTC+2, Steven D'Aprano a écrit :
> 
> When I go to China, why doesn't everyone speak English for my convenience?
> 

Why not?
This is exactly what Python did with unicode/ascii.

jmf

[toc] | [prev] | [next] | [standalone]


#89153

FromRustom Mody <rustompmody@gmail.com>
Date2015-04-19 07:01 -0700
Message-ID<1db3fdef-391f-4db4-a5c8-bc1aef59304b@googlegroups.com>
In reply to#89146
On Sunday, April 19, 2015 at 5:15:07 PM UTC+5:30, BartC wrote:
> On 18/04/2015 03:22, Rustom Mody wrote:
> > On Saturday, April 18, 2015 at 6:49:30 AM UTC+5:30, Dan Sommers wrote:
> >> On Fri, 17 Apr 2015 18:05:52 +0100, BartC wrote:
> >>
> >>> (Actually *I* would quite like to know why languages don't have
> >>> switchable syntax anyway to allow for people's personal preferences.)
> >>
> >> You want LISP, the programmable programming language.
> 
> I don't really want Lisp (not even with a shiny new syntax).

You do... See below

> 
> > You got it!!
> > One of the deep paradoxes in 'getting' programming is that you cant do
> > programming without some syntax; and yet syntax is irrelevant.
> 
> Yes, exactly!
> 
> When I sometimes want to code in Python, why can't I used my usual syntax?
> 
> The tabbing isn't so much of a big deal, but, for example, I normally 
> use ":=" and  "=" for Python's "=" and "==" operators, and it can be a 
> nuisance when switching between syntaxes. (At least Python picks up the 
> use of "=" inside an expression, unlike C...)

See McCarthy's interview
http://www.infoq.com/interviews/Steele-Interviews-John-McCarthy
This is after a life of Lisp and AI -- he died a couple of years after the interview.
And in there he repeatedly asks for 'abstract syntax' languages -- as I see it
the same as you are asking

Of course one needs to distinguish Lisp-technology from Lisp-philosophy.
I believe you and McCarthy are asking for Lisp philosophy as I am also:
http://blog.languager.org/2012/10/html-is-why-mess-in-programming-syntax.html

JFTR: The specific connection with html is somewhat facetious
That programmers are stuck in text files 50 years after everyone else has moved 
on is more serious

[toc] | [prev] | [next] | [standalone]


#89101

FromMichael Torrie <torriem@gmail.com>
Date2015-04-17 20:14 -0600
Message-ID<mailman.387.1429323295.12925.python-list@python.org>
In reply to#89079
On 04/17/2015 11:05 AM, BartC wrote:
> He wanted to know if there was a simple syntax wrapper for it. That 
> seems reasonable enough.
> 
> (Actually *I* would quite like to know why languages don't have 
> switchable syntax anyway to allow for people's personal preferences.)

There was a version of Python (compatible at a bytecode level) that did
implement braces for blocks.  It was called pythonb, but it is now
defunct, understandably for lack of interest.  It was just a
modification to the parser is all.  So it's completely doable.  In fact
one could probably do it with a preprocessor of some kind.  But there's
little utility in it.

[toc] | [prev] | [next] | [standalone]


#89112

FromMarko Rauhamaa <marko@pacujo.net>
Date2015-04-18 09:53 +0300
Message-ID<87oammx6z6.fsf@elektro.pacujo.net>
In reply to#89101
Michael Torrie <torriem@gmail.com>:

> There was a version of Python (compatible at a bytecode level) that did
> implement braces for blocks.  It was called pythonb, but it is now
> defunct, understandably for lack of interest.

<URL: http://www.perl.com/pub/2001/04/01/parrot.htm>

   LW: Sure. I'd probably write the program something like this:

       while(@line = Sys::Stdin->readline()):
           continue_next if $line[0] =eq= "#":
           print @line;
       }


Marko

[toc] | [prev] | [next] | [standalone]


#89104

FromBen Finney <ben+python@benfinney.id.au>
Date2015-04-18 12:22 +1000
Message-ID<mailman.388.1429323788.12925.python-list@python.org>
In reply to#89079
BartC <bc@freeuk.com> writes:

> (Actually *I* would quite like to know why languages don't have
> switchable syntax anyway to allow for people's personal preferences.)

Which people's personal preferences? Are these the same people who have
such passionate disagreement about tabs versus spaces?

If you only write programs that will only ever be read by you and no-one
else, feel free to maintain a fork of Python (or any other language)
that suits your personal preferences.

Too much effort? Or maybe you sometimes want others, whose preferences
may not exactly match yours, to collaborate on programs you write? Then
I think you have your answer of why such personal perferences are not
switchable in the languages we actually use.

-- 
 \      “It is the integrity of each individual human that is in final |
  `\        examination. On personal integrity hangs humanity's fate.” |
_o__)               —Richard Buckminster Fuller, _Critical Path_, 1981 |
Ben Finney

[toc] | [prev] | [next] | [standalone]


Page 3 of 6 — ← Prev page 1 2 [3] 4 5 6  Next page →

Back to top | Article view | comp.lang.python


csiph-web