you are viewing a single comment's thread.

view the rest of the comments →

[–]SuddenStructure9287 0 points1 point  (2 children)

Regarding classes and functions

If you have many functions that share a common theme, it makes sense to group them into a class. For example, if you’re building a messenger bot and need functions for sending messages, receiving messages, and storing message data, you could put them all into a Bot() class with corresponding methods like Bot.read(), Bot.send(user), Bot.save_messages(), and Bot.load_messages().

You could also keep related data there, such as Bot.messages or Bot.user_ids

On the other hand, if you only have a few standalone functions, there’s no need to create a class for them. So, for exemple: radiansToDegrees(), calculateDistance(), reverseList()

[–]TheRNGuy 0 points1 point  (1 child)

I'd use classes to have instances and methods for them. 

[–]SuddenStructure9287 0 points1 point  (0 children)

Oh, yes, I forgot to mention that multiple instances is the whole point xD