DEV Community

Discussion on: The Controversy Behind The Walrus Operator in Python

Collapse
 
steelwolf180 profile image
Max Ong Zong Bao

It feels like a pain to read the code since essentially your putting 2 lines of code together.

Sure in terms of optimisation and cleverness is good but my only worry is that is its maintainability of this piece of code.

Even for string literals despite it has been out for 2 years. It's only recently that I started using it in my python code as it was not within my purview previously on it's usefullness.

Collapse
 
renegadecoder94 profile image
Jeremy Grifski • Edited

Yeah, I’m generally against increasing the complexity of languages. That’s why I like python so much to begin with. I feel like this doesn’t add enough for it to be worth it.

Collapse
 
mickleby profile image
Mickleby

I take note of the framing "complexity of language." We have a living industry, existing and future code, folks engaging source, tasks to perform, data to wrangle. The optimal interface (language, Python) may not be apparent, not obvious. Certain abstractions (language design decisions) optimize different engagements, even as the user base (coders) is constantly evolving, both in response and orthogonal to the language, the tasks, the install base.

To me the ideal language is one that prompts me to ask the insightful questions and to gloss all else -- given the domain on which I apply this language. [the right complexity -- and only that much -- for the job at hand]