3 Minutes With Kent

Is it okay to make a function async if it doesn't need to be async?

Informações:

Sinopse

Hey friends so I got a question on discord from somebody who asked effectively is it okay to put async away on a function that doesn't need it and you can get useless rules that will prevent this. I think I have the enabled because I don't typically want to do this but there are situations sometimes where you want to start with an API that isn't asynchronous now but you're pretty confident that it's going to be asynchronous in the future and it's just easier. To plan with that asynchrony from the get-go rather than try to retrofit everything to work with asynchrony in the future and so yes, it's I think it's acceptable and it's okay to make something async when it doesn't need to be and you just have to be aware that any consumer is going to have to consume an async API rather than a synchronous one and you'll have to consider the fact that because it's async it it is like as soon as you attach that async keyword onto the function onto the function keyword like right in front of that function keyword or in fr