1. 10

  2. 4

    He doesn’t really say that “Python makes thinking in code easier”. He says that he thinks in Python, which obviously he does, being the guy who invented the language and all; it doesn’t apply to everybody. I probably think more in OCaml than anything else, so even when I’m writing JS it throws me off if I see a function being used before being defined.

    “You primarily write your code to communicate with other coders, and, to a lesser extent, to impose your will on the computer.” —Guido van Rossum

    That’s just another way of saying

    “Programs are meant to be read by humans, and only incidentally for computers to execute.” —Donald Knuth

    I don’t know, I didn’t find this post very interesting. It’s just gushing over Python.

    1. 2

      “Programs are meant to be read by humans, and only incidentally for computers to execute.”

      From the preface to the First Edition of SICP: https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book-Z-H-7.html

      1. 1

        In linguistics, there’s this thing called the Sapir-Worf Hypothesis, which occasionally gets abused by programming language people with pet theories… but in very simple terms yes, of course language affects thought. But how and why? That’s when it always gets very speculative and confusing, since it’s hard to do controlled experiments.

        Maybe a bit of a tangent, but… I’ve seen both of those quotes before, and I agree that Guido’s is derivative of Don’s. But there’s something that bothers me about the basic formulation. It is provocative in sort of a cheap way, because it is untrue. It is a deliberate reversal of the plain truth of the matter. Knuth’s value statement wasn’t even a true description of how programming was practiced when Knuth wrote it, which is why he wrote it. It’s been getting less true ever since. Maybe it would be a good thing if we all agreed to act as if it were true… but we’ll never know. It’s just mathematics envy. Nobody outside academia gets paid to write code to be read by humans. Even hard-core theorists who like to imagine that programs are primarily mathematical objects (which ‘only incidentally’ even have implementations at all) have their tidy abstractions ignored by everyone outside their narrow sub-fields when it turns out the implementations aren’t performant.

        1. 4

          Nobody outside academia gets paid to write code to be read by humans.

          Ironically, in my experience code written by academians is often unreadable, while at my job before anybody merges changes to the projects we maintain, we have somebody who was not involved with writing the changes (and thus has no context for whatever feature was added) review them as a sanity check, I’m literally paid to write code to be read by humans.

          1. 1

            Sure, code review is a normal practice for many businesses, and is often done in greater quantity (and sometimes better quality) than academic peer review. But don’t fool yourself – you’re getting paid to write code that will be run on a computer. ‘Incidentally’, your changes will be reviewed by some humans, and no doubt for good reasons. But just for a thought experiment, imagine how many merge requests you could author containing beautiful-but-broken code before you’d be looking for another job.

            Readable code is a very good thing, but it’s no substitute for code that actually runs and gets something done. Ideally we’d always have both at the same time, but the real world priority is pretty clear.

      2. 1

        In general, Python is terse, pretty straightforward and easy to understand. Getting “practical” work done doesn’t typically require that significant amount of effort, and you write very little boilerplate. Python is the Honda Civic of programming languages. It can do what a lot of people need in an extremely direct way, but it’s not fancy and can’t compete in Formula 1. I’m perfectly OK with that because it’s helped me get a lot of stuff done very quickly so I can get more done.

        1. 1

          Just out of curiosity, and because they mention how easy Python is for people who are new to programming: am I the only one constantly falling over an unexpected generator in Python 3? Everything returns generators now and if you use them twice they don’t work. “Hey, why is this list emp-…oh generator”

          1. 1

            It’s not just you, but generators are a very important and core part of the language. See this entry in my Python style guide for more pointers: