Often a function belongs to neither type. Instead the logic cuts across those two types. The key disadvantage I notice is ending up with very large and unreadable classes which poorly categorise business logic, when you could have been categorising functions in modules based on different business needs.
I've noticed the benefits of writing non member functions in
Python codebases. Say if you have a User model in a Django ORM,
and you have a Thing model, and some operation on User and Thing.
I've noticed that your code is almost always better if you write
a non member function on User and Thing, instead of a member of
User or Thing.
- Required Reading: "How Non-Mem... Walter Bright via Digitalmars-d
- Re: Required Reading: "Ho... rikki cattermole via Digitalmars-d
- Re: Required Reading: "Ho... who cares via Digitalmars-d
- Re: Required Reading: &quo... Jacob Carlborg via Digitalmars-d
- Re: Required Reading: "Ho... Kagamin via Digitalmars-d
- Re: Required Reading: &quo... Jacob Carlborg via Digitalmars-d
- Re: Required Reading: ... Kagamin via Digitalmars-d
- Re: Required Readi... Jacob Carlborg via Digitalmars-d
- Re: Required ... w0rp via Digitalmars-d
- Re: Requi... Jonathan M Davis via Digitalmars-d
- Re: Required Reading: "Ho... Steven Schveighoffer via Digitalmars-d
- Re: Required Reading: &quo... Dukc via Digitalmars-d
- Re: Required Reading: "Ho... JN via Digitalmars-d
- Re: Required Reading: &quo... Jonathan M Davis via Digitalmars-d
- Re: Required Reading: &quo... Walter Bright via Digitalmars-d
- Re: Required Reading: ... Jonathan M Davis via Digitalmars-d
- Re: Required Reading: ... Kagamin via Digitalmars-d
- Re: Required Reading: ... codephantom via Digitalmars-d
- Re: Required Reading: "Ho... Dmitry Olshansky via Digitalmars-d