DEV Community

Discussion on: Best Practices for TypeScript: Elevate Your Code Quality 🚀

 
brunomonteiro1 profile image
Bruno Monteiro

I think a better advise would be to not mix them in the same project/module. Sometimes I see code that has both types of declaration used in similar ways and in the same scope, probably because of different developers acting on the project. It makes the code look ugly and a bit confusing.

If you're going to use traditional named funtions, stick to it, maybe with the exception of callbacks.

Thread Thread
 
emil profile image
Emil

Functions and Arrow Function serve their own purpose. They are not contradicting each other. Example this binding

Thread Thread
 
shivams1007 profile image
Shivam Singh

@brunomonteiro1 @emil
I strongly agree