6/6/2026 at 9:32:08 AM
Nicely done!I always felt that Python's "There should be one-- and preferably only one --obvious way to do it." was a bit of a mess.
Obviously (to anyone who was around at the time), that plank was written in response to Perl's motto: "There is more than one way to do it."
Zig's original take on this, "Only one obvious way to do things" seems even worse. You see, both languages agree that Perl had it wrong: it is unhelpful to have several different ways to write any future. But they went a little too far: it is not actually bad for it to be possible to write the same thing in more than one way.
Zig's new phrasing: "There is an idiomatic way to do it." captures the CORRECT alternative to Perl's motto. It is not important that there be no alternative ways of writing something, Rather, it is important that there be a single idiomatic way to write it.
by mcherm
6/6/2026 at 11:28:37 AM
This is a losing proposition. Because just like in Python, it may also generate endless debates on "ok, but what exactly is the idiomatic way for this particular thing here"? Is it A, or B, or maybe C? Since many are always possible, each optimizing for slightly different things, like simplicity, or maintainability, or performance, or readability, or coverage, etc. Groups may form furiously asserting that the idiomatic way must be C, others defending B, or A, and for what. Why does it matter? A young language free from cruft, after a long history of various decisions that led it on certain paths, can boldly claim such nonsense, but makes one wonder how it may look in 30 or 40 years, when other languages/ecosystems will point at its mistakes. Arguably Perl had it right all along, it's just a simple fact of life, expressed in such a generic manner that there is no need to fight it, since it's obviously true. Python's retort at the time was just clever marketing (aka lies), that worked (fooled a lot of people), it targeted Perl specifically just because that was the main competition back then.by brakl
6/6/2026 at 12:40:27 PM
Because something bad might happen in 30 years is not the reason to make sure it happens in three...by TylerE
6/6/2026 at 12:32:40 PM
Are you a Perl dev?by Chris2048
6/6/2026 at 9:48:40 AM
I think people criticize that line in the zen of Python because Python has now become very maximalist. On it's own merits, I think "There should be one obvious way to do it" is much better, less clunky, than "There is an idiomatic way to do it".Also, importantly, the Zen of Python is kinda written as a set of ideas that Python should aspire to ("there should be one obvious way to do it") instead of a sales pitch of Python's merits. I prefer that.
by Fraterkes
6/6/2026 at 4:04:45 PM
It all sounds great until someone writes nested list comprehensions. They are the recommended, idiomatic way to things most sane people would use ‘map’, ‘filter’, and ‘reduce’ chains, although chains are another thing python very much dislikes.by iroddis
6/6/2026 at 5:06:54 PM
I always read this as a tongue in cheek joke b/c of how the — appears left aligned, then right aligned, then elsewhere in the Zen center aligned, sort of pointing to how yeah there’s multiple ways to do things …by geophph
6/6/2026 at 11:36:07 AM
The correct alternative is to make no motto at all. It's code. Makes computer go brrr.by kgwxd
6/6/2026 at 12:10:34 PM
Yeah, I actually don't care how other people program in the languages I'm using. Give me all the ways to do things. I'll make my own choices, thank you.by moron4hire
6/6/2026 at 12:18:40 PM
Someone cooked up a language just like this ages ago, and today it's one of the most popular languages on the planet! Unfortunately, in modern times people don't like to write/code in this language, so they built some beast on top of it which is the de facto standard right now. But you can still write JavaScript, and you can avoid all the shit parts like "classes" and what not, do classic prototype-style programming, or even layer your own functional/OOP programming on top. Not much you cannot do in JavaScript, probably only a lisp would enable more programming paradigms, but for mainstream languages, it's as close as you can get to True Freedom.by embedding-shape