Instance methods, static methods, class methods: Difference between revisions

From Helpful
Jump to navigation Jump to search
(Created page with "<!-- For context, most functions defined on a class will be considered '''instance methods''': they will work on an instance of that same class. Calling them will always take. (exactly how explicitly it is in the ''definition'' of this function may vary with the language) They will accept one, and do so implicitly somehow - some languages make you write out the object reference ('self' or 'this' turns up around here), others have it implied. That is not the only...")
 
mNo edit summary
Line 20: Line 20:
: often purely for organizational reasons, and/or when these utility functions are ''only'' relevant to that one class, and e.g. whether the arguments would be instances of this class, or whatever else, is entirely up to you.
: often purely for organizational reasons, and/or when these utility functions are ''only'' relevant to that one class, and e.g. whether the arguments would be instances of this class, or whatever else, is entirely up to you.
::: It's organization more than structuring
::: It's organization more than structuring
::: Just how necessary that is to cleanliness may depend on how much you split out your modules<!-- and/or how much you fetishize OO.-->
::: Just how necessary that is to cleanliness may depend on how much you split out your modules and/or how much you fetishize OO.





Revision as of 01:40, 18 February 2024