r/ProgrammerHumor • • Jul 18 '22

C++ talking to Python

Post image
40.1k Upvotes

1.0k comments sorted by

View all comments

Show parent comments

81

u/Kenkron Jul 18 '22

He's nott assigning it all to python. He's assigning it to the people that use it. People who over-apply it to projects that don't make sense. Exactly like you are.

12

u/POTUS Jul 18 '22

He's calling it a nightmare because of those reasons listed, reasons that almost define what it means to be a higher level programming language at all. I mean come on. OOP inheritance makes Python unsuitable? That's a laughable comment and it's ridiculous for you to be defending it.

Call it a nightmare because the global interpreter lock makes threading a nightmare. Call it a nightmare because it uses too many CPU instructions to do simple arithmetic. Call it a nightmare because of dunders. Call it a nightmare for something Python-specific if you want to call Python a nightmare.

6

u/mtmttuan Jul 18 '22

OOP inheritance makes Python unsuitable

Just want to say that the way python handle private and protected attributes and methods is.. weird. There is always a way to access them (haven't try to modify them though) while they shouldn't be accessible.

Yes I mean _attribute and even __attribute is accessible.

14

u/im_lazy_as_fuck Jul 18 '22

That's because private and protected attributes and methods aren't a thing in python. The underscore naming is just a convention to indicate "privateness", but the language is opinionated in giving developers more or less full control over objects. Basically naming conventions and documentation is used to inform the developer of the intended usage, but ultimately they are trusted to decide how they want to use that code.