Is there a Zen of Python for other lanaguages?


(Steve Jalim) #1

The Zen of Python is a great thing - very grounding and useful to developers old and new.

While much of it is applicable to any language, I was wondering: do other langs have similar sets of maxims that I’ve not heard of yet? (I can’t think of any re C or JS, for instance)


(Daniel Hollands) #2

I’m not sure this is the same thing, but Ruby has the Ruby Koans.


(Andy Wootton) #3

Clojure has a Rationale, by Rich Hickey

https://clojure.org/about/rationale

and a ‘statement’ on state https://clojure.org/about/state


(Andy Wootton) #4

Not a language but the Agile Modelling development practice, via a Scott W. Ambler tweet http://www.agilemodeling.com/practices.htm

I like “Prove it with code - a model is an abstraction”. A ‘reminder to do a computational experiment’, perhaps?; as a user-story is a reminder to have a conversation (or from two to n conversations)


(David Davidson) #5

(Not being entirely serious here, obviously)
I think for C, K&R’s “The C Programming Language” is about the only equivalent.
For Assembler, Hyde’s “The Art of Assembly Language”.
As for C++… Well, there is always the list of open issues…
http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_active.html

Graham’s “On Lisp” is actually a pretty good read.


(Michael Brett) #6

Not entirely equivalent, but I saw this tweet today:


(David Davidson) #7

#4: There is no excuse to use Flash. Ever. :wink:


(Marc Cooper) #8

Most of those axioms apply generally. Except:

  • There should be one -- and preferably only one -- obvious way to do it.
    This is very Pythoesque, and one of the reasons I’m not a Python advocate. There is no one true way and there shouldn’t be. I dislike this idea quite a lot.

  • Although that way may not be obvious at first unless you're Dutch.
    This isn’t funny.

  • Although never is often better than right now.
    No idea what this means.

  • Namespaces are one honking great idea — let's do more of those!
    See Java (and the hideous mess that PHPers create with namespaces) to see why this isn’t always such a great idea. One level, sure. More? Requires thought.

I dislike generalities in programming. Often, devs take them as gospel and are worse for it. There is no one true way. All languages have weaknesses and strengths (except JavaScript which has no strengths ;-)). Keep it simple and learn your trade. That’ll work 99% of the time.


(Andy Wootton) #9

I assumed it was if you were Dutch. I don’t always understand German humour either.

I thought it meant it might be better to never do it than to do a rush job. i.e. never = bad, speedily = good, hastily = very bad.


(Stuart Langridge) #10

It’s because Guido van Rossum, Python’s BDFL, is Dutch. It’s a backhanded compliment about how sometimes the things he designs into the language are obvious after he’s done them, but not necessarily beforehand.


(Marc Cooper) #11

Ah, cheers Stuart. That explains it.


(Andy Wootton) #12

It does? I knew Guido is Dutch but how is that relevant?

Surely, “I’ll explain what I’m trying to do when I’ve finished” is universal? I read something on LinkedIn by someone claiming that writing code wasn’t wizardry. Muggles!

Update: it’s not just code. I start writing blog posts with only a vague idea. By the end, I always knew what it was about.


(Daniel Hollands) #13

Again, not sure this exactly fits the topic, but in Ruby you’ve got MINASWAN, or:

Matz is Nice And So We Are Nice

This is less to do with the philosophy of the language (although, according to Wikipedia, Matz said “Programmers often feel joy when they can concentrate on the creative side of programming. So Ruby is designed to make programmers happy.”), and more with the way the community acts, and (again, according to Wikipedia) MINASWAN is intended to foster a sense of community that is welcoming to new participants and presumes good intentions of counterparties.

This, I think, is a big part of why the Contributor Covenant was rejected, and the Ruby Community Conduct Guideline was written in it’s place - a policy with 4 simple guidelines:

  • Participants will be tolerant of opposing views.
  • Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
  • When interpreting the words and actions of others, participants should always assume good intentions.
  • Behaviour which can be reasonably considered harassment will not be tolerated.

(Stuart Langridge) #14

Then you are correct to not use Python. The Python motto – that there’s one obvious way to do it – is a direct contrast to Perl’s “there’s more than one way to do it” motto and ethos, and informs the language design from top to bottom. The whole point of putting this up front is so that people who don’t like it know to go elsewhere, rather than hang out as Python users and try to make it have more than one way to do it :slight_smile:


(Andy Wootton) #15

I see this as the contrast between natural language and maths, between expression (and its sibling ambiguity) and precision. The languages were designed by a linguist and a computer scientist.

In Gleick’s ‘The Information’, he talks about natural language being a finite set of words mapped onto potentially infinite meanings, so being inherently ambiguous. That sounds like the worst thing for code. Code Poetry, maybe :slight_smile:


(Andy Wootton) #16

After the obvious ommission of Perl, I hunted down Larry Wall and found this:

"1. Larry is always by definition right about how Perl should behave. This means he has final veto power on the core functionality.

2 Larry is allowed to change his mind about any matter at a later date, regardless of whether he previously invoked Rule 1.

Got that? Larry is always right, even when he was wrong."

What I was looking for was:

“Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris.”

The Dark Side of The Force?

<
[Wonders if @barbie is “in the house”. Waves]


(Michael Brett) #17

Well, if it’s good enough for the UK parliament…


(Andy Wootton) #18

Sadly, they don’t have the good humour to admit when they’ve done it.


(Marc Cooper) #19

Matz handled that that brilliantly.


(Marc Cooper) #20

I do use Python with Sage. The constraint works just fine there for me.

I dislike the enforced whitespace too. I could never be happy spending my days in it. So I don’t \o/