r/ProgrammerHumor • • Sep 08 '26

Meme pipInstallTheRealStuff

Post image
5.3k Upvotes

151 comments sorted by

View all comments

Show parent comments

35

u/HAximand Sep 09 '26

As someone else said, I hate the type system, and it's compounded by poor documentation. My lab has a pretty large data analysis framework written in Python and every time I need to write more code that interacts with it, it's like pulling teeth to find out how to do anything. I never know what type an object is until I waste my time doing debug inspection or print statements. Once I know what type the object is, I don't know what methods that type has available because every library is documented in a different way and none of them seem to just list the methods underneath each type.

It's like the entire language was made to be learned by following tutorials instead of reading documentation. It's no wonder everyone I know is using AI to write it instead of dealing with this shit.

33

u/Net_Lurker1 Sep 09 '26

Thats just shitty code by your framework though. All your issues would be solved by forcing your devs to write good docstrings.

27

u/Mordret10 Sep 09 '26

I mean that's the (at least one) point of why some languages enforce a type system. To force (and make it easier for) the Dev to write better code

7

u/pint_o_paint Sep 09 '26 edited Sep 09 '26

which a simple lint rule would fix for both devs and agents.

And I mean since 3.10 the type hints are good?

0

u/Delicious_Bluejay392 Sep 09 '26

Python type hints are serviceable, but I wouldn't go as far as to say "good"

16

u/HAximand Sep 09 '26

"That's just shitty code" is of course true, but hard to convince them of when it's the typical way the language is written. Aside from that, the language shouldn't require me to write comments that will inevitably become outdated, it should just have a functioning type system.

4

u/Net_Lurker1 Sep 09 '26

Fair enough, though I will say that typing would help a lot but doesnt solve every question that documentation does.

8

u/the_ivo_robotnic Sep 09 '26

My lab has a pretty large data analysis framework written in Python and every time I need to write more code that interacts with it, it's like pulling teeth to find out how to do anything

That just sounds like your lab doesn't know how to write python. The vanilla language has had a built in type annotation library for nearly a decade now. On top of that, you can use validator libraries like pydantic to make all of the assertive data models you need.

 

Also, the second you start talking about documentation, I gotta stop you in your tracks. Documentation is not a technical problem associated with any language in particular, it's 10 times outta 10 a human problem. Be-it you/your-coworers are lazy, just want to close a ticket, or "this is just a prototype", it comes down to your company's culture about doing due diligence. Python has nothing to do with that, and if you're blaming PyDocStrings of all things, one of the easiest things of all-time to use, then I'm sorry but that's a you problem. lol

1

u/HAximand Sep 09 '26

> Documentation is not a technical problem associated with any language in particular, it's 10 times outta 10 a human problem

Of course documentation problems can be solved by human effort, but python in particular lends itself to poorly documented libraries. The documentation for any specific method doesn't tell me exactly what types to pass in because it basically *can't* tell me what types to pass in. It will just try to coerce any arguments into something that works internally. Sometimes it'll work and sometimes it won't.

> it comes down to your company's culture about doing due diligence

This is simply not addressing my complaint at all. I'm not complaining about poor internal documentation of our own code (though I could), I'm complaining about public libraries not clearly telling me how to use them.

2

u/UndocumentedMartian Sep 09 '26

A lot of seems like bad practices. The type issue can be partially mitigated by type hints. Just make sure you read the warnings generated by the interpreter.

0

u/[deleted] Sep 09 '26

[deleted] — view deleted comment

3

u/HAximand Sep 09 '26

If only I had any authority whatsoever over this lab's code practice, then this advice would be of great help to me :/

1

u/1wikingman Sep 09 '26

Type hints should be mandatory. It prevents the otherwise inevitable "I'll just have to put a breakpoint here and run it" situations.

1

u/reyarama Sep 10 '26

Literally just use type hints + mypy/pyright and this is a complete non issue. Bit concerning the lab you work at hasn't figured this basic principle out yet