Are the critiques in "All the things I hate about Python" valid?

Chris Angelico rosuav at gmail.com
Sat Feb 17 17:09:55 EST 2018


On Sun, Feb 18, 2018 at 8:50 AM, bartc <bc at freeuk.com> wrote:
> On 17/02/2018 20:11, Chris Angelico wrote:
>>
>> On Sun, Feb 18, 2018 at 1:47 AM, Ian Kelly <ian.g.kelly at gmail.com> wrote:
>
>
>>> Okay, I'm curious. How did C# force you to make extra HTTP requests
>>> that were no longer necessary when you rewrote in Python?
>>
>>
>> It didn't *force* those requests to be made, but the code was so large
>> and convoluted that I doubt its original author realized that the
>> requests were being repeated.
>
>
> ....
>
>> By making the code MASSIVELY simpler, Python allowed me (as the
>> programmer) to see where improvements could be made. When you have
>> thousands upon thousands of lines of code, it's far harder to
>> recognize where one function's job overlaps another's, and harder
>> still to figure out a clean way to reduce the duplication without
>> breaking everything.
>
>
> That's a very interesting observation.
>
> I've frequently made the complaint about systems that I consider large and
> complex also leading to such issues, where no one individual can see the
> whole picture.
>
> For example, in the system used for building CPython from source.
>
> But I guess what you're describing doesn't apply in such cases. Those 20K or
> 30K lines of configure scripts really /are/ necessary!
>

No, it does apply. But those 20-30K lines aren't what you should be
reading. Here's the list of top-level files in the cpython repository,
with their line counts:

rosuav at sikorsky:~/cpython$ wc -l `git ls-files|grep -v /`
     39 .gitattributes
    115 .gitignore
     58 .hgeol
    106 .hgignore
    182 .hgtags
    146 .travis.yml
    254 LICENSE
   1772 Makefile.pre.in
    253 README.rst
    291 aclocal.m4
   1473 config.guess
   1836 config.sub
  18321 configure
   5576 configure.ac
    294 install-sh
   1583 pyconfig.h.in
   2361 setup.py
  34660 total

The largest one here is "configure", but that's only in the repository
to remove a dependency. You can delete it and then run "autoconf" and
it'll be regenerated from configure.ac. With that removed, the largest
file is about 5K lines, and all these files put together make up only
16K lines. If you're reading 30,000 lines of configuration script,
you're basically reading object code. It's like calling dis.dis() on a
Python function and then complaining that it's long and unreadable.

Stop making unfair criticisms if you want people to take you seriously.

ChrisA



More information about the Python-list mailing list