Live data from Hacker News

Python Is Eating the World

zdnet.com

191–200 of 993 posts

Re: Python Is Eating the World

#191

Earlier quoted context omitted.

```--max-line-length=120``` passed to flake8 will switch it to 120. Use another number for a different length. Things like max line length should be something your org or your fellow contributors decide on, not something dictated to you no matter what the language.

As I've said elsewhere, the python culture I encounter is extremely serious about maintaining it. It's just not worth fighting over.

On a given company it's often winnable. Nobody in my company fought for 80 char. We ditched it and moved on.

Re: Python Is Eating the World

#192

Earlier quoted context omitted.

Then may I respectfully submit you or your employer should buy an appropriate monitor or you chould use two. I'm not asking for 300 character lines. A 25% increase would be a rational and sufficient nod to the fact that monitors are bigger.

I work at the same place you do. I code often enough from my macbook, using likely the same tools that you use, and they're truly painful with >80 character lines. I don't understand how Go and Java devs survive. I also don't think an 80 character line limit is a bad thing: small well defined functions that do only one thing are good. Long lines often encourage people to want to nest code deeply (which is terrible!)…

The only tool that gets remotely irritable about it is the one we use for diff reviewing, afaict?

> I also don't think an 80 character line limit is a bad thing: small well defined functions that do only one thing are good. Long lines often encourage people to want to nest code deeply (which is terrible!) or to write complex one-liners, and that + list comprehensions is a dangerous pairing.

Python already starts you out at a nest of 2-4 characters, so we don't even get the full 80.

But honestly I don't think a 100 character line is going to doom us all to hyper-nested expressions.

Re: Python Is Eating the World

#193

Earlier quoted context omitted.

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.

> Well that sounds like a personal problem

Have I given you the impression that any of the opinions or experiences I have expressed here are not personal?

I've never not encountered them, so I guess you're just lucky.

Re: Python Is Eating the World

#194
I find Python to be a great alternative to writing bash scripts. I did that with this semi-popular Android tool (https://github.com/ashishb/adb-enhanced). Python is close enough to be a language but straight-forward enough to be a shell script.

For the Python haters here. No, Python is not as good as GoLang or Kotlin for maintenance but IMHO, it is better Javascript/Typescript/C++ for writing non-performance critical code.

Re: Python Is Eating the World

#195
post #161

Earlier quoted context omitted.

This is about as sensible to me as saying it is a good idea because most trains are longer than they are wide. Who cares about those things, we use computers that nearly all have 4:3 or 16:~10 displays (or wider), and many of use use more than one of them.

Display size has nothing to do with it. Long lines are hard to read: https://en.wikipedia.org/wiki/Line_length

I obviously don't agree, but it is worth noting that comparing typographic conventions for English with typographic conventions for code is not a very good idea, to me. Especially when we're discussing a language with semantically active whitespace.

A 100 character line might only see 15-70 characters of active use.

Re: Python Is Eating the World

#196

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…

Definitely feel the same.

The way I think about it is that Python is a strong local optimum in a space that has a massively better optimal solution really close by. But it's nearly impossible to get most people's algorithms to find the real optimum because Python's suboptimal solution is "good enough". And the whole software industry (and in some ways, by extension, all of humanity ... to be over melodramatic) is suffering for it.

Re: Python Is Eating the World

#197
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?

I'm not the person you're responding to but what they say resonates with me as a Python developer. I believe Python is quite possibly the best language for a few things * Exploratory programming - such as what data scientists do * Writing programs that will never grow beyond 150LOC, or roughly what fits on a screen + one page down When I have those two constraints met I am almost always choosing Python. Here are some…

> The common "don't use exceptions for control flow" is broken right off the bat with StopIteration. I just think error handling in Python is god awful, really.

Python explicitly does not agree with this...

The same for a lot of your other complaints. It sounds like you are trying to write some other language in Python. Similarly if someone in a team using Java tried writing Python in Java they would complain a lot and end up with ugly hard to work with Java.

Re: Python Is Eating the World

#198
post #166

Earlier quoted context omitted.

This is about as sensible to me as saying it is a good idea because most trains are longer than they are wide. Who cares about those things, we use computers that nearly all have 4:3 or 16:~10 displays (or wider), and many of use use more than one of them.

Are you implying short and wide trains would be sensible? I like using a wide screen for programming, but prefer code formatted to 80 chars. That allows me to have two vertical windows of code open side by side. It also makes it easier to use things like a graphical diff to merge code.

Well they'd be interesting, I guess. Maybe they are already short and wide and they're like crabs that scuttle to their side?

Re: Python Is Eating the World

#199

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 would rather wish Golang eat the world than Python, just because the practicality of python becomes questionable when performance is key.

In my previous startup in India, I trained unskilled personnel to become decent python developers to work on our product; everything was fine till the product grew exponentially and we had to optimise every nook and corner of it to better serve the customers and save on server bills.

So we had to optimise our application with Cython to meet the demands. So, when training someone to code if we use Python as a language; we should follow up with the disclaimer "You will learn to code faster than most other languages, but you cannot use this knowledge to build something at scale (i.e at-least when budget is of concern, when you are not instagram)".

In comparison, Golang excels in both form and function. It is just as easy to teach/learn as python and doesn't need the aforementioned disclaimer. Web services are a breeze to write and is built for scale.

I understand that there are criticisms against the language design of Go, some are valid and most are just because it was made by Google but none questioning the scalability of Go applications.

Re: Python Is Eating the World

#200

Earlier quoted context omitted.

I'm not the person you're responding to but what they say resonates with me as a Python developer. I believe Python is quite possibly the best language for a few things * Exploratory programming - such as what data scientists do * Writing programs that will never grow beyond 150LOC, or roughly what fits on a screen + one page down When I have those two constraints met I am almost always choosing Python. Here are some…

> The common "don't use exceptions for control flow" is broken right off the bat with StopIteration. I just think error handling in Python is god awful, really. Python explicitly does not agree with this... The same for a lot of your other complaints. It sounds like you are trying to write some other language in Python. Similarly if someone in a team using Java tried writing Python in Java they would complain a lot a…

> Python explicitly does not agree with this...

OK, I'm willing to contend that that is the case. It doesn't have much to do with my overall issue with error handling.

> The same for a lot of your other complaints. It sounds like you are trying to write some other language in Python. Similarly if someone in a team using Java tried writing Python in Java they would complain a lot and end up with ugly hard to work with Java.

This is a very loose criticism of my post, I don't know how to respond to this. I've written Python for years, I think I gave it due credit for what it's good at.

I am not trying to write some other language with Python, I just think Python is not a very good language compared to others given a lot of fairly typical constraints.

Post reply on HN