What are the pros and cons of class and object methods? Which is more
concise (usually)? What kind of computations can be expressed most naturally
using each style)?

Explain PLZ!!!

Recommended Answers

All 2 Replies

There is no such thing as an "object method", unless you mean instance methods.

Simply put, if you think you need a static ("class") method you almost certainly should rethink your design.
In about 99 out of 100 cases the idea that one needs them is an indication of a design flaw, and the problem is better solved otherwise.

Some exceptions might be in constructional design patterns like factories, but cases are few, far between, and well known to those that need them.

jwenting: congratulations 7,000 posts!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.