osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Python-Dev] PEP 572, VF/B, and "Shark Jumping"


On Thu, Jul 05, 2018 at 05:33:50AM +0300, Ivan Pozdeev via Python-Dev wrote:

> And https://mail.python.org/pipermail/python-dev/2018-June/154160.html 
> disproves the "chosen often these days in new languages".

Ivan, I think you may have linked to the wrong page. That page was Chris 
kindly referring you to my post here:

https://mail.python.org/pipermail/python-ideas/2018-May/050938.html

which refutes Mike's original, biased selection of a handful of 
languages. Which he then misrepresented as not including assignment 
expressions when half of them actually do, at least in a limited form.

(3 out of the 5 of Mike's examples include *at least* some limited 
assignment expression. My survey found 13 out of 18 modern languages 
have at least some form of assignment expression. See link above for 
details.)

It simply isn't true that modern languages are moving away from 
assignment expressions. Some are. Some aren't. Even those that don't 
support assignment expressions in general usually support special syntax 
to allow it in a few contexts.

But even if we pretended that, let's say, Go for example has no 
assignment expressions (it actually does, but limited only to the 
special case of if statements), what conclusion should we draw?

That Rob Pike is ever so much a better language designer than Guido? 
Maybe he is, maybe he isn't, but Go is just eight years old. Python is 
27. When Python was 8, it lacked a lot of features we find indispensible 
now:

https://www.python.org/download/releases/1.5/whatsnew/

Who is to say that when Go is 27, or even 10, it won't have added 
assignment expressions?

Some of Go's choices seem a bit... idiosyncratic. Strings are still 
ASCII byte-strings. Unicode text is relegated to a seperate type, 
"runes", the naming of which is a tad patronising and contemptuous of 
non-ASCII users. There are no exceptions or try...finally. The designers 
bowed to public pressure and added a sort of poor-man's exception system, 
panic/recover, but for most purposes, they still requiring the "check a 
flag to test success" anti-pattern. The designers are actively opposed 
to assertions.

I dare say a lot of Python's choices seem strange to Go programmers too.

Rather than saying "Go got it right", maybe we should be saying "Go got 
it wrong".



> >We can also reuse the existing "EXPR as NAME" syntax that already 
> >exists and is widely enjoyed.
> >
> 
> For the record, with "as", Victor Stinner's examples from the 5 Jul 2018 
> 00:51:37 +0200 letter would look like:


Enough with the "as" syntax. This discussion has been going on since 
FEBRUARY, and "as" was eliminated as ambiguous months ago. Stop beating 
that dead horse.




-- 
Steve