DEV Community

Discussion on: The 14 habits of highly effective developers (Part 1)

Collapse
 
anduser96 profile image
Andrei Gatej

Very useful!
Number 3 helped me a lot as I’m dealing with a situation in which a have a bunch of helper functions and some of them can take up to 5 parameters. Even though I did some fancy things with classes, I hadn’t had the idea of wrapping those functions into a class.

Where would you advise me to store this Helper class?

Thank you for your time!

Collapse
 
pavlosisaris profile image
Paul Isaris

Hey Andrei, thanks for sharing your thoughts!
Usually when having a helper method that only provides dummy or trivial functionality, a good idea is to put it in a class with an appropriate name, and call an instance of this class. You can also make this class a Singleton (Google it) so that you don't need to have multiple instances of it accross your project.

Collapse
 
anduser96 profile image
Andrei Gatej

Sounds awesome! Thank you.