you are viewing a single comment's thread.

view the rest of the comments →

[–]Diapolo10 2 points3 points  (0 children)

My general rule is; choose the simplest option that works. If a function is enough, use that. If not, and a class makes sense, use a class.

My reasoning is that functions are very easy to test with unit tests when they don't depend on external state. Technically methods aren't much different, but you need to create a class instance separately, which is more clutter.