~1 min read|
In his blog post about his preferred file structure for React projects, Josh W Comeau distinguished between utility and helper functions.
This is a question that I’ve wrestled with a lot myself, and so I appreciated the clear(ish) dilineation.
A helper is something specific to a given project. It wouldn’t generally make sense to share helpers between projects; the category.helpers.js functions really only make sense for this blog.
A utility is a generic function that accomplishes an abstract task. Pretty much every function in the lodash library is a utility, according to my definition.
Going forward, I’ll work on adopting this distinction in my own projects.
Hi there and thanks for reading! My name's Stephen. I live in Chicago with my wife, Kate, and dog, Finn. Want more? See about and get in touch!