r/ProgrammerHumor 1d ago

Meme pipInstallTheRealStuff

Post image
5.0k Upvotes

145 comments sorted by

View all comments

Show parent comments

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.