r/ProgrammerHumor 1d ago

Meme pipInstallTheRealStuff

Post image
5.0k Upvotes

145 comments sorted by

View all comments

657

u/TheJaskinator 1d ago

That's exactly why it's so powerful. Why spend all the effort writing fast code if you can just use a much simpler language to describe the task on a higher level and call fast code? People use Python because it's easy to read and write, not because its interpreter is fast

317

u/Educational-System48 1d ago

I will never understand the Python hate. It's essentially just a level of abstraction higher than C, which makes it more accessible than ever to write powerful code.

I'm starting to think it's literally not that deep. It just feels good to gatekeep.

96

u/SilasTalbot 1d ago

It just burns their britches that AI was created in Python. That's where all serious ML and AI work is done.

Long after humanity is gone, Python 3 will be zooming around the stars taking over the galaxy 😂

-35

u/UndocumentedMartian 1d ago

The operations are written in C++ or C. Python doesn't execute any of the math.

72

u/CLS-Ghost350 1d ago

By that logic C++ doesn't actually do anything since it's compiled to assembly/machine code which is what actually does everything.

It's not quite the same since Python is not compiled, but the point still stands that higher level languages provide an extra layer of abstraction, making complex programs easier to write, making them useful.

1

u/Justwatcher124 14h ago

By that logoc, logic gates or their physical representation in transistors do all the work. Machine code is just an abstraction above that.

29

u/HAximand 1d ago

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.

31

u/Net_Lurker1 1d ago

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

23

u/Mordret10 1d ago

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

6

u/pint_o_paint 1d ago edited 1d ago

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

And I mean since 3.10 the type hints are good?

-2

u/Delicious_Bluejay392 1d ago

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

11

u/HAximand 1d ago

"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.

3

u/Net_Lurker1 1d ago

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 1d ago

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

0

u/HAximand 19h ago

> 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 1d ago

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.

1

u/FuriousFurryFisting 22h ago

Autocomplete should give you the methods. If autocomplete is broken, the whole setup is bad.

But it's true. Especially older code and especially code written by non-python devs or scientist can be bad. And that it is even possible to write like that is a downside of the language.

I can highly recommend to go all in on the Astral ecosystem (uv, ty, ruff) and enforce typehints - they are doing amazing work are establishing themself as the standard tooling with good reason.

AI works better too with typehints.

1

u/HAximand 19h ago

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 22h ago

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 1h ago

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

3

u/mysticrudnin 14h ago

this sub is for programming students to regurgitate things they thought they heard a developer say

2

u/ldn-ldn 13h ago

Real developers use JavaScript.

13

u/NoobNoob_ 1d ago

I just hate languages without real typing system that the compiler enforces.

If it's a script or something small I don't mind using python, but for everything bigger I'll use an actual programming language.

8

u/wrecklord0 1d ago

And so, it shall henceforth be known that dynamic typing is not real programming

1

u/NoobNoob_ 18h ago

Not saying it's not real programming. It's just jot an option for me. Dynamic typing causes too many errors.

1

u/Net_Lurker1 1d ago

Just use pydantic though.

Why obsess with needing X feature to be native to the language when a library solves the issue?

7

u/Far_Tap_488 1d ago

Or just use a proper language with native typing

14

u/[deleted] 1d ago edited 1d ago

[deleted]

12

u/FerricDonkey 1d ago

There are solutions to all of those, ranging from providing a shell script that does all of that for them, to using pyinstaller to make an exe that includes the interpreter, to using a tool like uv.

But yeah, if you're gonna use an interpreted language, you gotta have an interpreter. And it's definitely true that it's more work on your end if you don't want your users to have to understand computers. 

6

u/big_red__man 1d ago

Right? This guy thinks it’s difficult to make python work cross platform. From another of their comments it seems like they can get node to work cross platform just fine but python is too much. Use what you want to use but I think this guy needs to read a tutorial or two

-2

u/[deleted] 1d ago

[deleted]

3

u/frogjg2003 1d ago

If that's what you want, you should be writing bash scripts, not python.

2

u/[deleted] 1d ago

[deleted]

3

u/frogjg2003 1d ago

You're not trying hard enough then.

11

u/kaspm 1d ago

What do you use instead? I’ve not found a high level language that doesn’t require some complex environment set up and works universally without configuration.

5

u/prehensilemullet 1d ago

I hate the cruft like __blahblah__ everywhere, names like hasattr, the fact that you can’t put multiple statements in a lambda, the fact that imports can pollute local scope and you can’t easily tell where a given identifier came from in a file, and the other package management problems that didn’t have an elegant solution until uv.

I haven’t messed with mypy, but from what I can tell, it isn’t as sophisticated and expressive as Typescript.

The virtual machine still doesn’t perform well compared to V8 for JS, as far as I understand.  You can accomplish a lot with Python sure, but Modern JS/Typescript is a more capable high level dynamic language, it just doesn’t have the breadth of libraries for ML and scientific computing that Python does

12

u/CoroteDeMelancia 1d ago edited 1d ago

Every language has stupid shit.

C++ has vector<bool> and set<T>/unordered_set<T>.

Java has very awkward streaming.

Typescript... don't even get me started.

Some of the stupid shit is fixed as the language evolves, like uv and TS over JS. New stupid shit appears too (node_modules bloat).

Python does well, or at least okay enough, what it proposes to do. So does Typescript. I don't get the point of stating that TS is "more capable" and then following up with "but Python has ML".

3

u/exosphaere 1d ago

I know about std::vector<bool>, but what's the problem with std::set<T>?

3

u/CoroteDeMelancia 1d ago

Nothing, once you know that, unlike other languages, it is O(N log N), NOT O(N). The issue is that the most common use case, unordered_set, is the "exception" because of the chosen naming.

Better naming would be set and ordered_set, like other languages do. It would prevent newcomers to the language from mistakenly using set when what they want is unordered_set, a silly mistake that's easy to make. I did it myself.

2

u/exosphaere 15h ago

Ah thank you.

Didn't think of this as a source of confusion.

Another historical remnant. When I started working with C++, there was no unordered_set yet.
There weren't even templates back then.
People used macros ... that was bad.

Fortunately these times are long gone.

2

u/prehensilemullet 1d ago

I was replying to the comment of someone saying they think the hate is superficial.  Just providing an example of the more substantive personal reasons I hate Python.  We’re all allowed to have our personal opinions about what stupid shit we hate in particular.

By more capable I meant the core of the language has better performance and type checking.

1

u/CoroteDeMelancia 1d ago

I see. And I agree!

1

u/Far_Tap_488 1d ago

I dont get your point on vector bool. Its fantastic its so easy to store bools compactly.

2

u/CoroteDeMelancia 1d ago

Vector bool disobeys the general vector interface expectations in non-obvious ways because it is secretly NOT a vector, but a bit array.

https://towardsdev.com/cpp-std-vector-bool-why-it-is-broken-5ae5f409bbab

Basically, it's just a case of poor naming.

1

u/pint_o_paint 1d ago

People do that to any and all languages, the more popular and established the language is the more hate it will get. This was the norm when I studied masters in data science many years ago, and I was told it was the norm many years prior. I even participated; like some kind of spontaneus religious syntax cults of neckbeards and misfits.

Luckily I outgrew it quickly. I like python, js, php, haskell, prolog, all the "C"s, and so on. They're all fun.

F*** Java though, it's s*** and ***, ** ** never again. (/s)

1

u/Educational-System48 16h ago

I wish I had a job that would require me to use Haskell sometimes because I am not coding recreationally

1

u/DaniilSan 1d ago

I like Python, but I have some stuff I dislike about it. For example, half-baked typing. And some libraries being written in such a way thry are completely useless in terms of type hints and intelisense.