Live data from Hacker News

Python programming is drowning in red tape

stefanoborini.com

31–40 of 183 posts

Re: Python programming is drowning in red tape

#31

I freelance in both python and C#, python used to get the job done in 200 lines vs C# at 500, now its 300|300 and the C# is easier to read

Line count can be a misleading way to measure C# length given there are so many braces on their own lines. But also, the thing is, if you're coding in like Visual Studio, you often don't even type so many of the characters -- the IDE does it for you. So I guess the question I would instead ask is: which one did you feel more productive in? (Including everything from IDE startup time to debugging.)

Re: Python programming is drowning in red tape

#32
post #14

As a long time Python fan, I find the current state of the language frustrating. Tools like black and poetry are nice, but are not part of the standard library. Yet they seem to be required by every popular project out there. (Also, black’s formatting is quite ugly, as noted in this blog post) Meanwhile, the language itself is increasingly baroque and complicated. Type-annotated, asyncio-enabled Python hardly resembl…

> Type-annotated, asyncio-enabled Python hardly resembles the easy-to-understand language I fell in love with back in 2006. true. i am all for types in general and for types annotations in python. but i have seen some heavily type-annotated python code lately and i don't think that's where we want to be. we are starting to look like a heavily templatized cpp code.

Don't mix things, guy! - asyncio it's one thing: From my point of view it's amazing... makes python be able to compete with nodejs or go.. (not so hard, if you work also on the browser)

- mypy: that's another story, but it's also optional, use it if you want... (my opinion, like in typescript, if I want types I will do it with go or rust)

Re: Python programming is drowning in red tape

#33
post #14

As a long time Python fan, I find the current state of the language frustrating. Tools like black and poetry are nice, but are not part of the standard library. Yet they seem to be required by every popular project out there. (Also, black’s formatting is quite ugly, as noted in this blog post) Meanwhile, the language itself is increasingly baroque and complicated. Type-annotated, asyncio-enabled Python hardly resembl…

> Type-annotated, asyncio-enabled Python hardly resembles the easy-to-understand language I fell in love with back in 2006. true. i am all for types in general and for types annotations in python. but i have seen some heavily type-annotated python code lately and i don't think that's where we want to be. we are starting to look like a heavily templatized cpp code.

> we are starting to look like a heavily templatized cpp code

Which was my main concern when type-hints were added

Give a hand to the strong-typed people and they will take the whole arm.

They will take Python as "now it's like Java" and will push it all the way through.

Re: Python programming is drowning in red tape

#34
post #32
post #14

Earlier quoted context omitted.

> Type-annotated, asyncio-enabled Python hardly resembles the easy-to-understand language I fell in love with back in 2006. true. i am all for types in general and for types annotations in python. but i have seen some heavily type-annotated python code lately and i don't think that's where we want to be. we are starting to look like a heavily templatized cpp code.

Don't mix things, guy! - asyncio it's one thing: From my point of view it's amazing... makes python be able to compete with nodejs or go.. (not so hard, if you work also on the browser) - mypy: that's another story, but it's also optional, use it if you want... (my opinion, like in typescript, if I want types I will do it with go or rust)

Right. Projects can always choose not to enable asyncio. I don't see what the problem is. Right tool for the job, &c.

Re: Python programming is drowning in red tape

#35
post #8

Earlier quoted context omitted.

> Tools like black and poetry are nice, but are not part of the standard library. If black does non-PEP 8 formatting, as the article says, then I would not expect it to be in the standard library, since PEP 8 formatting is the Python standard. > the language itself is increasingly baroque and complicated I don't find current Python 3 any more baroque or complicated than Python 2.7. In fact I have plenty of Python cod…

> You don't have to use these features if you don't want or need them. Nobody uses 100% of any language's features, and the subset that is used can be very different from person to person. I don't see that as a problem. The problem is that other people might use those features and you also might have to read the code created by those people.

And what's the problem on having some type hints on some func signatures?) You can read python exactly the same way (with and without type hints)....

Re: Python programming is drowning in red tape

#36
post #14

As a long time Python fan, I find the current state of the language frustrating. Tools like black and poetry are nice, but are not part of the standard library. Yet they seem to be required by every popular project out there. (Also, black’s formatting is quite ugly, as noted in this blog post) Meanwhile, the language itself is increasingly baroque and complicated. Type-annotated, asyncio-enabled Python hardly resembl…

> Type-annotated, asyncio-enabled Python hardly resembles the easy-to-understand language I fell in love with back in 2006. true. i am all for types in general and for types annotations in python. but i have seen some heavily type-annotated python code lately and i don't think that's where we want to be. we are starting to look like a heavily templatized cpp code.

Heavily templates C++ code is something very few things can match; I would be quite surprised if anything from Python came close.

Re: Python programming is drowning in red tape

#37

Line length is such a hard problem to solve. I wish there was a way to be like don’t allow more than 95% percent of my lines to be longer than X. I run into this in Django a lot with my chained ORM queries. The usually tend to be like 10-15 chars to long. And in this case you have to line break on the parameters or on a ‘.’ which is ugly as well. While not related to Python, I feel like whenever I write JS code, espe…

Yes

My personal preference regarding line lengths: 80 chars are not enough. And even pep8 says that "foolish consistency is the hobgoblin of little minds"

So try being under 80 chars but sometimes you can't. Also don't break a line that's like 85 chars if it will just make it more ugly

I'm glad Prospector by default doesn't enforce "the cult of 80 chars" dogma

Re: Python programming is drowning in red tape

#38
OP behaves like a giant tool and a baby both in this blog post and more importantly in the Github issue report ( https://github.com/psf/black/issues/1178 ).

Therefore...

> My problem with the above formatting is that the list of arguments and the body of the function are now at the same indentation level.

OP weirdly complains here that equal scopes shouldn't be equally indented, and, let's be clear, declared function arguments are the same scope as the function body.

> My point is that the proper way to indent the above code is...

OP is dumb and wrong and should feel bad for missing the first section of PEP8 right after the introduction. It's titled "A Foolish Consistency is the Hobgoblin of Little Minds".

OP's proposed "correct" way is to arbitrarily leapfrog an indentation level and then backtrack. Personally I think that makes OP a bad person. As an adherent of The One True Brace Style (K&R), I find OP's proposal to be super ugly and much harder to read than Black's style.

> PEP8 recommends

PEP8 can recommend anything it wants. That particular recommendation is bad and not based on anything other than Guido's personal preference. It's fine for Guido to have preferences, but OP should feel bad for _demanding_ it.

> I decided to do the unthinkable: fork it

It's open source software on github. Forkability is literally the point.

> *I don’t know if you ever saw the code of black. It..."

...gets the job done well and is therefore extremely popular? Yes.

Re: Python programming is drowning in red tape

#39
post #30

As a long time Python fan, I find the current state of the language frustrating. Tools like black and poetry are nice, but are not part of the standard library. Yet they seem to be required by every popular project out there. (Also, black’s formatting is quite ugly, as noted in this blog post) Meanwhile, the language itself is increasingly baroque and complicated. Type-annotated, asyncio-enabled Python hardly resembl…

Theres always Ruby

Ruby is so great. I will switch as soon as I can.
Post reply on HN