S
S
sorry_i_noob2018-03-05 19:11:49
Programming
sorry_i_noob, 2018-03-05 19:11:49

when I write a function. How to understand - when to create a class for it, and when to write it in a Helper type class (i.e. a class for auxiliary functions)?

when I write a function. How to understand - when to create a class for it, and when to write it in a Helper class (ie a class for auxiliary functions)?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
tsarevfs, 2018-03-05
@tsarevfs

A helper class or file is usually a bad idea. It attracts garbage and bicycles.
There is nothing wrong with individual functions. But if you get used to OOP, then most functions naturally become class methods.

G
Griboks, 2018-03-05
@Griboks

If a function can be generalized to several unrelated classes used in a program, then it is "helper".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question