Namespace + functions versus static methods on a class

Let’s say I have, or am going to write, a set of related functions. Let’s say they’re math-related. Organizationally, should I:

  1. Write these functions and put them in my MyMath namespace and refer to them via MyMath::XYZ()
  2. Create a class called MyMath and make these methods static and refer to the similarly MyMath::XYZ()

Why would I choose one over the other as a means of organizing my software?

9 Answers
9

Leave a Comment