Live data from Hacker News

Python Is Eating the World

zdnet.com

151–160 of 993 posts

Re: Python Is Eating the World

#151

Earlier quoted context omitted.

I write python professionally and honestly, who cares about the 80 character limit? Just ignore it! :)

I've never worked at a place where the prevailing python culture wasn't to set the linter on kill and just let go wild.

Well that sounds like a personal problem and it has nothing to do with the language. As a counter-anecdote, I've been working on Python projects for over a decade and have yet to experience the draconian linter settings you described.

Re: Python Is Eating the World

#152

"I was very disappointed in how the people who disagreed technically went to social media and started ranting that the decision process was broken, or that I was making a grave mistake. I felt attacked behind my back," May I ask who did he mentioned about ?

I don't know the answer to that question, but this post from February 10, 2006 captures some of Guido's frustration with the way certain contributors would insist on changing Python in ways in which they might be able to win an argument about syntactic disambiguousity and technical implementability, but at the expense of that ineffable sense of essential Pythonicity.

https://www.artima.com/weblogs/viewpost.jsp?thread=147358

All Things Pythonic

Language Design Is Not Just Solving Puzzles

by Guido van van Rossum, February 10, 2006.

Summary

An incident on python-dev today made me appreciate (again) that there's more to language design than puzzle-solving. A ramble on the nature of Pythonicity, culminating in a comparison of language design to user interface design.

Some people seem to think that language design is just like solving a puzzle. Given a set of requirements they systematically search the solution space for a match, and when they find one, they claim to have the perfect language feature, as if they've solved a Sudoku puzzle. For example, today someone claimed to have solved the problem of the multi-statement lambda.

But such solutions often lack "Pythonicity" -- that elusive trait of a good Python feature. It's impossible to express Pythonicity as a hard constraint. Even the Zen of Python doesn't translate into a simple test of Pythonicity.

In the example above, it's easy to find the Achilles heel of the proposed solution: the double colon, while indeed syntactically unambiguous (one of the "puzzle constraints"), is completely arbitrary and doesn't resemble anything else in Python. A double colon occurs in one other place, but there it's part of the slice syntax, where a[::] is simply a degenerate case of the extended slice notation a[start:stop:step] with start, stop and step all omitted. But that's not analogous at all to the proposal's lambda ::. There's also no analogy to the use of :: in other languages -- in C++ (and Perl) it's a scoping operator.

And still that's not why I rejected this proposal. If the double colon is unpythonic, perhaps a solution could be found that uses a single colon and is still backwards compatible (the other big constraint looming big for Pythonic Puzzle solvers). I actually have one in mind: if there's text after the colon, it's a backwards-compatible expression lambda; if there's a newline, it's a multi-line lambda; the rest of the proposal can remain unchanged. Presto, QED, voila, etcetera.

But I'm rejecting that too, because in the end (and this is where I admit to unintentionally misleading the submitter) I find any solution unacceptable that embeds an indentation-based block in the middle of an expression. Since I find alternative syntax for statement grouping (e.g. braces or begin/end keywords) equally unacceptable, this pretty much makes a multi-line lambda an unsolvable puzzle.

And I like it that way! In a sense, the reason I went to considerable length describing the problems of embedding an indented block in an expression (thereby accidentally laying the bait) was that I wanted to convey the sense that the problem was unsolvable. I should have known my geek audience better and expected someone to solve it. :-)

The unspoken, right brain constraint here is that the complexity introduced by a solution to a design problem must be somehow proportional to the problem's importance. In my mind, the inability of lambda to contain a print statement or a while-loop etc. is only a minor flaw; after all instead of a lambda you can just use a named function nested in the current scope.

But the complexity of any proposed solution for this puzzle is immense, to me: it requires the parser (or more precisely, the lexer) to be able to switch back and forth between indent-sensitive and indent-insensitive modes, keeping a stack of previous modes and indentation level. Technically that can all be solved (there's already a stack of indentation levels that could be generalized). But none of that takes away my gut feeling that it is all an elaborate Rube Goldberg contraption.

Mathematicians don't mind these -- a proof is a proof is a proof, no matter whether it contains 2 or 2000 steps, or requires an infinite-dimensional space to prove something about integers. Sometimes, the software equivalent is acceptable as well, based on the theory that the end justifies the means. Some of Google's amazing accomplishments have this nature inside, even though we do our very best to make it appear simple.

And there's the rub: there's no way to make a Rube Goldberg language feature appear simple. Features of a programming language, whether syntactic or semantic, are all part of the language's user interface. And a user interface can handle only so much complexity or it becomes unusable. This is also the reason why Python will never have continuations, and even why I'm uninterested in optimizing tail recursion. But that's for another installment.

Re: Python Is Eating the World

#153
post #102

Earlier quoted context omitted.

It seems to value my time quite highly, as I can achieve most things more quickly and easily in Python than any other language I know. Can you be more specific about how it increases your burnout? Is it the language, or someone forcing you to use that linter and settings?

> Is it the language, or someone forcing you to use that linter and settings? It's definitely both. Preface in true internet style: these are just opinions and you may not share them. That's fine. I really don't like Python as a language. I don't like its total lack of composability. I don't like its over-reliance on a very dated vision of OO. I don't like how its list comprehensions aren't generic. I don't like how…

> I don't like how its list comprehensions aren't generic.

Python iteration is generic.

https://docs.python.org/3/reference/datamodel.html#object.__...

Please don't spread FUD.

Re: Python Is Eating the World

#154

There ware a time when I wondered if I should learn Ruby or Python. These days, unless I'm going to be a Rails dev, hands-down Python.

Ruby is a nicer language for general scripting, ie “better bash,” as that’s what it was originally designed for. It’s also a bit faster, and has a vastly better / simpler package management system.

Python does have great scientific / math libraries, and is worth knowing.

One nice thing is the two languages are so similar that it’s pretty easy to switch between them and use whichever fits the bill.

Re: Python Is Eating the World

#155
What I find baffling is that almost every program I'm interested in as a creative power user has a Python API for scripting, from type and graphic design to 3D modeling, rendering and music making.

I'm a bit into web design/frontend as well, and was thinking about either learning JS and Node more deeply, or add some other "backend language" like PHP or Ruby, and learn their frameworks like Laravel or Rails.

Should I pick Python, Django or Flask instead to cross the gap to my creative hobbies?

Re: Python Is Eating the World

#156
post #79

Earlier quoted context omitted.

This is good advice, but it elucidates the problem. There should be 2 steps (1. list your dependencies, 2. pip install). Not 5.

I agree. I'm optimistic about tools like Poetry https://poetry.eustace.io/docs/basic-usage/ for solving this. Unfortunately Python predates the realization that good packaging tools were a thing that needs to be solved in the core language and not externally (Go, Rust, Node, etc. postdate this realization; C, Perl, Java, etc. also predate it). The flip side is that decoupling the interpreter/compiler from the build s…

>Unfortunately Python predates the realization that good packaging tools were a thing that needs to be solved in the core language and not externally (Go, Rust, Node, etc. postdate this realization; C, Perl, Java, etc. also predate it).

Sure, but it's also a cultural thing. Ruby is nearly as old, and also predates this, but has nowhere near the insanity of Python. The community jumped on bundler and rvm/rbenv/etc super quickly, and rapidly improved them, while the Python community is barely even aware of pip-tools / pipenv AFAICT. Even virtualenv is really only a "real pythoners know" thing, it's rarely mentioned in guides, so newbies screw up their global environment frequently.

Re: Python Is Eating the World

#157

Reading this got me thinking and I wonder if other people feel like me about this, so I'm going to share it. This is not serious, but not entirely unserious... I try to be a good sport about it, but every time I write python I want to quit software engineering. It makes me angry how little it values my time. It does little for my soured disposition that folks then vehemently lecture me about the hours saved by future…

I write python professionally and honestly, who cares about the 80 character limit? Just ignore it! :)

Any language can benefit from the beauty of enforcing general typography guidelines that go back 100+ years.

Re: Python Is Eating the World

#158

Earlier quoted context omitted.

> Is it the language, or someone forcing you to use that linter and settings? It's definitely both. Preface in true internet style: these are just opinions and you may not share them. That's fine. I really don't like Python as a language. I don't like its total lack of composability. I don't like its over-reliance on a very dated vision of OO. I don't like how its list comprehensions aren't generic. I don't like how…

> I don't like how its list comprehensions aren't generic. Python iteration is generic. https://docs.python.org/3/reference/datamodel.html#object.__... Please don't spread FUD.

I'm thinking of generic in the sense of monadcomprehensions, sorry.

> That's an implementation detail of CPython. I don't see how it's important for a language user either. Jython uses Java objects. PyPy uses RPython.

This strengthens my point though?

> Please don't spread FUD.

This is that culture thing I'm talking about.

Re: Python Is Eating the World

#159
It's so refreshing to not see anyone here whining about Python forcing them to indent their code properly. The kind of people who think that's a PROBLEM instead of a FEATURE really should not be ever writing any new code, and instead should be punished by forcing them to maintain other people's code written with that same lazy misguided attitude, until they recognize how self indulgent, inconsiderate, and disrespectful that is not just to other people who have to read their code, but also to themselves.

The same kind of people criticize Lisp for having too many parenthesis, then go on to write unintelligible shell scripts, Perl and C++ code chock full of skewbald menageries of sigils and punctuation bound together with a towering inferno of precedence rules, terribly worse than Lisp's "too many parenthesis".

Re: Python Is Eating the World

#160
post #58
post #33

Python has a lot of problems that really slow down development, but they are all fixable. The biggest issue, in my opinion, is in dependency management. Python has a horrible dependency management system, from top-to-bottom. Why do I need to make a "virtual environment" to have separate dependencies, and then source it my shell? Why do I need to manually add version numbers to a file? Why isn't there any builtin way…

I agree that builtin tools suck for dependency management. However a lot of the issues that you mentioned (such as lock file and transitive dependencies) can be handled by pipenv, which should be the default package manager

Poetry is way way better imho. https://poetry.eustace.io
Post reply on HN