Having trouble setting up an extremely simple server...

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Nov 22 00:32:43 EST 2013


On Thu, 21 Nov 2013 18:36:32 -0800, Cilantro MC wrote:

> I prefer using the semicolons... They aren't making my code wrong... I
> use other programming languages from time to time, and I'd rather just
> always use semicolons, as with the parentheses.

There are all sorts of things that you can do that don't make your code 
"wrong" but do make it difficult to deal with. Why stop with semi-colons?

import socket; pass; pass; pass; pass; pass;
serverReady = ((True is True) is True) is True) is True);
serverSock =         socket     .                              \
                                socket(
                    socket                 .           \
           AF_INET                    \
                                ,                      \
                    socket            .                        \
                                SOCK_STREAM                    \
           )                                          \
                                ;


is legal, correct code and works fine. So why not write that?

Because it is *annoying* code. It doesn't read fluently. The unnecessary 
punctuation and silly spacing makes it harder to read.

To a fluent Python programmer, that's what semi-colons are like, although 
to a lesser degree. An unnecessary distraction and annoyance, rather like 
people who talk like this:

"Er, I prefer, um, using the semicolons, um... They, um, aren't making 
my, um, code wrong... er, I use other, um, programming languages, um, 
from time to time, um, and I'd, er, rather, um, just always, um, use 
semicolons, um, as with, er, the parentheses, um."

Pretty horrible. The sentences are still grammatically correct. But that 
doesn't mean it's a good idea to talk like that.



-- 
Steven



More information about the Python-list mailing list