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


Groups > comp.lang.python > #96052

Re: Program in or into (was Python handles globals badly)

From random832@fastmail.us
Subject Re: Program in or into (was Python handles globals badly)
Date 2015-09-06 01:26 -0400
References (2 earlier) <CAPTjJmpkry3qBL9ntf4gUsE-aDGLooHqViMBW=ZNcK2Lb9e9nA@mail.gmail.com> <55EA487D.2010807@gmail.com> <mailman.155.1441418073.8327.python-list@python.org> <03c53b53-4103-4fd8-8851-caeccda8e016@googlegroups.com> <55eba65d$0$1665$c3e8da3$5496439d@news.astraweb.com>
Newsgroups comp.lang.python
Message-ID <mailman.165.1441517206.8327.python-list@python.org> (permalink)

Show all headers | View raw


Steven D'Aprano <steve@pearwood.info> writes:

> That depends. Is the example C# code idiomatic for the language?

Not in the least. My first clue was Int32 - nobody actually uses those
names.

> Or was it
> written by somebody ignorant of C#, and consequently is a poor example of
> badly-written and unidiomatic "Java in C#"?
>
> If the first, then I expect I would write the C# code, because it is
> idiomatic and works. What would you do?
>
> It is certainly true that C# appears to be a more verbose language than
> Python. Based on this example, it prefers to use classes with methods
> rather than stand-alone functions,

You certainly need to put methods in a class, but it's absurd that they
made it an actual instantiable class with instance properties for the
variables they required for sorting, rather than there being a class
that's just there as a container for the functions. I wouldn't do that
in Java, either.

They also gave it features a lot of the shorter versions on the page
don't have; the ability to fall back to insertion sort for short lists,
and the ability to tune exactly how it does that, and how many
subsequences to sort and merge.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Python handles globals badly. tdev@freenet.de - 2015-09-04 12:11 -0700
  Re: Python handles globals badly. Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-04 13:48 -0600
  Re: Python handles globals badly. Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-04 13:52 -0600
  Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2015-09-05 10:27 +1000
  Re: Python handles globals badly. Michael Torrie <torriem@gmail.com> - 2015-09-04 19:42 -0600
  Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2015-09-05 11:54 +1000
    Program in or into (was Python handles globals badly) Rustom Mody <rustompmody@gmail.com> - 2015-09-04 20:18 -0700
      Re: Program in or into (was Python handles globals badly) Chris Angelico <rosuav@gmail.com> - 2015-09-05 13:31 +1000
      Re: Program in or into (was Python handles globals badly) Steven D'Aprano <steve@pearwood.info> - 2015-09-06 12:35 +1000
        Re: Program in or into (was Python handles globals badly) MRAB <python@mrabarnett.plus.com> - 2015-09-06 03:54 +0100
        Re: Program in or into (was Python handles globals badly) Rustom Mody <rustompmody@gmail.com> - 2015-09-05 21:35 -0700
        Re: Program in or into (was Python handles globals badly) random832@fastmail.us - 2015-09-06 01:26 -0400
          Re: Program in or into (was Python handles globals badly) wxjmfauth@gmail.com - 2015-09-06 00:42 -0700
        Re: Program in or into (was Python handles globals badly) Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-06 18:19 -0600

csiph-web