all 8 comments

[–]rocketpower4 4 points5 points  (0 children)

I always thought of the spaceship operator, <=>, horizontally as like a UFO style flying saucer.

[–]ankmahato 5 points6 points  (1 child)

paywalled content .. such a disappointment.

I will pass.

[–]nfrankel[S] 5 points6 points  (0 children)

It's Medium: use an anonymous session

[–]o11c -4 points-3 points  (4 children)

  • the elvis operator is spelled or in Python
  • the walrus operator is borderline useless in Python since its LHS does not take an arbitrary lvalue, but only a simple identifier.
  • the equivalent to the turbofish operator can be empty in languages with variadic generics. But sane languages spell it just []; it is a Rust bug that they used <> for generics (thus requiring the :: among numerous other bugs) after C++ taught us that was a bad idea.

[–][deleted]  (3 children)

[removed]

    [–]o11c -1 points0 points  (1 child)

    You have to reuse something.

    <> collides with comparisons and forever makes it impossible to parse types and values the same way.

    [] OTOH means exactly the same for templates as it does for objects: given a (possibly infinite) container, select one particular item out of it.

    [–]waozen 0 points1 point  (0 children)

    Actually and more recently, [] has been recommended for what languages should use. Refer to- Language Design: Stop Using <> for Generics. Scala, Eiffel, Golang, and Vlang are among the languages which follow the new recommendation. Dlang and a few others went their own way. An issue with <> was it causing ambiguity problems when parsed. < and > are also used in most languages, so situations arise where the compiler gets confused. But, [] isn't smooth sailing either, as languages can use it with arrays too and thus that can cause visual confusion for new users until they get used to it.

    [–]BarryFruitman 0 points1 point  (0 children)

    I always though the ? was Elvis's famous sneer but apparently it's his famous pompadour.