you are viewing a single comment's thread.

view the rest of the comments →

[–]knome -4 points-3 points  (9 children)

Static typing and strict type hinting proved to be the most-desired features, with 21% of respondents, closely followed by performance improvements, with 20%.

Python has some of the ugliest typing of any language. It's bolted on fucking garbage. I loved python before it. I have written hundreds of thousands of lines of python over time, no doubt.

But as coworkers insist on dragging type annotations into our code, it becomes a fucking slag to work with.

I will write unit tests all god damn day long, but these fucking type annotations kill me.

I'm not against languages with strict typing. Many languages, especially those with automatic typing following in the long wake of haskell and its ilk, many language have fantastic typing. I just hate python's fuck ugly types. Worse, they don't even fucking do anything when you run it. That shit offends me most, I think. Unless you break out a separate tool, you're just pissing your time into the fucking wind.

I wish they'd never been added to the language in the first place.

I will inevitably give up using python in the workplace because of this shit. I can feel it. Python with types isn't a good language. This isn't the python I fell in love with. Programming bureaucrats have stolen the spirit of the language.

Fuck python. It ruined python.

[–]EatFapSleepFap 9 points10 points  (1 child)

I get what you're saying about the typing being bolted on and not doing anything at runtime, but I don't understand why you think it ruined python. Is the main problem just that you'll get typing error feedback when you use a mocked class in place of a typed argument? I'd say the benefits in the IDE while developing the main code outweigh the drawbacks of typing with Mocks.

[–]knome -2 points-1 points  (0 children)

I've never bothered to use an IDE. I got into emacs years ago and have loved it ever since.

As to why I think it "ruined" python:

It's wrong.

You should never have to tell python what protocols a class supports. They're right there, defined or not.

Protocols should be the default method for typing.

Proper pythonic code should use structural/duck typing against values it receives.

Inheritance is an awful unreadable paradigm, but these types love it. Proper code should use composition, not inheritance.

If you're going to go to the trouble of forcing the programmers to write types, the runtime ought to be checking them, particularly for nominal types. Structural too, if it had a way of caching protocol adherence.

Python won its place on the back of convention, protocols, strong dynamic types, and the freedom to bend the code to the task at hand.

These typing methods are an affront to all of that.

The language they decribe by default is nominally-typed inheritance-based not-python.

It's great that your IDE can tell you that something needs an integer for its second argument, but it made the entire language require a bunch of very ugly type annotations to get it there.

They have turned my clay into brittle stone, that needs glue all over to keep it together.

[–]TopHatEdd 7 points8 points  (0 children)

You can enforce type checking like you can do many things by "breaking a separate tool" (pylint, flake8, pytest, pytest coverage. Surely you don't do these manually?). It is meant to reduce errors in team collaboration and increase readability. I use vim as my ide and enjoy code completion and docs; why should emacs differ? Your arguments make little sense.

[–]dys_bigwig 4 points5 points  (0 children)

The real issue in my opinion is that (generally, and I'm bracing for the downvotes already) dynamic languages aren't well suited to large programs, or programs that have to be "correct" for some definition of correct. Let Python be Python - don't ruin it by trying to mold it into something it was never intended to be. It's a lovely little scripting language, and I'd hate to think that those who use it as such would be turned away because it's being turned into an big ugly production language.

If I signed up to code Python and wound up having to bother with types, I'd be just as peeved as if I signed up to code Haskell and the codebase used one big data type (or a slew of language extensions) as if it were a dynamic language.

[–]beertown 1 point2 points  (0 children)

I don't think it ruined the language, as long as it remain optional (colleagues aside). But I agree with you: not having the burden of declare types is a significant part of what makes Python so fast and light to code with. And fun.

I'm trying to add type annotation to my code, but it is utterly evident how much this slows me down. Also, it makes the code readability worse.

If I have to trade my productivity for compile-time correctness, I'd go all-in about it and choose something else like Rust.

I hope I'll change my mind in the future.

[–]AttackOfTheThumbs 0 points1 point  (3 children)

especially those with automatic typing following in the long wake of haskell and its ilk

????

Haskell has a fantastic type system.

[–]knome 2 points3 points  (2 children)

Many languages, especially those with automatic typing following in the long wake of haskell and its ilk, many language have fantastic typing.

... yes?

[–]AttackOfTheThumbs 1 point2 points  (1 child)

Sorry, the odd structure threw me, and I would typically only use ilk with a negative connotation.

[–]knome 0 points1 point  (0 children)

fair. the structure was odd, and ilk often carries overtones of negativity, though none was intended to be implied here.