armchair_progamer

@[email protected]

This profile is from a federated server and may be incomplete. View on remote instance

armchair_progamer , (edited )

C++’s mascot is an obese sick rat with a missing foot*, because it has 1000+ line compiler errors (the stress makes you overeat and damages your immune system) and footguns.

EDIT: Source (I didn't make up the C++ part)

https://i.imgur.com/RkD4juc.png

https://media3.locals.com/images/posts/2024-01-10/102127/102127_99yfyumtxc53rd4_custom.jpeg

armchair_progamer OP , (edited )

I could understand method = associated function whose first parameter is named self, so it can be called like self.foo(…). This would mean functions like Vec::new aren’t methods. But the author’s requirement also excludes functions that take generic arguments like Extend::extend.

However, even the above definition gives old terminology new meaning. In traditionally OOP languages, all functions in a class are considered methods, those only callable from an instance are “instance methods”, while the others are “static methods”. So translating OOP terminology into Rust, all associated functions are still considered methods, and those with/without method call syntax are instance/static methods.

Unfortunately I think that some people misuse “method” to only refer to “instance method”, even in the OOP languages, so to be 100% unambiguous the terms have to be:

  • Associated function: function in an impl block.
  • Static method: associated function whose first argument isn’t self (even if it takes Self under a different name, like Box::leak).
  • Instance method: associated function whose first argument is self, so it can be called like self.foo(…).
  • Object-safe method: a method callable from a trait object.
armchair_progamer ,

<span style="font-weight:bold;color:#a71d5d;">public class </span><span style="color:#0086b3;">AbstractBeanVisitorStrategyFactoryBuilderIteratorAdapterProviderObserverGeneratorDecorator </span><span style="color:#323232;">{
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">// boilerplate goes here
</span><span style="color:#323232;">}
</span>

Supermarket AI meal planner app suggests recipe that would create chlorine gas ( www.theguardian.com )

A New Zealand supermarket experimenting with using AI to generate meal plans has seen its app produce some unusual dishes – recommending customers recipes for deadly chlorine gas, “poison bread sandwiches” and mosquito-repellent roast potatoes....

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • tech
  • kbinEarth
  • testing
  • interstellar
  • wanderlust
  • All magazines