For our codebase, we have quite a few asynchronous calls which require the async await flow since we make a lot of API calls. However, in some of these classes, we use some functions which, in nature, do not require any async operations like if-else statements on a String, an example is given below.
static async isValidLength(name){
if (name.length() > 5){
return true;
} else {
return false;
}
}
I want to argue since we mostly use async operations, wrapping all functions in an async await flow is more maintainable and less error-prone to forget using await in some truly async operations, which can cause the programme to behave in unexpected ways.
I tried to search the web whether there were some recommended conventions around this but I couldn't really find anything, so I'm asking for experiences/opinions on the matter here. Is it a bad practice to wrap non-async functions with the async keyword?