Hi, thanks for reading - I'm glad you enjoyed the article. I'll definitely give yours a read too :).
You're right about calling them helper functions - I think it's a kind of industry standard term (or at least it is here), for separating out pieces of logic into plain functions. As for who they help... I'm not sure either. Probably us developers :D
Arguing with standards or convention is a difficult line to take though.
e.g. why are most keyboards in a QWERTY layout? - it's an outdated convention from when typewriters would jam, but that doesn't mean keyboard or laptop manufacturers should deviate.
I've not come across a different terminology for a helper function personally. Calling it just a function could suffice but doesn't make a succinct point. As long as it's widely understood, I think it's okay - coming up with a different term could just cause more confusion.
I'm not suggesting replacing Helper with another standard.
I'm suggesting to change every helper to an intention revealing name according to the domain
in your case I think charitiesByCampaignAndCountry(campaign, country) is a very good name related to domain. But it is not a helper :)
I'm absolutely agreed with the names of the functions. Although I'd argue that as a concept, the function is still a helper 😜 (insofar as it's separating out the logical act of getting charities from the specific invocation of it).
We're a place where coders share, stay up-to-date and grow their careers.
Wow !
Nice article!
I think we should avoid ELSE and also IFS
How to Get Rid of Annoying IFs Forever
Maxi Contieri ・ Nov 9 ・ 5 min read
I like the extract you made on your function. I don't know why you call them helper. Who are they helping ?
Thank you for your article
Hi, thanks for reading - I'm glad you enjoyed the article. I'll definitely give yours a read too :).
You're right about calling them helper functions - I think it's a kind of industry standard term (or at least it is here), for separating out pieces of logic into plain functions. As for who they help... I'm not sure either. Probably us developers :D
Yes. I'm aware of that
But I think we are wrong. Calling something a 'Helper' is a code smell of a real world entity we are too lazy to find.
Here are some reasons not to use that name.
Arguing with standards or convention is a difficult line to take though.
e.g. why are most keyboards in a QWERTY layout? - it's an outdated convention from when typewriters would jam, but that doesn't mean keyboard or laptop manufacturers should deviate.
I've not come across a different terminology for a helper function personally. Calling it just a function could suffice but doesn't make a succinct point. As long as it's widely understood, I think it's okay - coming up with a different term could just cause more confusion.
Agreed with the standard part
I'm not suggesting replacing Helper with another standard.
I'm suggesting to change every helper to an intention revealing name according to the domain
in your case I think charitiesByCampaignAndCountry(campaign, country) is a very good name related to domain. But it is not a helper :)
I'm absolutely agreed with the names of the functions. Although I'd argue that as a concept, the function is still a helper 😜 (insofar as it's separating out the logical act of getting charities from the specific invocation of it).