Hi Maxi Contieri,
Thanks for the prompt response. However, I am still on the fence. In my current project (React & Redux), we exclusively use (anonymous) functions as they are small and writing unit tests are just a breeze.
I just feel like they've been convenient enough.
The code is well maintained from time to time, but no one talked about switching to use Class helpers.
I doubt if it's just a matter of preference or the scope of the projects. Mind if I ask for some more examples for the Problems you mentioned in the Code-smell-21? I'd be very glad to have a better view and understanding.
Great article! a few small typos:
-the function
getCategory()gets the user's score, but in its usage, you're passing the entire user object.In the right example, the naming function gets
userscoreas the paramer, while it should (for the best of my understanding) beuser.Same goes for the score that in the right approach accepts
userscore1as parameter (which for me also feels a bit like a code smell as there is only 1 parameter)