Conversation

I respect OOP for creating the concept of classes and objects. that’s a very powerful abstraction that I use all the time in Python

but I do not understand how anyone can get anything done in a pure OOP language like Java or C#, or even what they were trying to accomplish by designing those languages Like That

2
0
4

@desea I do use pyright to do static type checking in Python! and circular imports are a pain. maybe you have a point - I’m not sure

I’m just so put off by everything that I’ve seen of C#, for example. like how you have to manually specify namespaces, and how this.varName is implicit so everyone just types varName which seems like a massive footgun to me. and also how C# seems to have no concept of a function - only a class with a method. that seems like it would lead to the frustrating situation of having to instantiate an object and then give it a bunch of data it doesn’t need in order to do something very simple, which I’ve encountered with Python libraries that are wrapping an OOP API from another language

1
0
1

@desea also in Python subclassing something is very dangerous. you basically have to know all of the implementation details of the class that you’re subclassing or you’ll subtly break something. and I’m not sure how a language could be designed where that’s not the case

0
0
2

@kasdeya did you know? Everything is a function in python

1
0
1

@shijikori it is? interesting omg. I know that’s (edit: kinda) the case in Lua and I’ve heard that that’s the case in JS (though I suspect that it’s a lot more complicated than that in JS)

1
0
0

@kasdeya an object is just a function that returns an instance of itself. Methods are just functions in a function

1
0
1

@shijikori woahh omg. I just tested and it is possible for me to set attributes of a function in Python - so I can really see how this would work, I think. that’s so cursed lol but actually pretty cool. I wonder if it’s possible to create your own class implementation using only Python functions

1
0
0

@desea omg static classes are a thing? that’s so weird but interesting. that does sound like it might be a good solution to that problem

and yeah I love Rust’s trait system. I hated my time using Rust so much but I loved the trait system so much that I created an approximation of it for TypeScript for my Bitburner code, and I’m thinking about porting it to Python as well

0
0
1

@kasdeya I find they have very similar sets of tools, arranged a bit differently so that some things are more inconvenient on one side or the other

for example it's inconvenient (and a bit pointless) when you just want a plain function and you have to put it in a static class, but semantically it's the same as having a plain function, you just call it by ClassName.functionName

0
0
1

@kasdeya yep. someone much more knowledgeable told me that about python.

0
0
1