Object oriented programming in Python be like:
Object oriented programming in Python be like:
Object oriented programming in Python be like:
nah, I'm never complaining about self
in Python after having tried the this
and that
nonsense in JS.
oh, you're using a named function instead of an arrow fn? Guess what, this
is not what it used to be anymore.
Wait there's a "that"???
Oh, you assigned a method to a variable before calling it? Congratulations, this
is now undefined
.
Yeah totally agree.
As a non-programmer who's occasionally dabbled with wxPython, I've entangled myself with self.parent.parent and their childs/siblings more than once. At that stage I know my project is done.
Sorry, I'm too Rust-pilled for this OOP nonsense
rs
pub fn new() -> Self { Self::self().self.unwrap() }
Reminds me of java
I have Toolkit toolkit = Toolkit.getDefaultToolkit();
seared into my brain. Then there were the bean factories…
At least with Rust, there is a specific, defensible goal for why it does that.
Java is just over designed. All of java.io
reads like somebody's Object Orientated Programming 101 final project, and they'd get a B- for it. Lots of things where you can see how they're abstracting things, but there's no thought at all in bringing it together in a tidy way.
Even regular Rust code is more "exciting" than Python in this regard, since you have a choice between self
, &self
, and &mut self
. And occasionally mut self
, &'a self
, and even self: Box<Self>
. All of which offer different semantics depending on what exactly you're trying to do.
Having a field called r#self is malicious madness
Explicit vs implicit. Ive always liked it being explicit like that. It's better than magic keywords in say ruby.
Personally the "spaces are code" gets on my nerves for the same reason. It's implicit to the language so you just have to remember.
Am I not YAMLy enough for your YAML club?
Heh yeah yaml is another one.
Break convention
` class foo: def init(cunt, bar): cunt.bar=True
`
Kinda' looks like how a psychotic break feels:-?
Write a new method, make sure to reference self first. Write a new method, make sure to reference self first. Call the method, make sure to reference self first.
Yeah, I can see it.
You don't reference self when calling a method, what on earth are you talking about? You start with the instance when calling the method, like most/all other OOP languages.
Also there are benefits with the explicit self/this to access instance properties. In C++ you need to make sure all class properties/members have a naming scheme that does not conflict with potential parameter names or other names of other variables.
that's because anyone who develops oop in Python is mentally ill.
Python is a scripting language, not to be confused with an actual programming language. Like everything else in development over the last decade, newbs are just shoehorning whatever is hot into the language because nobody is stopping them.
What 2003 forum thread did this comment crawl out of?
that’s because anyone who develops oop in Python is mentally ill.
Hard disagree there. I would argue that most "multi-paradigm" languages converge on the same features, given enough time to iterate. It's not necessarily about hot-sauce. I honestly think its about utility and meeting your userbase where their heads are.