In my code either of the above two options would work equally well but I am interested in finding out the pros and cons of both approaches.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the functions are completely stateless, a module with functions would work just fine and is simpler.
If, one the other hand, there is state involved, it is usually better to encapsulate that state in a class, and provide the functionality through member functions.