Hacker News new | ask | show | jobs
by masklinn 1296 days ago
> Explicit is better than implicit.

Not only that, but in Rust it actually has a meaning. Self can be &self or &mut self, which impacts the calling conventions.

The alternative would be fully typing anything but owned method calls which would just not have a self parameter, which would be incredibly weird.

It also shows that as in Python (and really even more so) "methods" are little more than syntactic sugar for functions. It would also require a new and separate syntax to declare non-instance methods.

1 comments

It can also be `self: Box<Self>` or `mut self: Pin<&mut Self>` or `self: Box<Arc<Rc<Self>>>` if you feel brave.