DEV Community

Discussion on: When do you create a function or method?

 
codevault profile image
Sergiu Mureşan

Yup, that's why they were designed. Data with functionality. Just be careful not to group data with functionalities that don't actually deal with the data as whole but just parts of it. Or even worse, consider functionalities as objects and creating classes based on those. It can lead to so many headaches.